Improving the Domain Adaptation of Retrieval Augmented Generation RAG Models for Open Domain Question Answering Shamane Siriwardhana Rivindu Weerasekera Elliott Wen

2025-05-08 0 0 340.13KB 15 页 10玖币
侵权投诉
Improving the Domain Adaptation of Retrieval Augmented Generation
(RAG) Models for Open Domain Question Answering
Shamane Siriwardhana , Rivindu Weerasekera, Elliott Wen,
Tharindu Kaluarachchi, Rajib Rana,and Suranga Nanayakkara4
Augmented Human Lab, Auckland Bioengineering Institute, The University of Auckland
firstname@ahlab.org
4Department of Information Systems & Analytics, National University of Singapore
University of Southern Queensland
Rajib.Rana@usq.edu.au
Abstract
Retrieval Augment Generation (RAG) is a
recent advancement in Open-Domain Ques-
tion 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 do-
mains such as healthcare and news. In this
paper, we evaluate the impact of joint train-
ing of the retriever and generator compo-
nents of RAG for the task of domain adap-
tation in ODQA. We propose RAG-end2end,
an extension to RAG, that can adapt to a
domain-specific knowledge base by updat-
ing all components of the external knowl-
edge base during training. In addition, we
introduce an auxiliary training signal to in-
ject more domain-specific knowledge. This
auxiliary signal forces RAG-end2end to re-
construct a given sentence by accessing the
relevant information from the external knowl-
edge base. Our novel contribution is 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 do-
mains: COVID-19, News, and Conversa-
tions, and achieve significant performance
improvements compared to the original RAG
model. Our work has been open-sourced
through the Huggingface Transformers li-
brary, attesting to our work’s credibility and
technical consistency. 1
1 Introduction
Open Domain Question Answering (ODQA) (Lee
et al.,2019;Lewis et al.,2020c) is an important
1
This paper is awaiting publication at TACL and this is a
pre-MIT Press publication version
task in natural language understanding. ODQA
methods generally feature a two-stage pipeline: a
retriever that selects passages relevant to a given
question and a reader that generates the answers
from selected passages. Conventionally, these two
components are trained separately using ground
truth context passages relevant to question-answer
(QA) pairs. However, for many real-world scenar-
ios, it is hard to find explicitly annotated context-
question-answer triplets (Lee et al.,2019;Lewis
et al.,2020b;Guu et al.,2020).
Recently, Retrieval Augmented Models (RAGs)
have drawn considerable attention from researchers.
RAG consists of a state-of-the-art-neural retriever
called Dense Passage Retrieval (DPR) (Karpukhin
et al.,2020) and BART seq2seq language
model (Lewis et al.,2020a). Compared to the
conventional two-staged ODQA pipelines, RAG
merges the retriever and reader stages into one
architecture. Moreover, unlike expensive lan-
guage models with billions of parameters (e.g.,
GPT-3 (Brown et al.,2020) and Megatrone-
LM (Narayanan et al.,2021)) where the model’s
parametric memory represents the complete knowl-
edge, RAG can also extract knowledge from an ex-
ternal knowledge base. Using both parametric and
non-parametric memory generally leads to reduced
hallucinations and higher interpretability in tasks
like question answering and summarization (Xu
et al.,2021;Komeili et al.,2021;Guu et al.,2020;
Lewis et al.,2020b).
In this work, we focus on exploring retrieval
augmented architectures for the task of domain-
specific open-domain question answering. Al-
though there are several similar retrieval augmented
architectures, such as REALM (Guu et al.,2020)
and RETRO (Borgeaud et al.,2021), we used Re-
arXiv:2210.02627v1 [cs.CL] 6 Oct 2022
trieval Augmented Generation (RAG) in our exper-
iments due to its excellent open-source documenta-
tion and availability.
When the RAG model is finetuned for down-
stream QA tasks, the original implementation keeps
the encoding of passages and the external knowl-
edge base fixed. This is because re-encoding the
external knowledge base is computationally ex-
pensive and relies on a sophisticated implementa-
tion. Despite not finetuning the passage encodings,
the RAG model performs well for datasets with
Wikipedia-like knowledge bases because the DPR
retriever components have already been trained
on Wikipedia-based datasets (Kwiatkowski et al.,
2019;Joshi et al.,2017). However, the feasibility
of adapting RAG to specific ODQA domains such
as research papers and news is not well understood.
This is a critical research gap to address, as im-
proved domain adaptation can further improve the
ODQA performance of RAG.
This paper explores the feasibility of using RAG
in specialized domains for ODQA. In particular,
we propose two modifications to the original RAG
to improve its domain adaptability. Motivated
by recent end2end retrieval augmented mecha-
nisms (Guu et al.,2020;Sachan et al.,2021;Singh
et al.,2021), we first propose a method to fine-
tune the RAG model with its neural retriever and
update its knowledge encodings asynchronously
during training. We refer to this as RAG-end2end
since it allows us to update all RAG components
during training, including the external knowledge
base, the DPR model, and the BART model. Sec-
ondly, we propose an auxiliary training signal to
help our model learn more domain-specific knowl-
edge. This took the form of generating a concise
and factual statement about a document using a
self-retrieved set of passages from the provided
domain-specific knowledge base. These two mod-
ifications offer a unique feature to RAG-end2end
over RAG: joint training of the retriever and gen-
erator for the end QA task and domain adaptation.
Although asynchronous updates to the knowledge
encoder have been proposed before in the REALM,
previous work has not evaluated the effects of joint
training of the RAG’s retriever and the generator
for the domain adaptation in ODQA.
We evaluate our proposed approach on three dif-
ferent datasets from three domains: COVID-19
research (Wang et al.,2020), Conversations (Wu
et al.,2021b), and News (Trischler et al.,2016).
The major finding of our work is that the adap-
tation of the retriever component plays a critical
role in overall domain adaptation performance in
RAG-like architectures. Updating only the ques-
tion encoder without updating the knowledge base
encoding could degrade performance. Instead of
finetuning the DPR retriever separately, our ex-
periments show that finetuning it as a part of the
RAG-end2end mechanism gives better overall re-
sults. Our results also show that using the auxiliary
signal improves both the retriever component and
the overall accuracy.
In addition, we open-source the implementation
of RAG-end2end with the HuggingFace Transform-
ers (Wolf et al.,2019) Library
2
providing the oppor-
tunity for the scientific community to use/test/build
on our work.
2 Background and Related Work
Open-domain QA systems (Yang et al.,2015;
Kwiatkowski et al.,2019) generally have a two-
stage pipeline: passage retrieval (i.e., finding rele-
vant 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 (Robertson and Zaragoza,2009). Re-
searchers have recently moved to use dense text
representations, which allows modeling textual sim-
ilarity more semantic level. A recent example is the
‘Dense Passage Retriever (DPR)’ (Karpukhin et al.,
2020), which generates embeddings for questions
and text passages using two BERT (Devlin et al.,
2018) 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 compo-
nent of QA systems, recent studies have used either
extractive language models like BERT or genera-
tive language models like BART/GPT-2 (Min et al.,
2021;Lewis et al.,2021).
2.1 Retrieval Augmented Architecture
Recently, Retrieval Augmented Architectures
(Lewis et al.,2020b;Guu et al.,2020) have drawn
a lot of attention due to their explainable, scalable,
and adaptable nature. Unlike other open-domain
2Huggingface Transformers implementation
QA architectures, RAG (Lewis et al.,2020b) com-
bines the information retrieval stage and answer
generation stage in a differentiable manner. It uses
a combination of parametric and non-parametric
memory, where the parametric memory consists of
a pre-trained seq2seq BART (Lewis et al.,2019)
generator, and the non-parametric memory consists
of dense vector representations of Wikipedia arti-
cles indexed with the FAISS library (Johnson et al.,
2017). RAG first encodes a question into a dense
representation, retrieves the relevant passages from
an indexed Wikipedia knowledge base, and then
feeds them into the generator. The loss function
can finetune both the generator and the question en-
coder at the same time. Lewis et al. (Lewis et al.,
2020b) highlight RAG’s ability to perform well
in Wikipedia-based general question-answering
datasets like Natural Questions (Kwiatkowski et al.,
2019). Other recent work also highlights how the
outputs generated from RAG models are much
more factual due to RAG being conditioned on
the retrieved documents, possibly providing an an-
swer to the hallucination problem of generative
language models. Shuster, Kurt, et al. (Shuster
et al.,2021) also highlight how RAG reduces hal-
lucinations in knowledge-grounded conversational
tasks, where the task is to generate responses to
dialogues based on a large Wikipedia knowledge
base. Xu et al. (2021) illustrate the effectiveness
of RAG in chat-bot frameworks and highlight how
RAG models are able to recall and summarize con-
versations compared to standard seq2seq models
with only parametric memory. This paper aims
to understand how RAG could be extended to an
end2end model and adapted to specific domains.
To the best of our knowledge, this is the first time
RAG is being investigated on domain adaptation
for the task of ODQA systems.
2.2 REALM-like end2end Retrieval Augment
Architectures
REALM (Guu et al.,2020) is a similar Retrieval
Augmented model to RAG. REALM introduced
a novel masked language pre-training step that in-
volves an end-to-end trainable retriever. In the
REALM work, the authors first train the entire
model on the masked language prediction task
and then fine-tune it on question-answering tasks
(keeping the retriever frozen). In comparison to
REALM, the original RAG model uses an already
trained DPR retriever and conducts partial end-to-
end training with a BART reader model. Com-
pared to REALM, RAG is less computationally
expensive, and its code is available open-source.
We explore and extend the original RAG archi-
tecture for domain adaptation in our work. We
adapted some concepts of our RAG-end2end ex-
tension from REALM. REALM only updates its
retriever during the pre-training process that uses
the masked language modeling (MLM) (Devlin
et al.,2018) task. Then during the downstream
fine-tuning task, REALM keeps its retriever fixed.
However, the REALM end-to-end training code
is not open-sourced, possibly due to its computa-
tional complexity. Compared to REALM, RAG
is a combination of already pre-trained language
models where the users do not need to go through a
heavy pre-training stage. Due to these engineering-
friendly features and high availability, we con-
ducted our experiments with RAG and extended
RAG into an end-to-end trainable retrieval augmen-
tation model. It is also important to highlight that
none of the prior work has explored the domain
adaptation of retrieval augment models for question
answering; instead, most focus on general question
answering with Wikipedia-based knowledge bases.
Similar to REALM’s end2end architecture, re-
cent work (Sachan et al.,2021) extended RAG
and highlighted that the retriever training could
improve the overall performance in question-
answering datasets like Natural Questions. Com-
pared to our work, the authors did not focus on
the domain adaptation of retrieval augment mod-
els. The authors mainly explore the ability to train
neural retrievers in an end-to-end way using re-
trieval augment models. Similarly, another related
work (Singh et al.,2021) extended retrieval aug-
mented architectures to an end-to-end model and
illustrated that it could improve the question an-
swering accuracy. Singh et al. (2021) mainly fo-
cused on improving the document reading ability
and answer generation rather than domain adapta-
tion.
3 Model Architecture and Training
Procedure
In this work, we extend RAG to finetune all compo-
nents, including the DPR retriever, and dynamically
update the external knowledge base during train-
ing. We hypothesize that the use of asynchronous
updates helps with domain adaptation. Figure 1
demonstrates the main workflow of our model. In
摘要:

ImprovingtheDomainAdaptationofRetrievalAugmentedGeneration(RAG)ModelsforOpenDomainQuestionAnsweringShamaneSiriwardhana,RivinduWeerasekera,ElliottWen,TharinduKaluarachchi,RajibRana†,andSurangaNanayakkara4AugmentedHumanLab,AucklandBioengineeringInstitute,TheUniversityofAucklandfirstname@ahlab.or...

展开>> 收起<<
Improving the Domain Adaptation of Retrieval Augmented Generation RAG Models for Open Domain Question Answering Shamane Siriwardhana Rivindu Weerasekera Elliott Wen.pdf

共15页,预览3页

还剩页未读, 继续阅读

声明:本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。玖贝云文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知玖贝云文库,我们立即给予删除!
分类:图书资源 价格:10玖币 属性:15 页 大小:340.13KB 格式:PDF 时间:2025-05-08

开通VIP享超值会员特权

  • 多端同步记录
  • 高速下载文档
  • 免费文档工具
  • 分享文档赚钱
  • 每日登录抽奖
  • 优质衍生服务
/ 15
客服
关注