We study the large-depth limit of transformers trained with AdamW, by modelling the hidden-state dynamics as an interacting particle system (IPS) coupled through the attention mechanism. Under appropriate scaling of the attention heads, we prove that the joint dynamics of the hidden states and backpropagated variables converge in $L^2$, uniformly over the initial condition, to the solution of a forward--backward system of ODEs at rate $\mathcal O(L^{-1}+L^{-1/3}H^{-1/2})$. Here, $L$ and $H$ denote the depth and number of heads of the transformer, respectively. The limiting system of ODEs can be identified with a McKean--Vlasov ODE (MVODE) when the attention heads do not incorporate causal masking. By using the flow maps associated with this MVODE and applying concentration of measure techniques, we obtain bounds on the difference between the discrete and continuous models that are uniform over compact sets of initial conditions. As this is achieved without resorting to a covering argument, the constants in our bounds are independent of the number of tokens. Furthermore, under a suitable adaptation to AdamW, the bounds become independent of the token embedding dimension.
The Sharpness Disparity Principle in Transformers for Accelerating Language Model Pre-Training
School of Mathematical Sciences, Peking University(北京大学数学科学学院);Center for Machine Learning Research, Peking University(北京大学机器学习研究中心);Shanghai Jiao Tong University(上海交通大学);AI for Science Institute, Beijing, China(北京人工智能科学研究院)
Robust Layerwise Scaling Rules by Proper Weight Decay Tuning
Department of Electrical Engineering and Computer Science, MIT, Cambridge, MA, USA(麻省理工学院电子工程与计算机科学系);Department of Computer Science, UCLA, CA, USA(加州大学洛杉矶分校计算机科学系)
The Stability of Singular Distribution: A Spectral Perspective on the Two-Phase Dynamics of Language Model Pre-training
School of Advanced Interdisciplinary Sciences, University of Chinese Academy of Sciences, Beijing, China(中国科学院大学先进交叉学科学院);State Key Laboratory of AI Safety, Institute of Computing Technology, Chinese Academy of Sciences, Beijing, China(中国科学院人工智能安全国家重点实验室);University of Chinese Academy of Sciences, Beijing, China(中国科学院大学);School of Mathematics, Southeast University, Nanjing, China(东南大学数学学院)
The Shape of Learning: Anisotropy and Intrinsic Dimensions in Transformer-Based Models
Skoltech(斯科尔科沃科技学院);AIRI(人工智能研究所);Lomonosov Moscow State University(罗蒙诺索夫莫斯科国立大学);HSE University(高等经济大学);SberAI(萨伯人工智能公司);Samara National Research University(萨马拉国立研究大学)