[Paper Review] Infinite Limits of Multi-head Transformer Dynamics
This paper develops a dynamical mean field theory (DMFT) framework to analyze infinite scaling limits of multi-head self-attention in transformers, identifying parameterizations that enable stable feature learning. It shows that the infinite head limit ($\mathcal{H} \to \infty$) with finite key/query dimension $N$ leads to deterministic, concentrated attention dynamics, while the infinite key/query dimension limit ($N \to \infty$) under $\mu$P scaling causes all heads to collapse into identical dynamics, effectively reducing multi-head attention to single-head behavior.
In this work, we analyze various scaling limits of the training dynamics of transformer models in the feature learning regime. We identify the set of parameterizations that admit well-defined infinite width and depth limits, allowing the attention layers to update throughout training--a relevant notion of feature learning in these models. We then use tools from dynamical mean field theory (DMFT) to analyze various infinite limits (infinite key/query dimension, infinite heads, and infinite depth) which have different statistical descriptions depending on which infinite limit is taken and how attention layers are scaled. We provide numerical evidence of convergence to the limits and discuss how the parameterization qualitatively influences learned features.
Motivation & Objective
- To identify parameterizations that allow stable, non-trivial feature learning in multi-head transformers under infinite width, depth, and head limits.
- To develop a dynamical mean field theory (DMFT) framework for analyzing training dynamics in the feature learning regime of randomly initialized transformers.
- To resolve the tension between maintaining a non-trivial kernel at initialization and enabling feature learning in deep transformers.
- To investigate how different infinite limits—key/query dimension $N$, head count $\mathcal{H}$, and depth $L$—affect attention dynamics and representation learning.
- To demonstrate that the $\mu$P scaling is necessary for a well-defined $N \to \infty$ limit and to explore its consequences on head diversity.
Proposed method
- Derives a DMFT action for multi-head transformers with $N$-dimensional keys/queries, $\mathcal{H}$ heads, and depth $L$, enabling analysis of infinite limits.
- Applies DMFT techniques to analyze the $N \to \infty$, $\mathcal{H} \to \infty$, and $L \to \infty$ limits, identifying distinct statistical descriptions for each.
- Uses self-averaging properties in the $\mathcal{H} \to \infty$ limit to show concentration of attention variables and residual stream feature kernels, leading to deterministic training dynamics.
- Introduces a residual branch scaling of $L^{-\alpha_L}$ with $\alpha_L \in [\frac{1}{2}, 1]$ to stabilize the infinite depth limit and maintain feature learning.
- Analyzes the effect of layer normalization in the $\mathcal{H} \to \infty$ limit, showing it preserves scaling behavior and does not disrupt backward pass dynamics.
- Employs numerical experiments on CIFAR-5M and C4 to validate convergence to theoretical limits and observe learned feature behavior.

Experimental results
Research questions
- RQ1What parameterizations allow well-defined infinite width and depth limits in multi-head transformers while preserving feature learning?
- RQ2How does the $N \to \infty$ limit under $\mu$P scaling affect attention head dynamics and representation diversity?
- RQ3What statistical description emerges in the $\mathcal{H} \to \infty$ limit with finite $N$, and does it yield deterministic training dynamics?
- RQ4How does the infinite depth limit behave under residual branch scaling, and what is the trade-off between kernel stability and feature learning?
- RQ5Does the $\mathcal{H} \to \infty$ limit preserve non-Gaussian distributions of residual stream variables throughout training?
Key findings
- The $N \to \infty$ limit under $\mu$P scaling ($1/N$ scaling of key/query inner product) is necessary for a well-defined limit, and this scaling causes all attention heads to follow identical dynamics, effectively collapsing multi-head attention into single-head attention.
- In the $\mathcal{H} \to \infty$ limit with finite $N$, the distribution of attention variables across heads concentrates, leading to deterministic training dynamics and concentration of output logits and residual stream feature kernels.
- Despite $N$ being finite, the $\mathcal{H} \to \infty$ limit results in a non-trivial, stable feature learning regime with a limiting distribution of attention matrices throughout training.
- The infinite depth limit with $L^{-\alpha_L}$ residual scaling ($\alpha_L \in [\frac{1}{2}, 1]$) maintains non-trivial kernel behavior at initialization and supports feature learning in both MHSA and MLP blocks.
- Numerical experiments confirm convergence to theoretical limits, showing stable training dynamics and consistent learned features across model scales under the $\mathcal{H} \to \infty$ limit.
- Layer normalization does not disrupt the infinite head limit, as its effects self-average and preserve the scaling of gradients in the $\mathcal{H} \to \infty$ regime.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.