注意力排序对抗长上下文语言模型中的近因偏差
Attention Sorting Combats Recency Bias In Long Context Language Models
AI总结:
针对长上下文语言模型存在的近因偏差问题,提出利用注意力排序方法,通过解码时按文档获注意力大小重排上下文来提升模型性能,同时揭示了现成语言模型用于检索增强生成的挑战。
摘要:
当前语言模型在生成过程中往往无法有效利用长上下文。我们发现,导致这一问题的一个主要因素是预训练期间可能习得的注意力先验:位于上下文较早位置的相关信息平均获得的注意力更少。然而,即便模型未能在回复中使用某份相关文档的信息,与处于相同位置的无关文档相比,它仍会对该相关文档给予优先关注。我们利用这一特性提出了“注意力排序”方法:执行一步解码,按文档获得的注意力大小排序(注意力最高的置于最后),重复该过程,再用新排序的上下文生成答案。我们发现注意力排序提升了长上下文模型的性能。我们的研究结果揭示了使用现成语言模型进行检索增强生成所面临的一些挑战。
英文摘要:
Current language models often fail to incorporate long contexts efficiently during generation. We show that a major contributor to this issue are attention priors that are likely learned during pre-training: relevant information located earlier in context is attended to less on average. Yet even when models fail to use the information from a relevant document in their response, they still pay preferential attention to that document compared to an irrelevant document at the same position. We leverage this fact to introduce ``attention sorting'': perform one step of decoding, sort documents by the attention they receive (highest attention going last), repeat the process, generate the answer with the newly sorted context. We find that attention sorting improves performance of long context models. Our findings highlight some challenges in using off-the-shelf language models for retrieval augmented generation.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。