Foundations to Frontier
Tests
B. Statistical Learning Theory › B4 Theory of deep learning

Mean-Field Theory of Neural Networks

Scale a two-layer network's output by 1/n instead of 1/√n and the infinite-width limit changes character: the network becomes an average over 'particles' (its hidden units), and gradient descent becomes a gradient flow of the particle distribution in Wasserstein space (Mei–Montanari–Nguyen, Chizat–Bach, Rotskoff–Vanden-Eijnden, Sirignano–Spiliopoulos). Unlike the NTK limit, the features move by O(1), so the network learns representations. This topic contrasts the two scalings, states the mean-field PDE and its global-convergence results, and connects to maximal-update parameterization (μP). In the exercises you measure feature movement vs width and watch mean-field networks discover the relevant direction of a single-index target while lazy networks don't.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

A crowd that walks vs a crowd that leans

Picture the hidden units of a network as people in a crowd, each standing at a spot that describes what they “look for” in the input. In the NTK picture (previous topic), training asks each person to lean slightly: nobody moves, the crowd’s shape stays the same, and only the way their votes are combined changes. In the mean-field picture, the network’s output is the average opinion of the crowd, and training makes people walk: they physically gather where the useful information is. That walking is feature learning.

Hidden units as particles: do they move?
input weights wⱼ (dashed: the true direction ±w*)
training MSE 0.0000 · alignment with w* 0.939 (random ≈ 0.64 in 2-D)
Grey tails show how far each unit has moved since initialization; dot size is |aⱼ|, colour its sign. In the mean-field scaling the output is an average over particles, so a single unit matters only by moving, and the particles flow toward the useful direction: the network learns a feature. With NTK scaling and growing n, the same loss is reached by tiny moves of many units (lazy training), and alignment stays near its random value.
Why engineers care

Feature learning is why networks beat fixed-kernel methods on perception tasks (camera, lidar, spectra). The mean-field view also underlies practical scaling rules (μP) that let hyperparameters tuned on a small model transfer to a large one, which saves enormous compute when training big flight-perception or foundation models.

📝 Quick check (Level 0)
0/3 answered
  1. 1. In the mean-field picture, hidden units during training…
  2. 2. The network's output in mean-field scaling is…
  3. 3. Which regime learns features?

Level 1: Beginner

★★☆☆☆ Basic⏱ 25 minSecondary-school mathematics: arithmetic and elementary algebra.

Two scalings of the same network

f(x)=1nγ∑j=1najσ(wj⋅x),γ=12 (NTK),γ=1 (mean field).f(x) = \frac1{n^{\gamma}}\sum_{j=1}^na_j\sigma(w_j\cdot x),\qquad\gamma = \tfrac12\ \text{(NTK)},\quad\gamma = 1\ \text{(mean field)}.

With γ = 1 and step size η ∝ n, each neuron’s gradient is O(1/n), its step O(1), and it moves O(1) over training. With γ = ½ and η = O(1), each neuron moves O(1/√n).

Particles and measures

Mean-field: f(x)=∫a σ(w⋅x) dμn(a,w)f(x) = \int a\,\sigma(w\cdot x)\,d\mu_n(a, w) with the empirical measure μn=1n∑jδ(aj,wj)\mu_n = \tfrac1n\sum_j\delta_{(a_j, w_j)}. As n → ∞, μn\mu_n converges to a distribution μ, and the network is a function of μ alone. The neuron index no longer matters.

📝 Quick check (Level 1)
0/3 answered
  1. 1. Mean-field output scale for n = 100:
  2. 2. Per-neuron movement in the NTK regime scales as…
  3. 3. In the mean-field limit, the network depends on…

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 40 minUndergraduate students and practising engineers.

The mean-field PDE

For loss R(μ)=Ex,y12(fμ(x)−y)2R(\mu) = \mathbb E_{x,y}\tfrac12(f_\mu(x) - y)^2, define the potential

Ψ(θ;μ)=Ex,y[(fμ(x)−y) a σ(w⋅x)],θ=(a,w).\Psi(\theta;\mu) = \mathbb E_{x,y}\big[(f_\mu(x) - y)\,a\,\sigma(w\cdot x)\big],\quad\theta = (a, w).

Each particle follows θ˙=−∇θΨ(θ;μt)\dot\theta = -\nabla_\theta\Psi(\theta;\mu_t), so the distribution obeys the continuity equation

∂tμt=∇θ⋅(μt∇θΨ(θ;μt)),\partial_t\mu_t = \nabla_\theta\cdot\big(\mu_t\nabla_\theta\Psi(\theta;\mu_t)\big),

the Wasserstein gradient flow of R. Finite-n SGD tracks this PDE with error O(1/n)O(1/\sqrt n) (propagation of chaos).

Global convergence

R is convex in μ (f is linear in μ), even though it is non-convex in the weights. Chizat and Bach (2018) prove that, for suitably homogeneous models with initial support covering all directions, if the Wasserstein flow converges, it converges to a global minimizer. Mei, Montanari and Nguyen give similar guarantees, with entropy regularization (noisy SGD) yielding convergence.

μP: making it practical

The maximal-update parameterization (Yang and Hu, 2021) chooses per-layer scalings so that every layer’s features move O(1) at any width. Hyperparameters then transfer across width (μTransfer).

🐍 Exercise 1: who moves? NTK vs mean-field scaling
Train the same two-layer tanh network under NTK scaling (1/√n, η = 1) and mean-field scaling (1/n, η = 2n) for widths 50–1600. Measure the relative movement of the first-layer weights and check that the mean-field trained functions converge as width grows.
📝 Quick check (Level 2)
0/3 answered
  1. 1. The mean-field loss R(μ) is…
  2. 2. Finite-width SGD tracks the mean-field PDE with error…
  3. 3. μP is designed so that…

Level 3: Advanced

★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.

Why each neuron moves O(1) in mean field

∂f/∂aj=σ(wj⋅x)/n\partial f/\partial a_j = \sigma(w_j\cdot x)/n and ∂f/∂wj=ajσ′(wj⋅x)x/n\partial f/\partial w_j = a_j\sigma'(w_j\cdot x)x/n. With η = cn, each step changes θj\theta_j by c⋅E[(f−y)∇θ(aσ)]c\cdot\mathbb E[(f - y)\nabla_\theta(a\sigma)], which is O(1) and independent of n. That is exactly a particle following −∇Ψ-\nabla\Psi. Meanwhile f changes by the average of n O(1)/n contributions, so it moves O(1) per unit time as well. ∎

Convexity in the measure (sketch of global optimality)

Because fμf_\mu is linear in μ, R(μ)R(\mu) is a convex functional. A stationary point of the Wasserstein flow satisfies ∇θΨ=0\nabla_\theta\Psi = 0 on the support of μ. If μ also has full support (it “sees” every direction), stationarity everywhere implies Ψ ≡ 0, the first-order optimality condition of the convex problem. So μ is a global minimizer. Homogeneity (ReLU) helps preserve the support. ∎

Mean field vs NTK

NTK (γ = ½) Mean field (γ = 1)
Neuron movement O(1/√n) O(1)
Features frozen learned
Limit object fixed kernel measure flow (PDE)
Theory linear ODE, exact nonlinear PDE, harder
📝 Quick check (Level 3)
0/3 answered
  1. 1. A stationary point of the measure flow with full support is…
  2. 2. Mean-field theory is harder than NTK theory because…
  3. 3. With η = cn in mean field, each neuron's step is…

Level 4: Expert

★★★★★ Expert⏱ 35 minResearchers: original papers and open problems.

Mean field, measured

Exercise 1 (1-D target tanh(3x)cos x, 30 points, 1000 GD steps). Relative first-layer movement, NTK / mean field:

width NTK mean field
50 0.458 1.54
200 0.184 1.57
800 0.093 1.74
1600 0.076 1.66

NTK movement falls like 1/√n while mean-field movement stays O(1). The mean-field trained functions converge as n grows (max gap to n = 1600: 0.0063, 0.0079 and 0.0005 for n = 50, 200 and 800). In fairness, mean-field training was slower here: train MSE 0.164 vs 0.001 for NTK after 1000 steps, because it starts from f ≈ 0 and must move features to fit.

Exercise 2: feature learning (single-index target tanh(2x₁) in d = 10, n = 100, 300 samples, 500 steps). The units’ alignment with w* goes from 0.231 at initialization to 0.346 under NTK scaling, but to 0.922 under mean-field scaling. Test MSE: NTK 0.0143, mean field 0.000092, over 150× better. Learning which direction matters is exactly what lazy training cannot do.

🐍 Exercise 2 (research): feature learning on a single-index target
Train the same network with NTK and mean-field scaling on y = tanh(2w*·x) in 10 dimensions. Measure how strongly the hidden units align with w* before and after training, and compare test error.

Mean field in AI, robotics and aerospace

  • μP / μTransfer: tune a small proxy model, then scale up without re-tuning, a major compute saving.
  • Representation learning from raw sensor data relies on the feature-learning regime.
  • Ensembles and particles: the same PDE view applies to particle-based inference (SVGD) used in Bayesian robotics.
  • Theory for sample complexity: single- and multi-index models explain when networks beat kernels on high-dimensional data.

References

  1. S. Mei, A. Montanari, P.-M. Nguyen (2018). “A mean field view of the landscape of two-layer neural networks.” PNAS, 115(33).
  2. L. Chizat, F. Bach (2018). “On the global convergence of gradient descent for over-parameterized models using optimal transport.” NeurIPS.
  3. G. M. Rotskoff, E. Vanden-Eijnden (2022). “Trainability and accuracy of artificial neural networks: an interacting particle system approach.” Communications on Pure and Applied Mathematics, 75.
  4. J. Sirignano, K. Spiliopoulos (2020). “Mean field analysis of neural networks: a law of large numbers.” SIAM Journal on Applied Mathematics, 80(2).
  5. G. Yang, E. J. Hu (2021). “Tensor programs IV: feature learning in infinite-width neural networks.” ICML.