We formulate data propagation through the Transformer, the machine learning architecture powering large language models, as a nonlinear control system on the space of probability measures. For the mean-field Transformer model with self-attention and affine feed-forward layers, we prove that Gaussian distributions remain exactly Gaussian along the induced flow. This invariance reduces the infinite-dimensional measure dynamics to a finite-dimensional bilinear control system governing the evolution of the mean and covariance, reformulates the expressive capacity of Transformers as a reachability problem for prescribed Gaussian moments, and reveals a novel connection with Riccati-type equations from classical filtering and control.
For time-varying controls, we prove exact finite-time reachability of any target Gaussian distribution whose covariance matrix has the same rank as the initial one, this rank constraint being an intrinsic invariant of the dynamics. For time-invariant parameters, we derive explicit spectral conditions leading either to asymptotic stability toward positive-definite equilibria or to finite-time blow-up of the covariance.
Numerical experiments complement the theory by showing that practical Transformers with Gaussian inputs remain close to moment-matched Gaussian distributions through early and intermediate layers, while Transformers with prescribed attention matrices reproduce the predicted covariance regimes: bounded evolution in stabilizing configurations and blow-up in destabilizing ones.
The Asymptotic Behavior of Attention in Transformers
Department of Applied Mathematics, ICAI School of Engineering, Comillas Pontifical University(应用数学系,ICAI工程学院,科利斯大学);Department of Electrical and Computer Engineering, University of California, Los Angeles(电气与计算机工程系,加州大学洛杉矶分校)
Constructing Efficient Fact-Storing MLPs for Transformers
Computer Science Department, Stanford University(斯坦福大学计算机科学系);Institute for Computational & Mathematical Engineering, Stanford University(斯坦福大学计算与数学工程研究所);Computer Science Department, University of Wisconsin–Madison(威斯康星大学麦迪逊分校计算机科学系);Computer Science and Engineering Department, University at Buffalo(布法罗大学计算机科学与工程系)
ORIGINS Data Science Lab(ORIGINS数据科学实验室);Technical University Munich(慕尼黑技术大学);Department of Mathematics(数学系);Harvard University(哈佛大学);Departement Mathematik(数学系);ETH Zürich(苏黎世联邦理工学院)
Localmax dynamics for attention in transformers and its asymptotic behavior
Mathematical and Computer Engineering, Ecole Nationale des Ponts et Chaussées(数学与计算机工程系,国立桥梁与道路学院);Department of Mathematics and Statistics, Queen’s University(数学与统计学系,皇后大学)
Asymptotic theory of in-context learning by linear attention
The John A. Paulson School of Engineering and Applied Sciences, Harvard University(哈佛大学约翰·A·保罗森工程与应用科学学院);Center for Brain Science, Harvard University(哈佛大学脑科学中心);Society of Fellows, Harvard University(哈佛大学 fellows 会);Department of Physics, Harvard University(哈佛大学物理系);Perimeter Institute for Theoretical Physics, Waterloo, ON N2L 2Y5, Canada(理论物理研究所,滑铁卢,加拿大);The Kempner Institute for the Study of Natural and Artificial Intelligence, 150 Western Avenue, Alston, MA 02134(自然与人工智能研究 institute)
School of Applied and Engineering Physics, Cornell University(康奈尔大学应用与工程物理学院);NTT Physics & Informatics Laboratories, NTT Research, Inc.(NTT研究公司NTT物理与信息学实验室);Kavli Institute at Cornell for Nanoscale Science, Cornell University(康奈尔大学卡夫利纳米科学研究所)
该研究通过原型实验与仿真验证 Transformer 的光学计算可行性,揭示光学 MAC 能量随模型宽度呈 1/d 缩放,并预测大规模光学加速器可带来极高能效优势。
Multi-Headed Transformer Architectures as Time-dependent Wasserstein Gradient Flows
Department of Applied Mathematics and Theoretical Physics, University of Cambridge(应用数学与理论物理系,剑桥大学);Department of Mathematics, University of Twente(数学系,埃因霍温理工大学)
Theory of Scaling Laws for In-Context Regression: Depth, Width, Context and Time
Center for Mathematical Sciences and Applications(数学科学与应用中心);John A. Paulson School of Engineering and Applied Sciences(约翰·A·保罗森工程与应用科学学院);Kempner Institute for the Study of Natural and Artificial Intelligence(自然与人工智能研究学院);Harvard University(哈佛大学)