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

注意力指令:通过提示放大中间部分的注意力

Attention Instruction: Amplifying Attention in the Middle via Prompting

University of Cambridge(剑桥大学);University of Glasgow(格拉斯哥大学)

Meiru Zhang, Zaiqiao Meng, Nigel Collier

AI总结:

本文提出通过提示扩充注意力指令以缓解大语言模型的位置偏差,发现模型缺乏相对位置感知能力,但能利用匹配索引将注意力调整至特定片段,从而提升RAG应用中的信息利用率。

摘要:

大型语言模型的上下文窗口已扩展至128k tokens或更多。然而,由于缺乏注意力,语言模型仍受位置偏差影响,难以访问和使用上下文的中间部分。我们检验了LLMs的相对位置感知能力,以及通过提示缓解注意力分配不均的可行性。我们用$\ exttt{attention instructions}$扩充原始任务指令,引导语言模型将更多注意力分配给上下文的选定片段。我们在多文档问答任务上,使用基于位置和基于索引的指令进行了全面调查。发现语言模型不具备上下文的相对位置感知能力。尽管如此,它们展现出利用匹配索引将注意力调整至特定片段的能力。我们的分析有助于深入理解LLMs的位置偏差,并提供了通过指令缓解该偏差的途径,从而有利于LLMs在RAG应用中定位和利用检索文档中的相关信息。

英文摘要:

The context window of large language models has been extended to 128k tokens or more. However, language models still suffer from position bias and have difficulty in accessing and using the middle part of the context due to the lack of attention. We examine the relative position awareness of LLMs and the feasibility of mitigating disproportional attention through prompting. We augment the original task instruction with $\texttt{attention instructions}$ that direct language models to allocate more attention towards a selected segment of the context. We conduct a comprehensive investigation on multi-document question answering task with both position-based and index-based instructions. We find that language models do not have relative position awareness of the context. Nevertheless, they demonstrate the capacity to adapt attention to a specific segment using matching indexes. Our analysis contributes to a deeper understanding of position bias in LLMs and provides a pathway to mitigate this bias by instruction, thus benefiting LLMs in locating and utilizing relevant information from retrieved documents in RAG applications.

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

↑