TL;DR
This paper introduces Retrieval-Augmented Generation (RAG), a novel framework that combines pre-trained language models (parametric memory) with an external knowledge source like Wikipedia (non-parametric memory) to improve performance on knowledge-intensive NLP tasks. RAG models achieve state-of-the-art results on open-domain question answering and generate more factual and diverse text for other generation tasks, demonstrating the power of augmenting generative models with explicit, updatable knowledge.
What Problem Does This Paper Address?
Large pre-trained language models (like GPT-3 or BART) have become incredibly powerful, storing a vast amount of factual knowledge within their parameters. However, this "parametric memory" has limitations: it's difficult to update with new information, hard to trace the source of a specific piece of knowledge (provenance), and can lead to "hallucinations" (generating plausible but incorrect information). For tasks requiring deep factual knowledge, these models often fall short compared to specialized architectures. The paper aims to bridge this gap by enabling generative models to dynamically access and utilize external knowledge bases, addressing the limitations of purely parametric memory.
Methods
The core innovation is the Retrieval-Augmented Generation (RAG) framework, which integrates a pre-trained neural retriever with a pre-trained seq2seq generator.
- Retriever (Parametric Memory): This component, based on Dense Passage Retriever (DPR), takes an input query and retrieves relevant documents from a large index (e.g., Wikipedia). It's essentially a "query encoder" that learns to find the most pertinent information.
- Generator (Non-Parametric Memory): This is a standard pre-trained seq2seq model (like BART-large) that takes the original input and the retrieved documents to generate the output sequence. The retrieved documents are concatenated with the input before being fed to the generator.
The key novelty lies in how these components are combined and trained end-to-end. RAG treats the retrieved documents as latent variables. Two main RAG formulations are proposed:
- RAG-Sequence: The model retrieves a single document and uses it to generate the entire output sequence. This is akin to conditioning the generation on one piece of external knowledge.
- RAG-Token: The model can retrieve different documents for each token it generates. This allows for more fine-grained access to knowledge, potentially drawing on diverse sources for different parts of the output.
Both the retriever and generator are jointly fine-tuned on downstream tasks. Crucially, the retriever is initialized with pre-trained components, meaning the ability to access knowledge is present from the start, without needing to train it from scratch for every task.
Datasets
The paper evaluates RAG on a variety of knowledge-intensive NLP tasks, using the following datasets:
- Open-Domain Question Answering (QA): Natural Questions (NQ), TriviaQA (TQA), WebQuestions (WQ), and CuratedTrec (CT).
- Abstractive Question Answering: MS MARCO NLG.
- Jeopardy Question Generation: SearchQA.
- Fact Verification: FEVER.
The non-parametric memory source used is a Wikipedia dump, split into 100-word chunks, resulting in approximately 21 million documents.
Key Insights and Ideas
- Parametric + Non-Parametric = Better: The paper strongly suggests that combining the implicit knowledge stored in a language model's parameters with explicit, retrievable knowledge from an external source leads to superior performance on knowledge-intensive tasks.
- Generative QA Outperforms Extractive: Even for tasks traditionally solved by extracting answer spans, RAG's generative approach achieves state-of-the-art results, indicating that generating answers can be more robust and flexible.
- Dynamic Knowledge Updates: A significant advantage of RAG is the ability to update its knowledge simply by swapping out the document index, without requiring retraining the entire model. This is a major step towards models that can adapt to a changing world.
- RAG-Token vs. RAG-Sequence: The RAG-Token model, which allows per-token retrieval, generally performs better, especially on tasks requiring nuanced information synthesis.
- Interpretability and Controllability: By retrieving explicit documents, RAG offers a degree of interpretability and provenance that is lacking in purely parametric models.
Key Results
- State-of-the-Art QA: RAG achieved state-of-the-art results on three open-domain QA tasks (NQ, WebQuestions, CuratedTrec), outperforming both parametric seq2seq models and task-specific retrieve-and-extract architectures.
- Improved Generation: For generation tasks like MS MARCO NLG and Jeopardy Question Generation, RAG models produced more factual, specific, and diverse responses compared to a BART baseline. For example, RAG-Sequence outperformed BART on MS MARCO NLG by 2.6 BLEU and 2.6 Rouge-L points.
- Fact Verification: RAG achieved competitive results on FEVER fact verification, coming within 4.3% of state-of-the-art pipeline models, despite not using specialized retrieval supervision.
- Human Evaluation: Human evaluators preferred RAG generations for Jeopardy question generation, finding them more factual and specific than BART's.
Limitations and Future Work
- Retriever Initialization: The paper notes that RAG's retriever is initialized using DPR, which itself was trained with retrieval supervision. Future work could explore jointly pre-training both components from scratch.
- Computational Cost: While RAG offers significant advantages, the retrieval step adds computational overhead. The paper mentions that retrieving more documents can improve performance but also increase runtime.
- Index Quality: The performance of RAG is dependent on the quality and coverage of the non-parametric memory (e.g., Wikipedia). If the knowledge source is biased or incomplete, RAG's outputs will reflect that.
- Future Directions: The authors suggest exploring joint pre-training of the retriever and generator, investigating how parametric and non-parametric memories interact more deeply, and applying RAG to a wider range of NLP tasks. They also highlight the potential for RAG to be applied in scenarios requiring up-to-date information, such as medical or legal domains.
Summary updated