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.
翻译:在本文中,我们证明了大语言模型(LLMs)注意力分配中固有的波形模式显著影响其在需要高度上下文意识的任务(例如使用LLMs进行工具使用)中的表现。具体而言,当关键信息位于注意力波形的波谷区域时,模型可能会忽略这些上下文中的关键信息,导致性能下降。为解决这一问题,我们提出了一种名为Attention Buckets的新型推理方法。该方法允许LLMs通过多个并行过程处理输入,每个过程使用不同的旋转位置嵌入基角,从而生成独特的注意力波形。通过用一个过程的注意力波谷补偿另一个过程的注意力波峰,我们的方法增强了LLMs对不同上下文位置的感知,从而降低了忽略关键信息的风险。在最大的工具使用基准测试中,我们的方法将7B模型提升至与GPT-4相当的最先进性能。在同样需要全面理解上下文内容的其他基准测试及一些RAG任务中,Attention Buckets也展现出显著的性能提升。