T ruth R eader: Towards Trustworthy Document Assistant Chatbot with Reliable Attribution (2024)

Abstract: Document assistant chatbots are empowered with extensive capabilities by Large Language Models (LLMs) and have exhibited significant advancements. However, these systems may suffer from hallucinations that are difficult to verify in the context of given documents.Moreover, despite the emergence of products for document assistants, they either heavily rely on commercial LLM APIs or lack transparency in their technical implementations, leading to expensive usage costs and data privacy concerns. In this work, we introduce a fully open-source document assistant chatbot with reliable attribution, named TruthReader, utilizing adapted conversational retriever and LLMs. Our system enables the LLMs to generate answers with detailed inline citations, which can be attributed to the original document paragraphs, facilitating the verification of the factual consistency of the generated text. To further adapt the generative model, we develop a comprehensive pipeline consisting of data construction and model optimization processes.This pipeline equips the LLMs with the necessary capabilities to generate accurate answers, produce reliable citations, and refuse unanswerable questions. Our codebase, data and models are released, and the video demonstration of our system is available at https://youtu.be/RYVt3itzUQM.

## introduction the main objective of the document assistant chatbot is to establish a conversational mode that enables the users to seek relevant information from given documents @xcite . the advent of large language models (llms) can greately enhance the capabilities of document assistant chatbots because of their abilities of multilingual understanding, commonsense corresponding author. multi-docs reference citation attr. score generator reasoning, and instruction following @xcite . numerous frameworks and commercial products have emerged that harness llms to power their systems as shown in despite the prosperity of llm-based document assistants, some critical challenges remain unresolved. on one hand, such products face a high demand for truthfulness, which poses a significant challenge for llms, as their inherent generative mechanisms lack explicit factual grounding @xcite . specifically, llms may produce extrinsic hallucinations when essential information is missing from the retrieved documents @xcite . in this context, (q1) verifying the factuality of the response is difficult due to the length of background documents and the complexity of the response @xcite @xcite . on the other hand, (q2) a common limitation of existing open-source projects is their reliance on commercial apis. the drawback is manifold: (1) the frameworks using commercial apis limit the space of optimization on local domains; (2) the technical intricacies of commercial products are often concealed, impeding further research of the problem within the community. moreover, (3) the cost to use such products can be high, and the exposure of private documents to commercial apis raises concerns on data privacy. to address these challenges, we present our truthreader, an open-source document assistant chatbot with reliable attribution, towards a transparent and trustworthy system. our system consists of a conversational document retriever optimized for multi-turn dialogues, and a retrievalaugmented generator to generate answers. (a1) to facilitate the verification of the factual consistency in the generated text, truthreader enables the llms to generate answers with detailed inline citations, which can be attributed to the relevant document chunks (i.e., attribution chunks). additionally, we incorporate a novel attribution score interface, which measures the consistency between responses and attribution chunks. it enables users to engage in dialogues and enhance the factual grounding of their queries, thereby efficiently reducing hallucination. (a2) different from the applications that directly utilize commercial llm apis, we showcase a pipeline that trains local and controllable retrieval-augmented llms from open-source foundation models. our comprehensive pipeline involves modules for data construction and model optimization, enabling domain adaptation with no requirement on any human-annotated data, making it feasible to adapt to local documents. overall, our system exhibits the following capabilities: (1) it excels in generating accurate responses that align with the provided documents; (2) it is capable of identifying and refusing unanswerable questions when inadequate relevant information is available within the documents; (3) furthermore, it incorporates inline citations, attributing specific chunks of information within the generated responses. with truthreader, users are able to glean accurate and credible information from the supporting documents, effectively assisting them in informationseeking tasks. we release the code, data and models to facilitate future research and applications. ## user interface in this section, we introduce our document assistant chatbot truthreader illustrated in figure 1 and elucidate how it interacts with users. ## system architecture this section presents the key technical components of our system truthreader, which together form the entire architecture as shown in figure 2 . the core web application is built on gradio package @xcite . the detailed model training progress is discussed in §4, encompassing the retriever and generator modules. ## conclusion this work presents a trustworthy document assistant chatbot, truthreader, that incorporates incline citation generation and attribution chunks display to enhance the verification of answers. besides, we propose our pipeline for data construction and model optimization to adapt the llms for our system. we hope that this work can contribute to the application and research within the domain of trustworthy document assistant chatbot systems.