Causal head-masking and dimension-zeroing experiments show retrieval heads are necessary for long-context recall and that low-frequency RoPE components within them drive performance across five models.
From Interpretability to Performance: Optimizing Retrieval Heads for Long-Context Language Models
1 Pith paper cite this work. Polarity classification is still indexing.
abstract
Advances in mechanistic interpretability have identified special attention heads, known as retrieval heads, that are responsible for retrieving information from the context. However, the role of these retrieval heads in improving model performance remains unexplored. This work investigates whether retrieval heads can be leveraged to enhance the long-context capabilities of LLMs. Specifically, we propose RetMask, a method that generates training signals by contrasting normal model outputs with those from an ablated variant in which the retrieval heads are masked. This mechanism-based approach achieves substantial improvements: +2.28 points on HELMET at 128K for Llama-3.1, with +70% gains on generation with citation and +32% on passage re-ranking, while preserving performance on general tasks. Experiments across four models in three families demonstrate that RetMask consistently improves long-context performance, where gains correlate with the sparsity of the retrieval score distribution: models with sparser distributions, where retrieval capabilities are concentrated in a small set of heads, respond more strongly, while those with less sparse distributions show more modest gains. These results validate the functional role of retrieval heads and show that mechanistic insights can be transformed into performance enhancements.
fields
cs.LG 1years
2026 1verdicts
CONDITIONAL 1representative citing papers
citing papers explorer
-
Does RoPE Prevent or Degrade Retrieval Heads? A Mechanistic Analysis Across Model Families
Causal head-masking and dimension-zeroing experiments show retrieval heads are necessary for long-context recall and that low-frequency RoPE components within them drive performance across five models.