arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2510.23052cs.CL
收藏

敲头注意力

Knocking-Heads Attention

Ant Group(蚂蚁集团);Zhejiang University(浙江大学);Westlake University(西湖大学);Renmin University of China(中国人民大学)

Zhanchao Zhou, Xiaodong Chen, Haoxing Chen, Zhenzhong Lan, Jianguo Li

AI总结:

针对多头注意力头间缺乏交互的问题,提出敲头注意力(KHA),通过共享对角初始化投影矩阵实现跨头特征交互,仅增少量参数,在6.1B MoE模型上训练1T token,取得更优且更稳定的训练效果和下游性能。

摘要:

多头注意力(MHA)已成为现代大型语言模型的基石,通过并行注意力头增强了表示能力。然而,增加头的数量本质上会削弱单个头的能力,现有的注意力机制——无论是标准MHA还是其变体如分组查询注意力(GQA)和分组绑定注意力(GTA)——都只是简单拼接来自孤立头的输出,缺乏强交互。为解决这一局限,我们提出了敲头注意力(KHA),使注意力头能够相互“敲击”——在缩放点积注意力之前促进跨头的特征级交互。这是通过在所有头上应用一个共享的、对角初始化的投影矩阵来实现的。对角初始化在训练开始时保留了头特定的专门化,同时允许模型逐步学习集成的跨头表示。KHA仅增加极少的参数和FLOPs,可以无缝集成到MHA、GQA、GTA及其他注意力变体中。我们通过在一个6.1B参数的MoE模型(1.01B激活参数)上使用1T高质量token进行训练来验证KHA。与基线注意力机制相比,KHA带来了更优越且更稳定的训练动态,在下游任务中取得了更好的性能。

英文摘要:

Multi-head attention (MHA) has become the cornerstone of modern large language models, enhancing representational capacity through parallel attention heads. However, increasing the number of heads inherently weakens individual head capacity, and existing attention mechanisms - whether standard MHA or its variants like grouped-query attention (GQA) and grouped-tied attention (GTA) - simply concatenate outputs from isolated heads without strong interaction. To address this limitation, we propose knocking-heads attention (KHA), which enables attention heads to "knock" on each other - facilitating cross-head feature-level interactions before the scaled dot-product attention. This is achieved by applying a shared, diagonally-initialized projection matrix across all heads. The diagonal initialization preserves head-specific specialization at the start of training while allowing the model to progressively learn integrated cross-head representations. KHA adds only minimal parameters and FLOPs and can be seamlessly integrated into MHA, GQA, GTA, and other attention variants. We validate KHA by training a 6.1B parameter MoE model (1.01B activated) on 1T high-quality tokens. Compared to baseline attention mechanisms, KHA brings superior and more stable training dynamics, achieving better performance across downstream tasks.

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

↑