arXiv:2606.17830cs.LGcs.AI2026-06被引 1

揭示注意力机制中位置编码对函数等价性的影响,解释为何旋转编码更优。

Functional Equivalence in Attention: A Comprehensive Study with Applications to Linear Mode Connectivity

论文配图:Functional Equivalence in Attention: A Comprehensive Study with Applications to Linear Mode Connectivity
图 1 · 摘自论文原文
  • 分析旋转与正弦位置编码在注意力结构中的函数等价性差异。
  • 发现旋转编码显著减少对称性,提升模型表达能力。
  • 实证表明位置编码影响模型参数连通性,适合关注模型训练稳定性者阅读。

神经网络参数空间本质上是非单射的,不同的参数配置可通过函数等价实现相同功能。尽管在传统全连接和卷积模型中这一对称性已广为人知,但在现代基于注意力的架构中则变得更为复杂。现有对多头注意力的研究大多聚焦于基础形式,忽略了位置编码对架构对称性的根本影响。本文针对两种最广泛使用的变体——正弦位置编码与旋转位置编码(RoPE),开展形式化研究。结果表明,正弦编码保留了基础注意力的等价结构,而旋转编码显著降低了对称群,从而增强了模型表达能力,为旋转编码在实践中日益普及提供了理论依据。此外,我们进一步探讨位置编码对线性模式连通性的影响,并通过一种对齐算法,实证验证了不同Transformer设置下连通性的存在与否及变化程度,关键取决于位置编码的设计。

原文摘要 · Abstract (English)

Neural network parameter spaces are inherently non-injective, as distinct parameter configurations can realize identical functions through functional equivalence. While this symmetry is well understood in classical fully connected and convolutional models, it becomes substantially more intricate in modern attention-based architectures. Existing analyses of multihead attention have largely focused on the vanilla formulation, overlooking positional encodings that fundamentally reshape architectural symmetries. In this work, we provide a formal study of functional equivalence in Transformers with positional encodings. Focusing on the two most widely used variants--sinusoidal and rotary positional encodings (RoPE)--we show that sinusoidal encodings preserve the equivalence structure of vanilla attention, whereas rotary encodings significantly reduce the symmetry group, thereby enhancing expressivity. This offers a principled explanation for the growing prominence of RoPE in practice. We further examine how positional encodings affect linear mode connectivity, and through an alignment algorithm, empirically demonstrate that the presence and variability of connectivity across Transformer settings crucially depend on the positional encoding.

注意力机制位置编码函数等价模型连通性

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。