mlsanityData to 14 Oct 2026

Understanding Synthetic Context Extension via Retrieval Heads

arXiv 2410.22316 ↗First posted 29 Oct 2024cs.CLcited by 10

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

  1. 2024The Llama 3 Herd of Modelscited by 14,715
  2. 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,380
  3. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
  4. 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,455
  5. 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,346
  6. 2020Transformer Feed-Forward Layers Are Key-Value Memoriescited by 1,336
  7. 2021Unsupervised Dense Information Retrieval with Contrastive Learningcited by 1,216
  8. 2023WizardLM: Empowering large pre-trained language models to follow complex instructionscited by 1,125
  9. 2022In-context Learning and Induction Headscited by 964
  10. 2021MuSiQue: Multihop Questions via Single-hop Question Compositioncited by 916
  11. 2023Extending Context Window of Large Language Models via Positional Interpolationcited by 740
  12. 2019Latent Retrieval for Weakly Supervised Open Domain Question Answeringcited by 695
30 more
  1. 2023MAmmoTH: Building Math Generalist Models through Hybrid Instruction Tuningcited by 487
  2. 2024Magpie: Alignment Data Synthesis from Scratch by Prompting Aligned LLMs with Nothingcited by 346
  3. 2022Language Models Are Greedy Reasoners: A Systematic Formal Analysis of Chain-of-Thoughtcited by 337
  4. 2024MiniCheck: Efficient Fact-Checking of LLMs on Grounding Documentscited by 257
  5. 2024Retrieval Head Mechanistically Explains Long-Context Factualitycited by 232
  6. 2023Landmark Attention: Random-Access Infinite Context Length for Transformerscited by 213
  7. 2017Learning to Ask: Neural Question Generation for Reading Comprehensioncited by 186
  8. 2024Data Engineering for Scaling Language Models to 128K Contextcited by 186
  9. 2023Does Circuit Analysis Interpretability Scale? Evidence from Multiple Choice Capabilities in Chinchillacited by 149
  10. 2024Fine-Tuning Enhances Existing Mechanisms: A Case Study on Entity Trackingcited by 149
  11. 2024Make Your LLM Fully Utilize the Contextcited by 119
  12. 2024Best Practices and Lessons Learned on Synthetic Datacited by 106
  13. 2023Task-Specific Skill Localization in Fine-tuned Language Modelscited by 105
  14. 2023Exploiting Asymmetry for Synthetic Training Data Generation: SynthIE and the Case of Information Extractioncited by 89
  15. 2023A Mechanistic Interpretation of Arithmetic Reasoning in Language Models using Causal Mediation Analysiscited by 89
  16. 2024Summary of a Haystack: A Challenge to Long-Context LLMs and RAG Systemscited by 87
  17. 2023Symbol tuning improves in-context learning in language modelscited by 75
  18. 2024MathGenie: Generating Synthetic Data with Question Back-translation for Enhancing Mathematical Reasoning of LLMscited by 72
  19. 2024LoFiT: Localized Fine-tuning on LLM Representationscited by 57
  20. 2024Softmax is not Enough (for Sharp Size Generalisation)cited by 46
  21. 2023Entity Tracking in Language Modelscited by 44
  22. 2023RLCD: Reinforcement Learning from Contrastive Distillation for Language Model Alignmentcited by 43
  23. 2024GenQA: Generating Millions of Instructions from a Handful of Promptscited by 35
  24. 2024Reasoning Circuits in Language Models: A Mechanistic Interpretation of Syllogistic Inferencecited by 29
  25. 2024LongSkywork: A Training Recipe for Efficiently Extending Context Length in Large Language Modelscited by 19
  26. 2024From Artificial Needles to Real Haystacks: Improving Retrieval Capabilities in LLMs by Finetuning on Synthetic Datacited by 18
  27. 2024SynthesizRR: Generating Diverse Datasets with Retrieval Augmentationcited by 13
  28. 2024Unveiling the Flaws: Exploring Imperfections in Synthetic Data and Mitigation Strategies for Large Language Modelscited by 13
  29. 2023It's All Relative! -- A Synthetic Query Generation Approach for Improving Zero-Shot Relevance Predictioncited by 10
  30. 2024DUQGen: Effective Unsupervised Domain Adaptation of Neural Rankers by Diversifying Synthetic Query Generationcited by 5

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2024: 1; 2025: 3; 2026: 6.

10 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2026From Interpretability to Performance: Optimizing Retrieval Heads for Long-Context Language Models
  2. 2024Long-Context LLMs Meet RAG: Overcoming Challenges for Long Inputs in RAG
  3. 2024NeedleBench: Evaluating LLM Retrieval and Reasoning Across Varying Information Densities
  4. 2025Grounding Long-Context Reasoning with Contextual Normalization for Retrieval-Augmented Generation
  5. 2024Investigating Context-Faithfulness in Large Language Models: The Roles of Memory Strength and Evidence Style
  6. 2026Adaptive Retrieval helps Reasoning in LLMs -- but mostly if it's not used
  7. 2023Retrieval meets Long Context Large Language Models
  8. 2025Studying the Role of Input-Neighbor Overlap in Retrieval-Augmented Language Models Training Efficiency