加固注意力中最短的一块桶:增强大型语言模型的上下文感知以实现有效的工具使用
Fortify the Shortest Stave in Attention: Enhancing Context Awareness of Large Language Models for Effective Tool Use
AI总结:
本文提出 Attention Buckets 推理方法,通过多并行过程补偿注意力低谷,提升 LLM 上下文感知能力,在工具使用和 RAG 任务中达到与 GPT-4 相当的性能。
摘要:
在本文中,我们展示了大型语言模型(LLM)在注意力分配中固有的波形模式会显著影响其在需要高度上下文感知的任务(如利用 LLM 进行工具使用)上的性能。具体而言,当上下文中的关键信息位于注意力波形的低谷区域时,模型可能会忽略这些信息,导致性能下降。为解决此问题,我们提出了一种新颖的推理方法 Attention Buckets。该方法允许 LLM 通过多个并行过程处理输入,每个过程利用不同的基频进行旋转位置嵌入,从而创建独特的注意力波形。通过用一个过程的注意力峰值补偿另一个过程的注意力低谷,我们的方法提升了 LLM 对各种上下文位置的感知能力,从而降低了忽略关键信息的风险。在最大的工具使用基准上,我们的方法将一个 7B 模型的性能提升至与 GPT-4 相当的最先进水平。在其他基准(包括一些 RAG 任务,这些任务同样需要深入理解上下文内容)上,Attention Buckets 也取得了显著的性能提升。
英文摘要:
In this paper, we demonstrate that an inherent waveform pattern in the attention allocation of large language models (LLMs) significantly affects their performance in tasks demanding a high degree of context awareness, such as utilizing LLMs for tool-use. Specifically, the crucial information in the context will be potentially overlooked by model when it is positioned in the trough zone of the attention waveform, leading to decreased performance. To address this issue, we propose a novel inference method named Attention Buckets. It allows LLMs to process their input through multiple parallel processes. Each process utilizes a distinct base angle for the rotary position embedding, thereby creating a unique attention waveform. By compensating an attention trough of a particular process with an attention peak of another process, our approach enhances LLM's awareness to various contextual positions, thus mitigating the risk of overlooking crucial information. In the largest tool-use benchmark, our method elevates a 7B model to achieve state-of-the-art performance, comparable to that of GPT-4. On other benchmarks and some RAG tasks, which also demand a thorough understanding of contextual content, Attention Buckets also exhibited notable enhancements in performance.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。