arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2602.21371cs.LG
收藏

交错头部注意力

Interleaved Head Attention

Meta;UT Austin(德克萨斯大学);UC Berkeley(伯克利大学);Harvard University(哈佛大学);MIT(麻省理工学院)

Sai Surya Duvvuri, Chanakya Ekbote, Rachit Bansal, Rishabh Tiwari, Devvrit Khatri, David Brandfonbrener, Paul Liang, Inderjit Dhillon, Manzil Zaheer

AI总结:

交错头部注意力通过构造伪头实现跨头混合,提升多步推理效率,在多项式任务和顺序敏感任务中参数效率提高,实测在RULER和OpenThoughts上取得显著提升。

摘要:

多头注意力(MHA)是现代大型语言模型(LLMs)的核心计算基本单元。然而,MHA存在根本性的线性扩展限制:H个注意力头会产生恰好H个独立的注意力矩阵,在注意力计算过程中头之间没有交流。这在多步推理中变得有问题,因为正确的答案依赖于从上下文的多个部分聚合证据,并在中间推断的链式中组成潜在的token到token的关系。为了解决这个问题,我们提出了交错头部注意力(IHA),它通过为每个头构造P个伪头(通常P=H)来实现跨头混合,其中每个伪查询/键/值是所有H个原始查询、键和值的学得线性组合。伪查询和伪键头之间的交互在每个头中诱导出多达P²种注意力模式,参数开销为O(H²P)。我们提供了理论证明,显示在合成多项式任务(IHA使用Θ(√k n²)参数 vs. MHA的Θ(kn²))和合成顺序敏感的CPM-3任务(IHA使用⌈√N_max⌉个头 vs. MHA的N_max)中,效率得到了改进。在真实世界基准测试中,IHA在RULER上的多键检索上提高了10-20%(4k-16k),并在OpenThoughts上经过推理微调后,GSM8K提高了5.8%,MATH-500提高了2.8%(多数投票)。

英文摘要:

Multi-Head Attention (MHA) is the core computational primitive underlying modern Large Language Models (LLMs). However, MHA suffers from a fundamental linear scaling limitation: $H$ attention heads produce exactly $H$ independent attention matrices, with no communication between heads during attention computation. This becomes problematic for multi-step reasoning, where correct answers depend on aggregating evidence from multiple parts of the context and composing latent token-to-token relations over a chain of intermediate inferences. To address this, we propose Interleaved Head Attention (IHA), which enables cross-head mixing by constructing $P$ pseudo-heads per head (typically $P=H$), where each pseudo query/key/value is a learned linear combination of all $H$ original queries, keys and values respectively. Interactions between pseudo-query and pseudo-key heads induce up to $P^2$ attention patterns per head with modest parameter overhead $\mathcal{O}(H^2P)$. We provide theory showing improved efficiency in terms of number of parameters on the synthetic Polynomial task (IHA uses $Θ(\sqrt{k}n^2)$ parameters vs. $Θ(kn^2)$ for MHA) and on the synthetic order-sensitive CPM-3 task (IHA uses $\lceil\sqrt{N_{\max}}\rceil$ heads vs. $N_{\max}$ for MHA). On real-world benchmarks, IHA improves Multi-Key retrieval on RULER by 10-20% (4k-16k) and, after fine-tuning for reasoning on OpenThoughts, improves GSM8K by 5.8% and MATH-500 by 2.8% (Majority Vote) over full attention.

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

↑