TL;DR
This paper provides a comprehensive study on pretraining autoregressive language models with retrieval, successfully reproducing and scaling the RETRO architecture to 9.5B parameters. The authors demonstrate that pretraining with retrieval consistently improves text generation quality, factual accuracy, and performance on knowledge-intensive tasks, while introducing a high-performing variant, RETRO++, which sets new benchmarks for open-domain question answering.
What Problem Does This Paper Address?
Standard large language models (LLMs) like GPT-3 and GPT-4 face three major hurdles:
- Efficiency: They require massive parameter counts to "memorize" world knowledge, making deployment expensive.
- Factuality: They are prone to "hallucinations," generating plausible-sounding but incorrect information.
- Staleness: Updating their knowledge base requires costly retraining or fine-tuning.
Retrieval-augmented models, which look up information from an external database, offer a solution. While previous work like DeepMind’s RETRO showed these models could achieve better perplexity (predictive accuracy) with fewer parameters, it remained unclear if this translated to better text generation quality or performance on downstream tasks. This paper investigates a fundamental question: Should we pretrain autoregressive LMs with retrieval by default?
Methods
The authors reproduced and scaled RETRO (Retrieval-Enhanced TRansfOrmer) from scratch, ranging from 148M to 9.5B parameters. Key technical contributions include:
- Chunk-wise Retrieval: The model splits input sequences into chunks (e.g., 64 tokens). For each chunk, it retrieves the most similar text segments from a massive 330B-token database using BERT embeddings and the Faiss similarity search library.
- The "Left Padding" Rule: To maintain causality during generation (ensuring the model doesn't "see the future"), the authors introduced a padding strategy. This allows the model to use retrieved information from the previous chunk to guide the generation of the current one, even for very short prompts.
- RETRO++: A novel variant designed for Open-Domain Question Answering (QA). Unlike the original RETRO, which feeds all retrieved data into an encoder, RETRO++ feeds the single most relevant passage directly into the decoder as context, while the remaining passages go to the encoder.
Datasets
- Pretraining & Retrieval Database: A massive 330B-token English corpus compiled from 15 high-quality sources, including Wikipedia and CommonCrawl. The retrieval database itself contains 5.3 billion chunks.
- Downstream Evaluation: The LM Evaluation Harness, covering nine tasks like HellaSwag (commonsense reasoning) and BoolQ (reading comprehension).
- Open-Domain QA: The standard Natural Questions (NQ) and TriviaQA datasets.
- Factuality & Toxicity: Evaluated using FACTUALITYPROMPTS, TruthfulQA, and REALTOXICITYPROMPTS.
Key Insights and Ideas
- Retrieval as a "Degeneration" Cure: One of the most striking findings is that RETRO reduces repetitive text generation by an average of 21% compared to standard GPT models. Referencing human-written text from the database acts as a natural regularizer.
- Pretraining is Essential: The authors found that simply tacking retrieval onto a standard GPT model at inference time often hurts performance. Models must be pretrained to handle the potentially noisy or distracting information found in retrieved passages.
- Knowledge-Intensive Superiority: RETRO significantly outperforms GPT on tasks that require factual knowledge (like HellaSwag) while remaining competitive on general reasoning tasks.
- The Decoder is Key for QA: The success of RETRO++ suggests that for tasks like QA, the model benefits most when the most relevant evidence is placed directly in the generative "view" of the decoder, rather than being buried in the encoder's latent representations.
Key Results
- State-of-the-Art QA: RETRO++ achieved an Exact Match (EM) score of 54.1 on Natural Questions, a significant jump over the original RETRO's 45.5 and the retrieval-augmented GPT baseline (RAG-GPT) of 50.9.
- Scaling Performance: As shown in Figure 2, RETRO++ consistently maintains a performance lead over RAG-GPT as model size increases.
- Better Factuality: RETRO showed lower hallucination rates (measured by NEER) and higher entailment ratios (EntailR) than GPT across various decoding strategies.
- Toxicity Control: By using a "clean" retrieval database (like Wikipedia), the authors could actually reduce the toxicity of the model's output compared to a standard GPT model.
Limitations and Future Work
- Database Dependency: The model's performance is a slave to its database. If the retrieval source contains biased, inaccurate, or outdated information, the model will likely reflect those flaws.
- Computational Overhead: Pretraining with retrieval isn't free; it adds roughly 12% to 25% more GPU hours compared to training a standard GPT model.
- Scaling Frontiers: While this study reached 9.5B parameters, the authors note that scaling to the 100B+ parameter range remains an important area for future research to see if these advantages hold at the extreme scale of models like GPT-4.
Summary updated