Improving the Domain Adaptation of Retrieval Augmented Generation ( RAG ) Models for Open Domain Question Answering (2023)

Abstract: Retrieval Augment Generation (RAG) is a recent advancement in Open-Domain Question Answering (ODQA). RAG has only been trained and explored with a Wikipedia-based external knowledge base and is not optimized for use in other specialized domains such as healthcare and news. In this paper, we evaluate the impact of joint training of the retriever and generator components of RAG for the task of domain adaptation in ODQA. We propose RAG-end2end, an extension to RAG that can adapt to a domain-specific knowledge base by updating all components of the external knowledge base during training. In addition, we introduce an auxiliary training signal to inject more domain-specific knowledge. This auxiliary signal forces RAG-end2end to reconstruct a given sentence by accessing the relevant information from the external knowledge base. Our novel contribution is that, unlike RAG, RAG-end2end does joint training of the retriever and generator for the end QA task and domain adaptation. We evaluate our approach with datasets from three domains: COVID-19, News, and Conversations, and achieve significant performance improvements compared to the original RAG model. Our work has been open-sourced through the HuggingFace Transformers library, attesting to our work’s credibility and technical consistency.

## introduction open domain question answering (odqa) @xcite is an important task in natural language understanding. odqa ## background and related work open-domain qa systems @xcite generally have a two-stage pipeline: passage retrieval (i.e., finding relevant text chunks related to an input question from a knowledge base) and machine comprehension (i.e., generating an answer from a set of selected documents). traditionally sparse vector methods such as tf-idf and bm25 are used for document retrieval @xcite . researchers have recently moved to use dense text representations, which allows modeling textual similarity more semantic level. a recent example is the dpr @xcite , which generates embeddings for questions and text passages using two bert @xcite models. the dot product of the embeddings is used as a similarity score between a question and a passage. dpr has demonstrated that higher retrieval precision results in a higher end-to-end qa accuracy. for the answer generation component of qa systems, recent studies have used either extractive language models like bert or generative language models like bart/gpt-2 @xcite . ## model architecture and training procedure in this work, we extend rag to finetune all components, including the dpr retriever, and dynamically update the external knowledge base during training. we hypothesize that the use of asynchronous updates helps with domain adaptation. figure 1 demonstrates the main workflow of our model. in the following sections, we describe our extensions and training signals. ## conclusion and future work in this paper, we proposed a novel extension of rag: rag-end2end, which, unlike rag, does joint training of the retriever and generator for the end qa task and domain adaptation. we showed that rag-end2end could improve dpr performance better than finetuning the dpr independently. this allows for the training of dpr models with qa pairs and eliminates the need for gold-standard passages related to questions. we also highlighted that the addition of a re-construction auxiliary signal further improves both the retriever and the final answer generation accuracies. we evaluate our approach with three datasets from different domains (covid-19, news, and conversations), showing that rag-end2end achieves significant performance improvements in all three domains compared to the original rag implementation. in addition, we conducted several other experiments to validate our approach comprehensively. overall, our results show that our approach is stable and generalizable across different domains. our experiments highlight the importance of the rag's retriever component in domain-specific question answering. based on our findings, we suggest three directions for future research in domain adaptation of rag models. first, we consider it worthwhile to explore rag-end2end on other tasks like fact checking @xcite , summarization @xcite , and conversational response generation @xcite where the original rag has shown interesting results. second, it is important to explore generative capabilities with qualitative metrics (figure 2 in the appendix illustrates retrieved text and answers generated by rag-end2end and rag-original). this could be aligned with research areas like measuring factual consistency @xcite and hallucinations @xcite @xcite of generative language models. future work could explore whether updating the retriever and document embeddings during the training phase could improve factual consistency and reduce hallucinations in final generations. third, the improvement of rag with our extension (rag-end2end) highlights the importance of the retriever in the rag architecture, which motivates us to improve the retriever part further in future work. also, as the statement re-construction signal acts as a good auxiliary signal, we encourage exploring other auxiliary signals, which could improve the overall performance of rag models.