注意力中的功能等价性:一项综合研究及其在线性模式连通性中的应用
Functional Equivalence in Attention: A Comprehensive Study with Applications to Linear Mode Connectivity
AI总结:
本文形式化研究了Transformer中位置编码对功能等价性的影响,发现正弦编码保持原始注意力的对称性,而旋转编码显著减少对称群从而增强表达力,并通过对齐算法实证了位置编码对线性模式连通性的关键作用。
摘要:
神经网络参数空间本质上是非单射的,因为不同的参数配置可以通过功能等价性实现相同的函数。虽然这种对称性在经典的全连接和卷积模型中已被充分理解,但在现代基于注意力的架构中变得更为复杂。现有的多头注意力分析主要关注原始公式,忽略了从根本上重塑架构对称性的位置编码。在这项工作中,我们提供了对带有位置编码的Transformer中功能等价性的形式化研究。聚焦于两种最广泛使用的变体——正弦和旋转位置编码(RoPE)——我们表明正弦编码保留了原始注意力的等价结构,而旋转编码显著减少了对称群,从而增强了表达力。这为RoPE在实践中日益突出的地位提供了原则性解释。我们进一步研究了位置编码如何影响线性模式连通性,并通过一种对齐算法,实证表明Transformer设置中连通性的存在和可变性关键取决于位置编码。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。