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中心)
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.
Gaoling School of Artificial Intelligence, Renmin University of China(中国人民大学高瓴人工智能学院);Beijing Key Laboratory of Big Data Management and Analysis Methods(大数据管理与分析方法北京市重点实验室);NLP Group, DCST, IAI, BNRIST, Tsinghua University(清华大学计算机科学与技术系、人工智能研究院、北京国家信息科学与技术研究中心自然语言处理组);International Innovation Center of Tsinghua University, Shanghai(清华大学上海国际创新中心);Pattern Recognition Center, WeChat AI, Tencent Inc(腾讯微信人工智能模式识别中心);Quan Cheng Laboratory(泉城实验室)
Learning stochastic dynamics and predicting emergent behavior using transformers
Ghent University(根特大学);University of Ottawa(渥太华大学);Vector Institute for Artificial Intelligence(向量人工智能研究所);Lawrence Berkeley National Laboratory(劳伦斯伯克利国家实验室)
ORIGINS Data Science Lab(ORIGINS数据科学实验室);Technical University Munich(慕尼黑技术大学);Department of Mathematics(数学系);Harvard University(哈佛大学);Departement Mathematik(数学系);ETH Zürich(苏黎世联邦理工学院)
Machine Learning Methods for Studying Latent Neural Activity Dynamics
School of Software Engineering, Sun Yat-sen University(中山大学软件工程学院);Department of Computer Science, Cornell University(康奈尔大学计算机科学系);Department of Neurobiology and Behavior, Cornell University(康奈尔大学神经生物学与行为学系);Department of Ecology and Evolutionary Biology, Cornell University(康奈尔大学生态学与进化生物学系);School of Computer Science and Artificial Intelligence, Foshan University(佛山大学计算机科学与人工智能学院)
Effects of Parameter Norm Growth During Transformer Training: Inductive Bias from Gradient Descent
Allen Institute for AI(艾伦人工智能研究所);New York University(纽约大学);University of Washington(华盛顿大学);Bar Ilan University(巴伊兰大学);Hebrew University of Jerusalem(希伯来大学)
A Percolation Model of Emergence: Analyzing Transformers Trained on a Formal Language
Harvard University(哈佛大学);University of Michigan(密歇根大学);RIKEN(理化学研究所);The University of Tokyo(东京大学);NTT Research, Inc.(NTT研究公司);RIKEN Center for Biosystems Dynamics Research(理化学研究所生物系统动力学研究中心)
What Language Model to Train if You Have One Million GPU Hours?
Hugging Face(Hugging Face公司);LightOn(LightOn公司);NTU, Singapore(新加坡南洋理工大学);Booz Allen(博思艾伦公司);EleutherAI(EleutherAI研究院);Naver Labs Europe(Naver欧洲实验室);University of Washington(华盛顿大学);Berkeley University(加州大学伯克利分校);Big Science(Big Science项目组);Brown University(布朗大学);LPENS(巴黎高等师范学院物理实验室);Allen Institute for AI(艾伦人工智能研究院);New York University(纽约大学)
Predicting Atomistic Transitions with Transformers
Computing and Artificial Intelligence Division, Los Alamos National Laboratory(计算与人工智能部门,洛斯阿拉莫斯国家实验室);School of Engineering and Computer Science, University of Denver(工程与计算机科学学院,丹佛大学);Department of Physics and Astronomy, University of Denver(物理与天文学系,丹佛大学);Department of Electrical and Computer Engineering, University of Texas at Austin(电气与计算机工程系,德克萨斯大学奥斯汀分校);School of Computational Science and Engineering, Georgia Institute of Technology(计算科学与工程学院,佐治亚理工学院);Theoretical Division, Los Alamos National Laboratory(理论部门,洛斯阿拉莫斯国家实验室);X Computational Physics Division, Los Alamos National Laboratory(X计算物理部门,洛斯阿拉莫斯国家实验室)
Exact Conversion of In-Context Learning to Model Weights in Linearized-Attention Transformers
National University of Singapore(新加坡国立大学);Bioinformatics Institute, Agency for Science, Technology and Research (A*STAR)(新加坡科技研究局生物信息学研究所);Huawei Noah’s Ark Lab(华为诺亚方舟实验室);Nanyang Technological University(南洋理工大学);Singapore Eye Research Institute(新加坡眼科研究所);Singapore International Research Laboratory on Artificial Intelligence(新加坡国际人工智能研究实验室);Singapore Institute for Clinical Sciences(新加坡临床科学研究所)
Emergent Granger Causality in Neural Networks: Can Prediction Alone Reveal Structure?
BESE Division, King Abdullah University of Science and Technology (KAUST)(贝赛分校,卡斯泰技术大学(KAUST));CEMSE Division, King Abdullah University of Science and Technology (KAUST)(CEMSE分校,卡斯泰技术大学(KAUST))
The Effect of Training Task Diversity on In-Context Learning through the Lens of Low-Dimensional Subspaces
University of California, Berkeley(加州大学伯克利分校);University of Washington(华盛顿大学);University of California, Los Angeles(加州大学洛杉矶分校);Stanford University(斯坦福大学);University of Toronto(多伦多大学)