Logit-Contribution Scoring Identifies Non-Literal Retrieval Heads
Abstract
On long-context retrieval tasks where the relevant span shares no words with the question, a model must synthesize the answer from the span’s meaning rather than copy it; we study which attention heads carry out this synthesis in the single-needle setting. Yet existing detectors miss these heads: they reward heads whose attended token matches the generated token, capturing where a head reads but not what it writes through its output-value (OV) circuit, which carries non-literal retrieval. We introduce Logit-Contribution Scoring (LOCOS), a write-aware detector that scores each head by the projection of its OV-circuit output onto the answer-token unembedding direction, contrasting source positions inside the answer-bearing span (the needle) with all other (off-needle) positions in a single forward pass. Across three model families (Qwen3, Gemma-3, OLMo-3.1), mean-ablating the top LOCOS heads on the NoLiMa non-literal retrieval benchmark collapses ROUGE-L at lower head counts than prior attention-based detections; on Qwen3-8B, ablating 50 heads drives ROUGE-L from 0.401 to 0.000 while the strongest baseline still retains 0.292. The selected heads are retrieval-specific: parametric recall and arithmetic reasoning stay at baseline under the same ablation. On Qwen3-8B, the same ablation also drops MuSiQue from 0.55 to 0.08 and BABILong from 0.62 to 0.20, while a random-heads control stays within 0.05 of baseline.