Training Infinitely Deep and Wide Transformers
Not on the map. Why?
Abstract (arXiv)
Transformers have become the dominant architecture in modern machine learning, yet the theoretical understanding of their training dynamics remains limited. This paper develops a rigorous mathematical framework for analyzing gradient-based training of transformers in the mean-field regime, where both the depth (number of layers) and width (number of attention heads) tend to infinity. While ResNet training can be understood as controlling a neural ODE, transformer training corresponds to controlling a neural PDE, due to the coupling of multiple token distributions through the attention mechanism. Our mean-field model features two types of measure representations: token distributions evolving through layers and attention parameters at each layer. We establish well-posedness of the forward pass through infinitely deep transformers, characterizing token evolution via flow maps that satisfy ODEs in function spaces. Using adjoint sensitivity analysis, we derive an explicit formula for the conditional Wasserstein gradient of the training risk, involving adjoint variables governed by backward ODEs. We prove the existence and uniqueness of gradient flow curves in the conditional Wasserstein metric space, establishing a rigorous foundation for gradient-based transformer training. A key technical contribution is providing necessary and sufficient conditions for injectivity of the Neural Tangent Kernel (NTK) for attention mechanisms: we show that NTK injectivity is equivalent to linear independence of log-sum-exp functions modulo affine functions, a condition satisfied by diverse token distributions, including discrete distributions, uniform distributions, and Gaussian mixtures. Under this NTK injectivity assumption, we prove that gradient flow converges to global minima when the initial loss is sufficiently small, eliminating spurious local minima from the optimization landscape.
Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 28 of its 48 references that are in the map. First posted on arXiv 17 May 2026.
Builds on
28 of 48 references.
References · 28
- 2017Attention Is All You Needcited by 59,932
- 2015Deep Residual Learning for Image Recognitioncited by 51,809
- 2018Neural Ordinary Differential Equationscited by 3,733
- 2018Neural Tangent Kernel: Convergence and Generalization in Neural Networkscited by 2,597
- 2018A Convergence Theory for Deep Learning via Over-Parameterizationcited by 784
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 700
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
- 2018Gradient Descent Finds Global Minima of Deep Neural Networkscited by 572
- 2018A Mean Field View of the Landscape of Two-Layers Neural Networkscited by 463
- 2018On the Global Convergence of Gradient Descent for Over-parameterized Models using Optimal Transportcited by 422
- 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 274
- 2019Fixup Initialization: Residual Learning Without Normalizationcited by 194
16 more
- 2023One Step of Gradient Descent is Provably the Optimal In-Context Learner with One Layer of Linear Self-Attentioncited by 168
- 2021Sinkformers: Transformers with Doubly Stochastic Attentioncited by 136
- 2023The emergence of clusters in self-attention dynamicscited by 133
- 2020On the linearity of large non-linear models: when and why the tangent kernel is constantcited by 129
- 2020A Mean-field Analysis of Deep ResNet and Beyond: Towards Provable Optimization Via Overparameterization From Depthcited by 56
- 2024Transformers are Universal In-context Learnerscited by 42
- 2022Convergence of gradient descent for deep neural networkscited by 24
- 2022Scaling ResNets in the Large-depth Regimecited by 18
- 2023On the Convergence of Encoder-only Shallow Transformerscited by 13
- 2024Unraveling the Gradient Descent Dynamics of Transformerscited by 11
- 2021On the Global Convergence of Gradient Descent for multi-layer ResNets in the mean-field regimecited by 10
- 2024Understanding the training of infinitely deep and wide ResNets with Conditional Optimal Transportcited by 7
- 2014Control to flocking of the kinetic Cucker-Smale modelcited by 6
- 2024Global Convergence in Training Large-Scale Transformerscited by 5
- 2025On the Convergence of Gradient Descent on Learning Transformers with Residual Connectionscited by 5
- 2023Local Conditions for Global Convergence of Gradient Flows and Proximal Point Sequences in Metric Spacescited by 4
Built on by
Citing papers per year: 2026: 1.
1 paper.