Understanding Synthetic Context Extension via Retrieval Heads
On the map: Retrieval-augmented generation → Generation and context integration
Abstract (arXiv)
Long-context LLMs are increasingly in demand for applications such as retrieval-augmented generation. To defray the cost of pretraining LLMs over long contexts, recent work takes an approach of synthetic context extension: fine-tuning LLMs with synthetically generated long-context data in a post-training stage. However, it remains unclear how and why this synthetic context extension imparts abilities for downstream long-context tasks. In this paper, we investigate fine-tuning on synthetic data for three long-context tasks that require retrieval and reasoning. We vary the realism of "needle" concepts to be retrieved and diversity of the surrounding "haystack" context, from using LLMs to construct synthetic documents to using templated relations and creating symbolic datasets. We find that models trained on synthetic data fall short of the real data, but surprisingly, the mismatch can be interpreted and even predicted in terms of a special set of attention heads that are responsible for retrieval over long context, retrieval heads (Wu et al., 2024). The retrieval heads learned on synthetic data have high overlap with retrieval heads learned on real data, and there is a strong correlation between the recall of heads learned and the downstream performance of a model. Furthermore, with attention knockout and activation patching, we mechanistically show that retrieval heads are necessary and explain model performance, although they are not totally sufficient. Our results shed light on how to interpret synthetic data fine-tuning performance and how to approach creating better data for learning real-world capabilities over long contexts.
Key facts. Cited by 10 papers in the map (data through 14 Oct 2026). Placed in Generation and context integration, one of 15 directions in Retrieval-augmented generation. Builds on 42 of its 55 references that are in the map. First posted on arXiv 29 Oct 2024.
Builds on
42 of 55 references.
References · 42
- 2024The Llama 3 Herd of Modelscited by 14,715
- 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,380
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
- 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,455
- 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,346
- 2020Transformer Feed-Forward Layers Are Key-Value Memoriescited by 1,336
- 2021Unsupervised Dense Information Retrieval with Contrastive Learningcited by 1,216
- 2023WizardLM: Empowering large pre-trained language models to follow complex instructionscited by 1,125
- 2022In-context Learning and Induction Headscited by 964
- 2021MuSiQue: Multihop Questions via Single-hop Question Compositioncited by 916
- 2023Extending Context Window of Large Language Models via Positional Interpolationcited by 740
- 2019Latent Retrieval for Weakly Supervised Open Domain Question Answeringcited by 695
30 more
- 2023MAmmoTH: Building Math Generalist Models through Hybrid Instruction Tuningcited by 487
- 2024Magpie: Alignment Data Synthesis from Scratch by Prompting Aligned LLMs with Nothingcited by 346
- 2022Language Models Are Greedy Reasoners: A Systematic Formal Analysis of Chain-of-Thoughtcited by 337
- 2024MiniCheck: Efficient Fact-Checking of LLMs on Grounding Documentscited by 257
- 2024Retrieval Head Mechanistically Explains Long-Context Factualitycited by 232
- 2023Landmark Attention: Random-Access Infinite Context Length for Transformerscited by 213
- 2017Learning to Ask: Neural Question Generation for Reading Comprehensioncited by 186
- 2024Data Engineering for Scaling Language Models to 128K Contextcited by 186
- 2023Does Circuit Analysis Interpretability Scale? Evidence from Multiple Choice Capabilities in Chinchillacited by 149
- 2024Fine-Tuning Enhances Existing Mechanisms: A Case Study on Entity Trackingcited by 149
- 2024Make Your LLM Fully Utilize the Contextcited by 119
- 2024Best Practices and Lessons Learned on Synthetic Datacited by 106
- 2023Task-Specific Skill Localization in Fine-tuned Language Modelscited by 105
- 2023Exploiting Asymmetry for Synthetic Training Data Generation: SynthIE and the Case of Information Extractioncited by 89
- 2023A Mechanistic Interpretation of Arithmetic Reasoning in Language Models using Causal Mediation Analysiscited by 89
- 2024Summary of a Haystack: A Challenge to Long-Context LLMs and RAG Systemscited by 87
- 2023Symbol tuning improves in-context learning in language modelscited by 75
- 2024MathGenie: Generating Synthetic Data with Question Back-translation for Enhancing Mathematical Reasoning of LLMscited by 72
- 2024LoFiT: Localized Fine-tuning on LLM Representationscited by 57
- 2024Softmax is not Enough (for Sharp Size Generalisation)cited by 46
- 2023Entity Tracking in Language Modelscited by 44
- 2023RLCD: Reinforcement Learning from Contrastive Distillation for Language Model Alignmentcited by 43
- 2024GenQA: Generating Millions of Instructions from a Handful of Promptscited by 35
- 2024Reasoning Circuits in Language Models: A Mechanistic Interpretation of Syllogistic Inferencecited by 29
- 2024LongSkywork: A Training Recipe for Efficiently Extending Context Length in Large Language Modelscited by 19
- 2024From Artificial Needles to Real Haystacks: Improving Retrieval Capabilities in LLMs by Finetuning on Synthetic Datacited by 18
- 2024SynthesizRR: Generating Diverse Datasets with Retrieval Augmentationcited by 13
- 2024Unveiling the Flaws: Exploring Imperfections in Synthetic Data and Mitigation Strategies for Large Language Modelscited by 13
- 2023It's All Relative! -- A Synthetic Query Generation Approach for Improving Zero-Shot Relevance Predictioncited by 10
- 2024DUQGen: Effective Unsupervised Domain Adaptation of Neural Rankers by Diversifying Synthetic Query Generationcited by 5
Built on by
Citing papers per year: 2024: 1; 2025: 3; 2026: 6.
10 papers.
- 2024Surveying the Effects of Quality, Diversity, and Complexity in Synthetic Data From Large Language Modelscited by 35
- 2025Hidden in the Haystack: Smaller Needles are More Difficult for LLMs to Findcited by 7
- 2026Interpretability Can Be Actionablecited by 7
- 2026Learning from Synthetic Data Improves Multi-hop Reasoningcited by 6
- 2025Revisiting Long-context Modeling from Context Denoising Perspectivecited by 5
- 2025Modelling and Classifying the Components of a Literature Reviewcited by 2
- 2026DySCO: Dynamic Attention-Scaling Decoding for Long-Context Language Modelscited by 2
- 2026S3-Attention:Attention-Aligned Endogenous Retrieval for Memory-Bounded Long-Context Inferencecited by 1
- 2026Randomized YaRN Improves Length Generalization for Long-Context Reasoningcited by 1
- 2026Learning to Learn from Context: Synthetic Training from Perturbed Public Documentscited by 0
- 2026Learning to Learn from Context: Synthetic Training from Perturbed Public Documents27 Sep 2026
- 2026Randomized YaRN Improves Length Generalization for Long-Context Reasoning22 Jun 2026
- 2026Interpretability Can Be Actionable11 May 2026
- 2026Learning from Synthetic Data Improves Multi-hop Reasoning2 Mar 2026
- 2026DySCO: Dynamic Attention-Scaling Decoding for Long-Context Language Models25 Feb 2026
- 2026S3-Attention:Attention-Aligned Endogenous Retrieval for Memory-Bounded Long-Context Inference25 Jan 2026
- 2025Revisiting Long-context Modeling from Context Denoising Perspective7 Oct 2025
- 2025Modelling and Classifying the Components of a Literature Review6 Aug 2025
- 2025Hidden in the Haystack: Smaller Needles are More Difficult for LLMs to Find23 May 2025
- 2024Surveying the Effects of Quality, Diversity, and Complexity in Synthetic Data From Large Language Models4 Dec 2024
Similar, not cited
Close in wording, no citation either way
- 2026From Interpretability to Performance: Optimizing Retrieval Heads for Long-Context Language Models
- 2024Long-Context LLMs Meet RAG: Overcoming Challenges for Long Inputs in RAG
- 2024NeedleBench: Evaluating LLM Retrieval and Reasoning Across Varying Information Densities
- 2025Grounding Long-Context Reasoning with Contextual Normalization for Retrieval-Augmented Generation
- 2024Investigating Context-Faithfulness in Large Language Models: The Roles of Memory Strength and Evidence Style
- 2026Adaptive Retrieval helps Reasoning in LLMs -- but mostly if it's not used
- 2023Retrieval meets Long Context Large Language Models
- 2025Studying the Role of Input-Neighbor Overlap in Retrieval-Augmented Language Models Training Efficiency