‼️ 개인 학습 내용으로, 오류가 있을 수 있습니다.
논문 URL - https://arxiv.org/abs/2005.11401
Pre-trained neural language models have been shown to learn a substantial amount of in-depth knowledge from data.
-> 사전 학습된 신경망 언어 모델은 상당한 양의 심도 깊은 지식을 학습할 수 있음을 보여줬다.
While this development is exciting, such models do have downsides: They cannot easily expand or revise their memory, can’t straightforwardly provide insight into their predictions, and may produce “hallucinations”.
-> 그러나 이 모델은 단점이 있다. 1) 메모리 확장이나 수정이 어려움 2) 예측에 대한 직접적인 인사이트를 제공하기 어려움 3) 할루시네이션을 일으킴
Hybrid models that combine parametric memory with non-parametric (i.e., retrieval-based) memories can address some of these issues because knowledge can be directly revised and expanded, and accessed knowledge can be inspected and interpreted.
-> 하이브리드 모델(매개변수적 + 비매개변수적 메모리가 결합)은 사전 학습된 모델의 문제를 일부 해결할 수 있다. (대표 예시 모델 : REALM, ORQA)
but have only explored open-domain extractive question answering. Here, we bring hybrid parametric and non-parametric memory to the “workhorse of NLP,” i.e. sequence-to-sequence (seq2seq) models.
-> 그러나 오픈 도메인 추출* 질의 응답만 탐구해왔기 때문에, NLP의 '주력 모델'인 시퀀스-투-시퀀스(seq2seq) 모델에 하이브리드 파라메트릭 메모리와 논-파라메트릭 메모리를 결합한 모델을 소개한다.
* 오픈 도메인 (Open-domain): 특정 주제에 제한되지 않고 광범위한 분야(예: 역사, 과학, 문화 등)에서 답변을 찾는 시스템.
The retriever (Dense Passage Retriever, henceforth DPR) provides latent documents conditioned on the input, and the seq2seq model (BART) then conditions on these latent documents together with the input to generate the output.
-> 검색기는 입력 기반 잠재 문서를 생성하며, seq2seq(BART) 모델은 문서와 입력 내용을 함께 활용하여 최종 출력을 생성한다.
We marginalize the latent documents with a top-K approximation, either on a per-output basis (assuming the same document is responsible for all tokens) or a per-token basis (where different documents are responsible for different tokens). Like T5 or BART, RAG can be fine-tuned on any seq2seq task, whereby both the generator and retriever are jointly learned.
-> 상위 연관 k개의 잠재 문서를 2가지 방식*으로 주변화(적분)한다. T5, BART처럼 RAG도 어떠한 seq2seq 작업에 대해 파인튜닝 될 수 있기 때문에 생성기와 검색기가 함께 학습된다.
* 방식 2가지
1) 출력 단위(per-output basis): 하나의 문서가 전체 토큰 생성에 관여 (예: RAG-Sequence)
2) 토큰 단위(per-token basis): 각 토큰마다 다른 문서가 관여 (예: RAG-Token).
1) p(z|x) (검색 단계):
2) p(y|x,z) (생성 단계):
3) Top-K 근사:
There has been extensive previous work proposing architectures to enrich systems with non-parametric memory which are trained from scratch for specific tasks, e.g. memory networks, stackaugmented networks and memory layers. In contrast, we explore a setting where both parametric and non-parametric memory components are pre-trained and pre-loaded with extensive knowledge. Crucially, by using pre-trained access mechanisms, the ability to access knowledge is
present without additional training.
-> 기존 방식 vs. 본 연구 방식
| 특성 | 기존 작업 특화 시스템 | 본 연구 방식 |
|---|---|---|
| 메모리 유형 | 비매개변수적 메모리 전용 | 매개변수적+비매개변수적 혼합 |
| 학습 방식 | 작업별 처음부터 학습 | 사전 학습된 메모리 구성요소 활용 |
| 지식 로딩 | 작업 수행 시점에 초기화 | 방대한 사전 지식 구축 상태로 사전 로드 |
| 지식 접근 | 추가 학습 필요 | 사전 학습된 접근 메커니즘이 즉시 활용 가능 |
Our RAG models achieve state-of-the-art results on open Natural Questions, WebQuestions and CuratedTrec and strongly outperform recent approaches that use specialised pre-training objectives on TriviaQA. Despite these being extractive tasks, we find that unconstrained generation outperforms previous extractive approaches.
| 평가 지표 | 주요 성과 |
|---|---|
| 정확도 | Natural Questions, WebQuestions, CuratedTrec에서 SOTA 달성 |
| 방법론 비교 | TriviaQA 대상 특화 사전학습 모델을 큰 차이로 제치고 우수성 입증 |
| 생성 방식 | 추출적 접근보다 자유형식 생성이 더 높은 성능 보임 |
⚠️Discussion으로 대체
In this work, we presented hybrid generation models with access to parametric and non-parametric memory. We showed that our RAG models obtain state of the art results on open-domain QA. We found that people prefer RAG’s generation over purely parametric BART, finding RAG more factual and specific.
-> 매개변수적 메모리(사전학습 모델)와 비매개변수적 메모리(외부 지식 검색)를 결합한 RAG 아키텍처를 제시했다. (SOTA 성능 입증)
We conducted an thorough investigation of the learned retrieval component, validating its effectiveness, and we illustrated how the retrieval index can be hot-swapped to update the model without requiring any retraining.
-> 학습된 검색(retrieval) 구성 요소에 대한 효과성을 입증했으며, 재학습 없이도 검색 인덱스를 핫스왑(실시간 교체)하여 모델을 업데이트할 수 있는 방법을 구체적으로 보였다.
In future work, it may be fruitful to investigate if the two components can be jointly pre-trained from scratch, either with a denoising objective similar to BART or some another objective. Our work opens up new research directions on how parametric and non-parametric memories interact and how to most effectively combine them, showing promise in being applied to a wide variety of NLP tasks.
-> 향후 연구에서는 BART의 노이즈 제거 목표(denoising objective) 또는 다른 목표 함수를 활용해 두 구성 요소(매개변수적 메모리/비매개변수적 메모리)를 처음부터 공동 사전 학습(jointly pre-trained)할 수 있는지 탐구하는 것이 유의미할 것이다.
본 연구는 매개변수적 메모리와 비매개변수적 메모리의 상호작용 방식과 이를 최적으로 결합하는 방법에 대한 새로운 연구 방향을 제시하며, 다양한 NLP 과제에 적용할 수 있는 가능성을 입증했다.
| 구분 | 검색기 (Retriever) | 생성기 (Generator) |
|---|---|---|
| 모델 유형 | 비파라메트릭 (Non-Parametric) | 파라메트릭 (Parametric) |
| 학습 방식 | 문서 인덱스를 활용하여 검색 | 훈련된 뉴럴 네트워크를 기반으로 생성 |
| 정보 출처 | 외부 문서 데이터베이스 (검색 기반) | 내부 학습된 가중치 (딥러닝 모델) |
| 변경 가능성 | 문서 인덱스가 변경되면 즉시 업데이트 가능 | 학습된 파라미터를 변경해야 함 |



(left)
RAG-Seq 모델은 문서 개수가 증가할 수록 QA 정확도 지속 상승RAG-Tok 모델은 문서 10개에서 가장 높은 최적점 성능을 보임(center)
RAG 모델이 다른 모델에 배해 재현율 성과가 높음(right)
RAG-Token은 더 많은 문서를 검색할수록 문장 완성도(Rouge-L)는 높아지지만, 정확도(Bleu-1)는 떨어지는 "Trade-off" 관계를 가짐.
| 모델 유형 | Rouge-L (응답 포괄성) | Bleu-1 (표현 정확성) |
|---|---|---|
| RAG-Token | 문서 수 ↑ → 증가 | 문서 수 ↑ → 감소 |
| RAG-Sequence | 변동 미미 | 안정적 유지 |
