Statistical Physics Approaches to High-Dimensional Learning
ICTP Summer School on Machine Learning — Lecture 3
These notes cover the third lecture on the dynamics of learning, spanning Days 3 and 4 of the school. Two complementary settings are developed: online learning in two-layer narrow networks, where each data point is seen exactly once and the dynamics reduce to a closed deterministic ODE system; and multi-pass SGD via the dynamical cavity (mean-field) method, which handles temporal memory effects when data are reused. The online-learning framework follows Goldt et al. (2019)Saad & Solla (1995), with extensions in Goldt et al. (2020)Refinetti et al. (2021). The lecture opens with a tour of recent applications of the statics theory.
A note on perspective for PDE readers. The central achievement of this lecture is a rigorous passage from an -dimensional stochastic process (SGD on ) to a low-dimensional deterministic ODE system. This is exactly analogous to deriving a homogenised or reduced-order model from a fine-scale PDE: the large- limit plays the role of the homogenisation limit, and the order parameters are the effective macroscopic variables. The multi-pass DMFT section adds a further ingredient — temporal memory / retarded friction — which has no direct analogue in standard ODE theory but closely resembles the Volterra integro-differential equations that arise in viscoelastic or history-dependent PDE models.
Applications of the Statics Theory¶
Hidden Manifold Model¶
Real data do not fill uniformly; they live on or near a low-dimensional manifold. The hidden manifold model Goldt et al. (2022)Gerace et al. (2020) captures this: latent codes pass through a random feature map,
where is a random matrix. A Gaussian Equivalence Theorem (GET) shows that the generalisation and training properties of are statistically equivalent to those of a simpler Gaussian surrogate
with coefficients and , . The GET is proved via Lindeberg-type interpolation arguments. It connects the replica/AMP analysis of Lectures 1–2 directly to structured-data regimes.
Neural Manifold Capacity¶
In neuroscience and deep learning, object representations are smooth manifolds of neural population activity. The manifold capacity — maximum number of linearly separable object manifolds per neuron — is computed exactly by the replica method Chung et al. (2018)Mignacco et al. (2025). It depends on the manifold’s intrinsic dimension and radius , and provides a rigorous link between geometric properties of representations and the number of dichotomies a linear readout can implement.
Bayesian Learning in Wide Networks¶
For a two-layer network in the proportional width regime , Bayesian inference can be analysed exactly in the proportional-sample limit Cui et al. (2023)Camilli et al. (2025) (linear scaling ) and in the quadratic-sample regime Maillard et al. (2024)Erba et al. (2025)Barbier et al. (2026) (). In both regimes the posterior collapses to a low-dimensional order-parameter description.
Statistical Mechanics of Transformers¶
A full statistical-mechanics theory of deep multi-head self-attention is developed in Tiberi et al. (2024). The main result: under Bayesian inference in the proportional limit, the network performs kernel ridge regression with an effective “renormalised” kernel
where ranges over attention paths (sequences of head choices across layers), couples inputs along paths , and the order-parameter matrix encodes inter-path correlations. Two mechanisms emerge: attention path suppression (down-weighting uninformative paths) and attention path coupling (exploiting correlations between paths). Counterintuitively, smaller pruned networks can outperform larger ones: for the off-diagonal terms are active; for path coupling vanishes ( becomes diagonal) and the large network uses a less informative kernel.
Training Dynamics: Setting the Stage¶
From the Statics Picture to Dynamics¶
Lectures 1–2 characterised the endpoint of training — the fixed point reached by gradient descent and its generalisation error. This lecture asks: how does the trajectory get there? Two complementary regimes:
Online learning (each datum seen once): individual SGD steps are independent, enabling an exact derivation of deterministic ODEs for macroscopic order parameters.
Multi-pass SGD (data reused across epochs): past gradients create temporal correlations (memory), requiring a more elaborate dynamical mean-field theory.
Gradient Descent and SGD¶
Full-batch gradient descent uses the complete dataset at every step:
Stochastic gradient descent (SGD) uses a mini-batch :
The difference is zero-mean noise; for large batches the CLT makes it approximately Gaussian, yielding a Langevin SDE. The key observation: as an -dimensional weight trajectory collapses onto a deterministic ODE for a handful of scalar order parameters — exactly as a fine-scale PDE system collapses to an effective macroscopic equation.
Online Learning in Two-Layer Networks¶
Setup: Teacher and Student¶
Data: , i.i.d.
Teacher (frozen): , , , fixed.
Student (trained): , , , learned. Typical activations: , , or .
Squared loss: , .
The normalisation in ensures the pre-activations are regardless of — the same role as a mesh-width normalisation in finite-difference schemes.
Online SGD Updates¶
At step a fresh i.i.d.\ sample is drawn and the weights are updated:
The factor in the second update ensures that all order parameters evolve on the same timescale.
Order Parameters and Their Sufficiency¶
Since , the pre-activations are jointly Gaussian with zero mean and second moments:
These scalar quantities are sufficient statistics for the generalisation error: since is jointly Gaussian with covariance determined entirely by ,
where with built from . The entire -dimensional weight configuration is compressed into a matrix of size .
Closed ODE System for the Order Parameters¶
In the joint limit with , the stochastic increments of the order parameters split as
Summing steps (one epoch, ), the fluctuation sum is . Setting (rescaled time), the order parameters satisfy deterministic ODEs Goldt et al. (2019)Saad & Solla (1995):
All expectations are over with from the current ; they can be computed numerically, or analytically when . The Itô correction in arises from the discrete-to-continuous passage: by the law of large numbers for Gaussian vectors, giving an term with no analogue in continuous-time gradient flow. This is the stochastic analogue of the stability correction in an explicit time-stepping scheme.
Rigorous proofs of convergence to this ODE system are in Goldt et al. (2019)Veiga et al. (2022)Ben Arous et al. (2021)Ben Arous et al. (2022).
Plateau Dynamics and the Specialisation Transition¶
The Soft Committee Machine¶
The ODEs become explicit for the soft committee machine Saad & Solla (1995): fixed readout weights , equal-width teacher , erf activation, and isotropic teacher . Small initialisation with .
Goal: each student unit should specialise to one teacher direction, for some permutation.
By the permutation symmetry of the initialisation, the dynamics remain on an invariant manifold of the ODE:
with . Only two scalar unknowns remain: (same-index student–teacher alignment) and (cross-index alignment).
Symmetric fixed point. The reduced ODE system has a fixed point at
where all student units overlap equally with all teacher directions — no specialisation. The generalisation error at this plateau is
which increases with : wider networks have worse plateaus because they have more symmetry to break. The student is stuck in a saddle point of the loss landscape.
Escape from the Plateau: Linear Stability Analysis¶
Linearise the ODE around :
where is the Jacobian evaluated at the fixed point. The permutation symmetry of the problem block-diagonalises into two one-dimensional modes:
Symmetric mode : eigenvalue — stable (perturbations along the manifold decay).
Specialisation mode : eigenvalue — unstable (the plateau is a saddle point). For : .
This is exactly a standard linear stability analysis for a fixed point of an ODE — familiar from bifurcation theory. The specialisation mode is the unstable manifold direction.
Escape time. Since with , the specialisation amplitude at initialisation is . It grows as . Escaping when :
The plateau duration is logarithmic in (fine) and linear in (a genuine bottleneck for wide networks). This gives a precise quantitative prediction for when training suddenly accelerates — the hallmark of the specialisation transition.
Graded Teacher and Cascade of Specialisations¶
For a teacher with non-isotropic self-overlap , , the specialisation modes become unstable at different rates. The result is a cascade of specialisations : the student learns teacher directions one at a time, strongest first, each appearing as a step-down in . This is the ODE-level mechanism behind the empirical observation of “grokking” and staged learning in modern networks.
Optimal Learning Rate Schedules¶
(Reference: Saad & Rattray (1997))
Since the ODE for is exact as , one can optimise the schedule to minimise at a final time . This is a standard optimal control problem — exactly as one minimises a cost functional in PDE-constrained optimisation.
Locally Optimal Rate¶
At each time, choose to maximise the instantaneous rate of decrease of :
where is the drift and is the noise covariance contribution. Setting :
This is the steepest instantaneous descent on a signal-to-noise ratio. However, it stalls at the plateau: the locally optimal cannot break the symmetry because there.
Globally Optimal Rate via Pontryagin’s Principle¶
Minimise subject to the ODE constraint . Introduce a costate (adjoint) variable and form the Hamiltonian:
Pontryagin’s Minimum Principle gives:
State ODE: (forward in ).
Costate ODE: , with final condition (backward in ).
Optimality condition: minimise over at each :
The costate encodes the sensitivity of the final error to the current state, propagated backward in time. This is the adjoint equation familiar from PDE-constrained optimisation. At the plateau, can be nonzero even when (because the final error is sensitive to the current state even when the state is not moving), allowing to push the learning rate high enough to escape the symmetric fixed point. The global rate can therefore outperform the local rate near the plateau — at the cost of temporarily increasing to set up a faster descent later Saad & Rattray (1997).
Multi-Pass SGD via Dynamical Mean-Field Theory¶
(Day 4)
Online learning assumes each data point is seen exactly once. Multi-pass SGD reuses data across epochs, introducing temporal memory: the weight depends on its own past through earlier gradients evaluated on the same data points.
The Model¶
Consider a single-layer model with binary Gaussian mixture data:
Train with squared loss and regularisation. Multi-pass SGD with subsampling schedule (indicating whether sample is in the current mini-batch):
where is the expected batch fraction and is the persistence time. As with , the temporal correlations between steps (absent in online learning) must be tracked explicitly.
The Dynamical Cavity Method: Three Contributions¶
Decompose the weight vector along three directions:
Lab frame : a fixed unit direction uncorrelated with data and teacher, .
Data directions : projections onto individual data points, .
Teacher direction : .
Adding the direction as a perturbation and expanding to first order in , one finds that the weight component along satisfies an effective stochastic process with three terms Mignacco et al. (2020)Bordelon & Pehlevan (2022):
① Random force : the contribution of sample ’s input component along , summed over all active samples. By the CLT, it is Gaussian with zero mean and two-time correlation
where is the correlation kernel.
② Retarded friction: the past trajectory for feeds back through a memory kernel ,
encoding how the gradient at time is influenced by the weight perturbation at the earlier time . This is the Onsager response function of the dynamics, and it is the key new ingredient absent from online learning. The convolution is a Volterra integral of the first kind — exactly the structure of memory-dependent (history-dependent) ODEs / viscoelastic constitutive laws. In online learning, because past gradients were computed on different (independent) data; in multi-pass SGD they were computed on the same data, creating a nontrivial .
③ Dynamic renormalisation of the regularisation: accounts for the curvature of the loss.
DMFT Closure and Self-Consistency¶
The effective process for depends on and , which in turn depend on the distribution of — which depends on . Self-consistently closing this loop gives the dynamical mean-field theory (DMFT) equations: a closed system of integro-differential equations for the two-time correlation functions and response functions of the effective process. This is the dynamical analogue of the self-consistency equations for the replica order parameters in Lecture 1.
The DMFT equations are exact as . They capture:
Multi-pass memory: the Volterra kernel encodes how earlier training steps affect the current gradient.
Batch-size effects: the persistence time interpolates between full-batch GD (, long-lived) and online SGD (, ).
Phase diagrams: overfitting vs.\ underfitting as a function of , , , and Mignacco et al. (2020)Bordelon & Pehlevan (2022).
Scaling Limits¶
The crossover between three qualitatively different regimes is controlled by and Veiga et al. (2022):
| Regime | Condition | Outcome |
|---|---|---|
| Perfect learning | Population error | |
| Bad learning | Noise dominates, nonzero error | |
| No convergence | ODE description breaks down |
The classical online-learning limit of these notes (, , ) sits at , on the boundary of the perfect-learning regime. The full phase diagram in the plane is in Veiga et al. (2022).
- Goldt, S., Advani, M., Saxe, A. M., Krzakala, F., & Zdeborová, L. (2019). Dynamics of Stochastic Gradient Descent for Two-Layer Neural Networks in the Teacher–Student Setup. NeurIPS 2019.
- Saad, D., & Solla, S. A. (1995). On-Line Learning in Soft Committee Machines. Physical Review E, 52(4), 4225–4243.
- Refinetti, M., Goldt, S., Krzakala, F., & Zdeborová, L. (2021). Classifying High-Dimensional Gaussian Mixtures: Where Kernel Methods Fail and Neural Networks Succeed. ICML 2021.
- Goldt, S., Loureiro, B., Reeves, G., Krzakala, F., & Zdeborová, L. (2022). The Gaussian Equivalence of Generative Models for Learning with Shallow Neural Networks. MSML 2022.
- Gerace, F., Loureiro, B., Krzakala, F., Mézard, M., & Zdeborová, L. (2020). Generalisation Error in Learning with Random Features and the Hidden Manifold Model. ICML 2020.
- Chung, S., Lee, D. D., & Sompolinsky, H. (2018). Classification and Geometry of General Perceptual Manifolds. Physical Review X, 8(3), 031003.
- Mignacco, F., Chou, T., & Chung, S. (2025). Neural Manifold Capacity with Variability. Physical Review E.
- Cui, H., Loureiro, B., Krzakala, F., & Zdeborová, L. (2023). Bayes-Optimal Learning of an Extensive-Width Neural Network from Quadratically Many Samples. ICML 2023.
- Camilli, M., Barbier, J., & Krzakala, F. (2025). Fundamental Limits of Overparametrized Shallow Neural Networks for Supervised Learning. COLT 2025.
- Maillard, A., Loureiro, B., Krzakala, F., & Zdeborová, L. (2024). Bayes-Optimal Learning of a Two-Layer Neural Network. NeurIPS 2024.
- Erba, V., Barbier, J., Krzakala, F., & Zdeborová, L. (2025). Bayes-Optimal Learning with Quadratic Data. NeurIPS 2025.
- Barbier, J., Nguyen, T., & Zdeborová, L. (2026). Bayesian Inference of a Random Matrix Model with a Two-Layer Neural Network. Physical Review X.
- Tiberi, L., Mignacco, F., Irie, K., & Sompolinsky, H. (2024). Dissecting the Interplay of Attention Paths in a Statistical Mechanics Theory of Transformers. NeurIPS 2024.
- Veiga, R., Stephan, L., Loureiro, B., Krzakala, F., & Zdeborová, L. (2022). Phase Diagram of Stochastic Gradient Descent in High-Dimensional Two-Layer Neural Networks. NeurIPS 2022.