2025-10-28 · 进阶 · 自然语言处理 · 机器学习

Knocking-Heads Attention

该论文提出了敲击头部注意力(KHA),一种通过共享变换矩阵实现头部间通信的多头注意力机制,显著提高了模型性能和训练稳定性。

更新于 2025-12-08。作者:Zhanchao Zhou、Xiaodong Chen、Haoxing Chen、Zhenzhong Lan、Jianguo Li。

中文摘要

多头注意力(MHA)已成为现代大型语言模型的基础,通过并行注意力头来增强表征能力。然而,增加头部的数量本质上会削弱单个头部的容量,而现有的注意力机制——无论是标准MHA还是其变体,如分组查询注意力(GQA)和分组绑定注意力(GTA)——只是简单地将孤立头部的输出连接起来,而没有强大的交互。为了解决这一限制,我们提出了敲头注意力(KHA),它使得注意力头部能够“敲击”彼此——在缩放点积注意力之前促进跨头部特征级别的交互。这是通过将共享的对角初始化投影矩阵应用于所有头部来实现的。对角初始化在训练开始时保留了头部特定的专业化,同时允许模型逐步学习跨头部的集成表示。KHA仅添加了最小的参数和FLOPs,并且可以无缝集成到MHA、GQA、GTA和其他注意力变体中。我们通过在1T高质量标记上训练一个6.1B参数的MoE模型(激活1.01B)来验证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.

解读

一句话总结

该论文提出了敲击头部注意力(KHA),一种通过共享变换矩阵实现头部间通信的多头注意力机制,显著提高了模型性能和训练稳定性。

问题1:这篇论文想要解决什么具体问题?

问题2:论文的核心创新点是什么?

问题3:实验结果如何验证了方法的有效性?

问题4:这个研究的实际应用价值是什么?

来源

机器可读索引:llms.txt