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

Youmi Ma, Naoaki Okazaki


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 demonstrate that RetMask consistently improves long-context performance, with gains correlating 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.
Anthology ID:
2026.findings-acl.1380
Volume:
Findings of the Association for Computational Linguistics: ACL 2026
Month:
July
Year:
2026
Address:
San Diego, California, United States
Editors:
Maria Liakata, Viviane P. Moreira, Jiajun Zhang, David Jurgens
Venue:
Findings
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
27731–27747
Language:
URL:
https://aclanthology.org/2026.findings-acl.1380/
DOI:
Bibkey:
Cite (ACL):
Youmi Ma and Naoaki Okazaki. 2026. From Interpretability to Performance: Optimizing Retrieval Heads for Long-Context Language Models. In Findings of the Association for Computational Linguistics: ACL 2026, pages 27731–27747, San Diego, California, United States. Association for Computational Linguistics.
Cite (Informal):
From Interpretability to Performance: Optimizing Retrieval Heads for Long-Context Language Models (Ma & Okazaki, Findings 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.findings-acl.1380.pdf
Checklist:
 2026.findings-acl.1380.checklist.pdf