arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2601.11020cs.CL
收藏

从可解释性到性能:优化长上下文语言模型的检索头

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

Department of Computer Science, Institute of Science Tokyo(东京科学研究所计算机科学系)

Youmi Ma, Naoaki Okazaki

AI总结:

本文研究检索头如何提升长上下文语言模型性能,提出RetMask方法通过对比正常输出与屏蔽检索头的输出生成训练信号,显著提升生成和重排序性能,验证了检索头的功能作用。

摘要:

机制性可解释性的发展识别出特殊注意力头,称为检索头,负责从上下文中检索信息。然而,这些检索头在提升模型性能中的作用尚不清楚。本文研究检索头是否能增强LLM的长上下文能力。具体而言,我们提出RetMask,一种通过对比正常模型输出与屏蔽检索头的变体输出生成训练信号的方法。这种基于机制的方法实现了显著提升:在128K的HELMET上,LLama-3.1的得分提升2.28点,生成任务中引用相关性提升70%,重排序任务提升32%,同时保持通用任务性能。在三个家族的四款车型上实验表明,RetMask一致提升长上下文性能,其中收益与检索分数分布稀疏性相关:分布更稀疏的模型,检索能力集中在少量头中,响应更强烈;分布更不稀疏的模型收益更有限。这些结果验证了检索头的功能作用,并展示了机制性洞察可以转化为性能提升。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑