mlsanityData to 7 Oct 2026

Retrieval Head Mechanistically Explains Long-Context Factuality

arXiv 2404.15574 ↗First posted 24 Apr 2024cs.CLcited by 219

Not on the map. Why?

Cited by 46 in Efficient LLM inference and serving, but placed by its own abstract, which didn’t fit.

Abstract (arXiv)

Despite the recent progress in long-context language models, it remains elusive how transformer-based models exhibit the capability to retrieve relevant information from arbitrary locations within the long context. This paper aims to address this question. Our systematic investigation across a wide spectrum of models reveals that a special type of attention heads are largely responsible for retrieving information, which we dub retrieval heads. We identify intriguing properties of retrieval heads:(1) universal: all the explored models with long-context capability have a set of retrieval heads; (2) sparse: only a small portion (less than 5%) of the attention heads are retrieval. (3) intrinsic: retrieval heads already exist in models pretrained with short context. When extending the context length by continual pretraining, it is still the same set of heads that perform information retrieval. (4) dynamically activated: take Llama-2 7B for example, 12 retrieval heads always attend to the required information no matter how the context is changed. The rest of the retrieval heads are activated in different contexts. (5) causal: completely pruning retrieval heads leads to failure in retrieving relevant information and results in hallucination, while pruning random non-retrieval heads does not affect the model's retrieval ability. We further show that retrieval heads strongly influence chain-of-thought (CoT) reasoning, where the model needs to frequently refer back the question and previously-generated context. Conversely, tasks where the model directly generates the answer using its intrinsic knowledge are less impacted by masking out retrieval heads. These observations collectively explain which internal part of the model seeks information from the input tokens. We believe our insights will foster future research on reducing hallucination, improving reasoning, and compressing the KV cache.

Key facts. Cited by 219 papers in the map (data through 7 Oct 2026). Builds on 21 of its 27 references that are in the map. First posted on arXiv 24 Apr 2024.

Builds on

21 of 27 references.

References · 21

  1. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
  2. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
  3. 2021Training Verifiers to Solve Math Word Problemscited by 9,743
  4. 2020Measuring Massive Multitask Language Understandingcited by 7,768
  5. 2023Mamba: Linear-Time Sequence Modeling with Selective State Spacescited by 4,616
  6. 2023Qwen Technical Reportcited by 3,273
  7. 2024Gemini 1.5: Unlocking multimodal understanding across millions of tokens of contextcited by 3,175
  8. 2023Mistral 7Bcited by 3,065
  9. 2023Efficient Streaming Language Models with Attention Sinkscited by 2,115
  10. 2024Mixtral of Expertscited by 1,785
  11. 2020Linformer: Self-Attention with Linear Complexitycited by 1,462
  12. 2020Transformer Feed-Forward Layers Are Key-Value Memoriescited by 1,307
9 more
  1. 2022In-context Learning and Induction Headscited by 930
  2. 2024Yi: Open Foundation Models by 01.AIcited by 706
  3. 2023Model Tells You What to Discard: Adaptive KV Cache Compression for LLMscited by 466
  4. 2024Griffin: Mixing Gated Linear Recurrences with Local Attention for Efficient Language Modelscited by 232
  5. 2016Incorporating Copying Mechanism in Sequence-to-Sequence Learningcited by 217
  6. 2022Sparse Upcycling: Training Mixture-of-Experts from Dense Checkpointscited by 207
  7. 2024Data Engineering for Scaling Language Models to 128K Contextcited by 183
  8. 2024GEAR: An Efficient KV Cache Compression Recipe for Near-Lossless Generative Inference of LLMcited by 155
  9. 2024In Search of Needles in a 11M Haystack: Recurrent Memory Finds What LLMs Misscited by 36

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 38; 2025: 82; 2026: 99.

219 papers.

Sort:

By area:

  1. 2024PyramidKV: Dynamic KV Cache Compression based on Pyramidal Information Funnelingcited by 420
  2. 2024A Survey on Large Language Model Acceleration based on KV Cache Managementcited by 125
  3. 2025Context Length Alone Hurts LLM Performance Despite Perfect Retrievalcited by 118
  4. 2024MagicPIG: LSH Sampling for Efficient LLM Generationcited by 112
  5. 2024Round and Round We Go! What makes Rotary Positional Encodings useful?cited by 111
  6. 2024ReDeEP: Detecting Hallucination in Retrieval-Augmented Generation via Mechanistic Interpretabilitycited by 100
  7. 2024Not All Heads Matter: A Head-Level KV Cache Compression Method with Integrated Retrieval and Reasoningcited by 96
  8. 2024A Primer on the Inner Workings of Transformer-based Language Modelscited by 83
  9. 2024On the Role of Attention Heads in Large Language Model Safetycited by 70
  10. 2024Attention Heads of Large Language Models: A Surveycited by 65
  11. 2024Knowledge Circuits in Pretrained Transformerscited by 60
  12. 2024LoFiT: Localized Fine-tuning on LLM Representationscited by 56
38 more
  1. 2024Internal Consistency and Self-Feedback in Large Language Models: A Surveycited by 49
  2. 2025Twilight: Adaptive Attention Sparsity with Hierarchical Top-p Pruningcited by 48
  3. 2024Challenges in Deploying Long-Context Transformers: A Theoretical Peak Performance Analysiscited by 44
  4. 2024Mixture of Attention Spans: Optimizing LLM Inference Efficiency with Heterogeneous Sliding-Window Lengthscited by 44
  5. 2024Softmax is not Enough (for Sharp Size Generalisation)cited by 42
  6. 2024MoH: Multi-Head Attention as Mixture-of-Head Attentioncited by 41
  7. 2025Baichuan-M1: Pushing the Medical Capability of Large Language Modelscited by 41
  8. 2025LServe: Efficient Long-sequence LLM Serving with Unified Sparse Attentioncited by 41
  9. 2024Memory3: Language Modeling with Explicit Memorycited by 39
  10. 2024Unveiling Visual Perception in Language Models: An Attention Head Analysis Approachcited by 34
  11. 2025Detection and Mitigation of Hallucination in Large Reasoning Models: A Mechanistic Perspectivecited by 32
  12. 2024MatryoshkaKV: Adaptive KV Compression via Trainable Orthogonal Projectioncited by 29
  13. 2024Attention Entropy is a Key Factor: An Analysis of Parallel Context Encoding with Full-attention-based Pre-trained Language Modelscited by 26
  14. 2025MMInference: Accelerating Pre-filling for Long-Context VLMs via Modality-Aware Permutation Sparse Attentioncited by 26
  15. 2024The Quest for the Right Mediator: Surveying Mechanistic Interpretability Through the Lens of Causal Mediation Analysiscited by 24
  16. 2024DeCoRe: Decoding by Contrasting Retrieval Heads to Mitigate Hallucinationscited by 23
  17. 2025Lifting the Veil on Visual Information Flow in MLLMs: Unlocking Pathways to Faster Inferencecited by 23
  18. 2024SCOPE: Optimizing Key-Value Cache Compression in Long-context Generationcited by 20
  19. 2025Towards Understanding Fine-Tuning Mechanisms of LLMs via Circuit Analysiscited by 20
  20. 2025Cache What Lasts: Token Retention for Memory-Bounded KV Cache in LLMscited by 18
  21. 2026TriAttention: Efficient Long Reasoning with Trigonometric KV Compressioncited by 18
  22. 2024From RAGs to rich parameters: Probing how language models utilize external knowledge over parametric information for factual queriescited by 16
  23. 2025LAVa: Layer-wise KV Cache Eviction with Dynamic Budget Allocationcited by 16
  24. 2025Understanding the Skill Gap in Recurrent Language Models: The Role of the Gather-and-Aggregate Mechanismcited by 15
  25. 2024UNComp: Can Matrix Entropy Uncover Sparsity? -- A Compressor Design from an Uncertainty-Aware Perspectivecited by 14
  26. 2025Does Time Have Its Place? Temporal Heads: Where Language Models Recall Time-specific Informationcited by 14
  27. 2024On the token distance modeling ability of higher RoPE attention dimensioncited by 13
  28. 2025RetroInfer: A Vector Storage Engine for Scalable Long-Context LLM Inferencecited by 13
  29. 2025Calm-Whisper: Reduce Whisper Hallucination On Non-Speech By Calming Crazy Heads Downcited by 12
  30. 2025Attributing Response to Context: A Jensen-Shannon Divergence Driven Mechanistic Study of Context Attribution in Retrieval-Augmented Generationcited by 12
  31. 2025BLASST: Dynamic BLocked Attention Sparsity via Softmax Thresholdingcited by 12
  32. 2025Eliciting In-context Retrieval and Reasoning for Long-context Large Language Modelscited by 11
  33. 2025LADM: Long-context Training Data Selection with Attention-based Dependency Measurement for LLMscited by 11
  34. 2025Learning to Attribute with Attentioncited by 11
  35. 2025The Atlas of In-Context Learning: How Attention Heads Shape In-Context Retrieval Augmentationcited by 11
  36. 2025When Seeing Overrides Knowing: Disentangling Knowledge Conflicts in Vision-Language Modelscited by 11
  37. 2025Refusal Falls off a Cliff: How Safety Alignment Fails in Reasoning?cited by 11
  38. 2024Understanding Synthetic Context Extension via Retrieval Headscited by 10

50 most cited of 219 All 219 (JSON)

Similar, not cited

Close in wording, no citation either way

  1. 2026Can Retrieval Heads See Images? Multimodal Retrieval Heads in Long-Context Vision-Language Models
  2. 2025Beyond Semantics: How Temporal Biases Shape Retrieval in Transformer and State-Space Models
  3. 2026Memory Control Signals Emerge Before Action in Long Horizon Agents
  4. 2025Positional Biases Shift as Inputs Approach Context Window Limits
  5. 2026Micro-Macro Retrieval: Reducing Long-Form Hallucination in Large Language Models
  6. 2026Not All Needles Are Found: How Fact Distribution and Don't Make It Up Prompts Shape Retrieval, Reasoning, and Hallucination in Long-Context LLMs
  7. 2023Attention Sorting Combats Recency Bias In Long Context Language Models
  8. 2026The First Drop of Ink: Nonlinear Impact of Distracting Information in Long-Context Reasoning