From Interpretability to Performance: Optimizing Retrieval Heads for Long-Context Language Models

Youmi Ma, Naoaki Okazaki
1/16/2026
cs.CL

No confident code implementation found for this paper. 4 possible matches can be shown below.

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 three model families reveal that the effectiveness depends on retrieval head organization: models with concentrated patterns of retrieval heads respond strongly, while those with distributed patterns show limited gains. This mechanistic relationship validates the function of retrieval heads and demonstrates that mechanistic insights can be transformed into performance enhancements.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 4 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{ma2026from,
  title  = {From Interpretability to Performance: Optimizing Retrieval Heads for Long-Context Language Models},
  author = {Youmi Ma and Naoaki Okazaki},
  year   = {2026},
  eprint = {2601.11020},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2601.11020v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2601.11020.svg)](https://codeofpaper.com/paper/2601.11020)

Discussion