arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.10927cs.LG
收藏

自注意力的底层结构:Transformer训练中的对称性、方向性与涌现动力学

The underlying structures of self-attention: symmetry, directionality, and emergent dynamics in Transformer training

Institute of Neuroinformatics, ETH Zürich and University of Zürich(神经信息学研究所,苏黎世联邦理工学院和苏黎世大学);Centre for Artificial Intelligence, Zürich University of Applied Sciences(人工智能研究中心,应用科学大学);ECLT European Centre for Living Technology, Venice, Italy(欧洲生命科技中心,威尼斯,意大利);ETH AI Center, Zürich, Switzerland(苏黎世联邦理工学院AI中心)

Matteo Saponati, Pascal Sager, Pau Vilimelis Aceituno, Thilo Stadelmann, Benjamin Grewe

AI总结:

本文提出数学框架分析自注意力权重更新结构,揭示双向训练诱导对称性、自回归训练导致方向性,并验证对称初始化可提升编码器模型性能。

摘要:

自注意力对Transformer架构至关重要,但信息如何嵌入自注意力矩阵,以及不同目标函数如何影响这一过程仍不清楚。我们提出一个数学框架,通过推导控制其权重更新的结构来分析自注意力矩阵。利用该框架,我们证明双向训练会在权重矩阵中诱导对称性,而自回归训练则导致方向性和列主导性。我们的理论发现在多个Transformer模型上得到验证——包括ModernBERT、GPT、LLaMA3和Mistral——以及文本、视觉和音频等输入模态。最后,我们应用这些见解,表明对称初始化能提升仅编码器模型在语言任务上的性能。该数学分析为信息如何通过自注意力嵌入提供了新颖的理论视角,从而提高了Transformer模型的可解释性。

英文摘要:

Self-attention is essential to Transformer architectures, yet how information is embedded in the self-attention matrices and how different objective functions impact this process remains unclear. We present a mathematical framework to analyze self-attention matrices by deriving the structures governing their weight updates. Using this framework, we demonstrate that bidirectional training induces symmetry in the weight matrices, while autoregressive training results in directionality and column dominance. Our theoretical findings are validated across multiple Transformer models - including ModernBERT, GPT, LLaMA3, and Mistral - and input modalities like text, vision, and audio. Finally, we apply these insights by showing that symmetric initialization improves the performance of encoder-only models on language tasks. This mathematical analysis offers a novel theoretical perspective on how information is embedded through self-attention, thereby improving the interpretability of Transformer models.

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

↑