atlas

Research map / Large language models / Language, safety and interpretability

Retrieval Head Mechanistically Explains Long-Context Factuality

ICLR 2025 · Large language models › Language, safety and interpretability · approach: Faithfulness of LLM explanations · 1 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Identifies sparse, universal "retrieval heads" in long-context LLMs via a copy-paste retrieval score on needle-in-a-haystack tests, and shows by masking them that they causally drive factual retrieval and chain-of-thought reasoning.

Problem

How transformer LLMs retrieve relevant information from arbitrary positions in long contexts, and which internal components are responsible for factual retrieval versus hallucination.

Approach

Defines a retrieval score per attention head as the frequency with which the head's most-attended token is a needle token being copied to the output during decoding, finds that a small set (<5%) of heads has high scores across model families, and shows that masking these heads causes retrieval failure and hallucination while masking random heads does not.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Mask retrieval heads (ablation)Mistral-7B-Instruct-v0.2 · Needle-in-a-Haystackretrieval performanceHurt
Mask random non-retrieval heads (ablation)Mistral-7B-Instruct-v0.2 · Needle-in-a-Haystackretrieval performanceNo clear effect
Mask retrieval heads (ablation)Mistral-7B-Instruct-v0.2 · ExtractQAF1: 9.2%; 23.1%Hurt
Mask random non-retrieval heads (ablation)Mistral-7B-Instruct-v0.2 · ExtractQAF1No clear effect
Mask retrieval heads (ablation)Mistral-7B-Instruct-v0.2 · MMLU, MuSiQue, and GSM8K with chain-of-thoughtperformanceHurt
Mask random heads (ablation)Mistral-7B-Instruct-v0.2 · MMLU, MuSiQue, and GSM8K with answer-only promptingperformanceNo clear effect
Mask retrieval heads (ablation)Mistral-7B-Instruct-v0.2 · MMLU, MuSiQue, and GSM8K with answer-only promptingperformanceNo clear effect
Use full attention instead of sliding-window attentionMistral · Needle-in-a-Haystackretrieval capabilityHelped

Surprising findings

Limitations

Experimental setup

Datasets: synthetic needle-in-a-haystack samples up-to-date news extractive QA (GPT-4 generated) MMLU MuSiQue GSM8K

Benchmarks: Needle-in-a-Haystack extractive QA (news) MMLU MuSiQue GSM8K

Metrics: retrieval score activation frequency needle retrieval accuracy F1 accuracy Pearson correlation

Baselines: random non-retrieval head masking

Builds on: induction heads needle-in-a-haystack CopyNet

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy