Retrieval-Augmented Generation for Knowledge-Intensive NLP
1
Presenter: Cyrus Hei Chan
Date: 31 Aug 2024
Current Pre-trained LMs
General purpose pertained LMs (i.e. seq2seq2 BART, T5) are powerful:
However, it is far from gold standard:
2
Why would retrieval be beneficial?
Retrieving knowledge from external sources is useful:
But then:
3
What is RAG?
Jointly learn to retrieve and generate end2end. You do not need any labelling for retrieved documents. Fit for seq2seq tasks.
A RAG Model consists of three components:
4
Why RAG?
RAG has gained recent prominence:
5
Design and Analysis of RAG
6
1.
Transiton headline
Let’s start with the first set of slides
7
RAG Architecture
Models
8
Training: minimize loss via SGD Adam
9
Retriever: DPR
10
Retriever: DPR
11
Generator: BART
12
Decoding: RAG-Token
13
Standard, single beam search with transition probability:
Decoding: RAG-Token
14
Standard, single beam search with transition probability:
Decoding: RAG-Sequence
15
Unlike RAG-Token, the likelihood p(y|x) isn't broken down into individual word probabilities.
As a result, you can't just use a simple beam search to find the best sequence, because you need to evaluate the entire sequence probability together, which is more complex and computationally demanding.
Decoding: RAG-Sequence
16
Approximate p(yij|x, zi) ≈ 0
where yij was not generated during beam search from x, zi for more efficient decoding
Since we are finding:
arg maxyij p(yij|x)
Experiments
17
Experimental Applications
Recall that RAG can be applied to any seq2seq tasks.
Some example tasks that require intensive access of knowledge:
18
Open-domain QA | Natural Questions (NQ), TrivialQA (TQA), WebQuestions (WQ), CuratedTree (CT) Datasets |
Abstractive open-domain QA | MSMARCO Dataset |
Index hot-swapping | DrQA Wikipedia Dump from Dec 2016 vs Dec 2018 |
Experimental Applications: Open-Domain QA
19
Experimental Applications: Open-Domain QA
20
Summary of Mechanisms and Results
Experimental Applications: Abstractive Open-Domain QA
21
Experimental Applications: Abstractive Open-Domain QA
22
Experimental Applications: Abstractive Open-Domain QA
23
Experimental Applications: Index Hot-Swapping
24
Non-parametric Memory Advantage:
RAG's ability to update knowledge by simply swapping the index demonstrates its advantage over parametric models like T5 or BART, which require retraining.
Accuracy Observations:
Future Prospects
25
thanks!
Any questions?
You can find me at email cyrchanh@connect.hku.hk or Discord @diffract_
26