TL;DR
Large language models (LLMs) often struggle with factual accuracy. While Retrieval-Augmented Generation (RAG) helps, it can be inflexible. This paper introduces Self-RAG, a novel framework that trains an LLM to learn when to retrieve information, generate text, and critically evaluate its own output using special "reflection tokens." This adaptive approach significantly boosts factuality and versatility across various tasks.
What Problem Does This Paper Address?
State-of-the-art LLMs, despite their impressive capabilities, frequently generate factually incorrect information. This is often attributed to their reliance solely on their internal parametric knowledge. While Retrieval-Augmented Generation (RAG) has emerged as a solution by incorporating external knowledge, it has limitations. Standard RAG methods indiscriminately retrieve a fixed number of documents, regardless of whether retrieval is actually needed or if the retrieved passages are relevant. This can lead to decreased versatility, irrelevant information, and ultimately, lower-quality or even incorrect outputs. The core challenge is to create LLMs that can intelligently leverage external knowledge only when necessary and critically assess their own generated content for accuracy and relevance.
Methods
Self-RAG introduces a framework that trains a single LLM to perform retrieval, generation, and critique in an end-to-end manner. The key innovation lies in the use of reflection tokens. These are special tokens that the LLM learns to generate during inference. These tokens signal:
- Retrieve: Whether external retrieval is necessary for the current generation step.
- ISREL (Relevance): Whether a retrieved passage is relevant to the query.
- ISSUP (Support): Whether the generated output is fully, partially, or not supported by the retrieved evidence.
- ISUSE (Utility): A measure of the overall helpfulness and informativeness of the response.
During training, a critic model (initially a powerful LLM like GPT-4, then distilled into an in-house model) generates these reflection tokens for a dataset. This augmented data, including retrieved passages and reflection tokens, is then used to train the main generator LLM. At inference, the generator LLM uses these reflection tokens to adaptively decide when to retrieve, which passages to use, and to self-critique its output. This allows for controllable generation, where the model can prioritize factuality or creativity based on the task.
Datasets
The paper utilizes a diverse set of datasets for training and evaluation:
Training Data: * Open-Instruct: A collection of instruction-following data, including subsets like GPT-4 Alpaca, Stanford Alpaca, FLAN-V2, ShareGPT, and Open Assistant. * Knowledge-Intensive Datasets: Wizard of Wikipedia, Natural Questions, FEVER (from the KILT benchmark), OpenBookQA, Arc-Easy, and ASQA. In total, approximately 145,619 instances were used for training.
Evaluation Datasets: * Closed-set tasks: PubHealth (fact verification) and ARC-Challenge (multiple-choice reasoning). * Short-form generation: PopQA and TriviaQA-unfiltered (open-domain QA). * Long-form generation: Biography generation and ASQA (QA with citation requirements).
Key Insights and Ideas
- Learning to Retrieve is Crucial: Unlike traditional RAG that retrieves a fixed set of documents, Self-RAG learns when to retrieve. This adaptive retrieval significantly improves efficiency and relevance, avoiding the noise of unnecessary documents.
- Self-Critique Enhances Factuality: The ability of the LLM to reflect on its own generations using "ISSUP" (support) and "ISREL" (relevance) tokens is a powerful mechanism for improving factual accuracy and reducing hallucinations.
- Controllable Generation via Reflection Tokens: The reflection tokens provide a fine-grained control mechanism at inference time. This allows users to tune the model's behavior, for example, by prioritizing citation accuracy or fluency, without requiring additional training.
- Efficiency of Offline Critic Training: Training the critic model offline and then using its outputs to augment the training data for the generator is significantly more cost-effective than methods like RLHF that require online interaction with a critic.
Key Results
Self-RAG demonstrated significant performance improvements across various tasks:
- Outperforms State-of-the-Art: Self-RAG (7B and 13B parameter models) significantly outperformed existing LLMs and retrieval-augmented models on six diverse tasks.
- Superior to ChatGPT and Llama2-chat: It surpassed retrieval-augmented ChatGPT on Open-domain QA, fact verification, and reasoning tasks. It also outperformed retrieval-augmented Llama2-chat on all tasks.
- Improved Factuality and Citation Accuracy: Self-RAG showed substantial gains in factuality scores and citation accuracy, particularly for long-form generations. For instance, on ASQA, it achieved significantly higher citation precision and recall than most baselines, even bridging the gap with ChatGPT.
- Reduced Hallucinations: Analysis showed that Self-RAG generated answers that were included in the provided evidence significantly more often than baselines like Alpaca and Llama2-chat.
Limitations and Future Work
- Potential for Incomplete Support: While Self-RAG significantly improves factuality, the authors acknowledge that it can still generate outputs that are not fully supported by citations. They hope that explicit self-reflection and attribution will help users verify errors.
- Human Evaluation Nuances: Human evaluations showed high agreement with model predictions for relevance and retrieval necessity, but slightly lower agreement for usefulness, indicating that defining and evaluating "utility" can be subjective.
- Future Work: The authors suggest that further expanding the training data size could lead to even greater improvements. They also highlight the potential for further exploration of adaptive retrieval thresholds and the impact of different parameter weights for customization. The framework's ability to tailor behaviors at test time without additional training is a promising direction for future research.
Summary updated