Statistical Physics Approaches to High-Dimensional Learning
ICTP Summer School on Machine Learning — Lecture 2 (with Day 3 continuation)
These notes cover the second lecture on clustering with approximate message passing (AMP), together with its continuation at the start of Day 3. The running theme is that clustering a Gaussian mixture can be reframed as a planted spin-glass problem, and the cavity method — originally developed for the Sherrington–Kirkpatrick spin glass Thouless et al. (1977) — gives both the optimal achievable accuracy and a practical algorithm (AMP) for achieving it. The analysis follows Lesieur et al. (2016).
A note on perspective for PDE readers. AMP is an iterative algorithm whose exact large- behaviour is tracked by a scalar recursion called state evolution. The analogy to PDE numerics is this: state evolution is like a CFL-type analysis, but instead of stability it tracks the fixed points and basins of attraction of the algorithm. The “hard phase” — where reconstruction is information-theoretically possible but algorithmically intractable — is analogous to a regime where a numerical method is convergent but with a basin of attraction that shrinks as the mesh is refined.
The accompanying Jupyter notebook (ICTP_day2_notebook.ipynb) is organised into three parts. Part 1 implements the planted SK model, AMP, and state evolution for the rank-one case, and traces the AMP overlap transition around the IT threshold. Part 2 computes the Bethe free entropy as a function of the overlap order parameter for the Rademacher–Bernoulli prior, identifying the four regimes separated by . Part 3 generalises to rank- asymmetric matrix estimation and runs Low-rank AMP on sampled GMM data.
Unsupervised Learning¶
The goal of unsupervised learning is to find hidden structure in unlabelled data. Three main families:
Dimensionality reduction (PCA, t-SNE, autoencoders): represent high-dimensional data in a low-dimensional space that preserves relevant structure.
Clustering (k-means, GMM): partition data into groups of similar points.
Generative modelling (diffusion models, LLMs): learn the data distribution and sample new examples.
This lecture studies clustering for data drawn from a Gaussian mixture. The three central questions are: when is recovering the cluster memberships (i) information-theoretically (IT) possible, (ii) achievable by a polynomial-time algorithm, and (iii) is there a gap between these thresholds?
Setting Up the Model¶
Throughout, (dimension) and (sample size) go to infinity with the rank and the load fixed.
Generative Model¶
Following Lesieur et al. (2016), each data point is drawn as
Here is the (unknown) centroid of cluster , is the (unknown) cluster assignment of point , and is observation noise. The signal strength plays the role of an inverse noise level: larger means more separated centroids and easier clustering.
Reformulation as Low-Rank Matrix Factorisation¶
Pack the unknowns into a centroid matrix (columns = centroids) and a one-hot assignment matrix (each row has exactly one 1). The observation matrix is:
This is a low-rank-plus-noise problem: recover and from a noisy rank- perturbation of a pure noise matrix. This structure appears throughout applied mathematics — in compressed sensing, matrix completion, community detection — and the physics tools apply to all of them.
Bayesian Posterior¶
Bayes’ rule gives the posterior over unknowns:
where is the log-likelihood of observing given and is the partition function. This has exactly the Gibbs-measure structure of Lecture 1: posterior = Boltzmann distribution, negative log-likelihood = energy, data = quenched disorder.
Nishimori Identities¶
In the Bayes-optimal setting (the assumed model perfectly matches the true one), there is a remarkable symmetry between the truth and posterior samples. For any test function :
where is the true signal and is a sample from the posterior. The key practical consequence: the overlap between a posterior sample and the truth equals the overlap between two independent posterior samples,
In the replica language of Lecture 1, this collapses the two order parameters and into one, substantially simplifying the saddle-point equations. It is analogous to a symmetry that collapses the PDE system from order to order .
From Clustering to the Sherrington–Kirkpatrick Model¶
For the observation matrix is symmetric and the problem reduces to the spiked Wigner model:
With an Ising () prior , so , the posterior Hamiltonian reduces to
which is precisely the planted Sherrington–Kirkpatrick (SK) Hamiltonian — a disordered ferromagnet with couplings that contain a hidden rank-one signal planted in the noise. The pure SK model (no planted signal) was solved by the replica method Thouless et al. (1977)Mézard et al. (1987); here the structure is richer because the disorder is correlated.
The Cavity Method¶
The cavity method is an alternative to replicas that gives the same saddle-point equations but with a more algorithmic flavour. The idea is to ask: what is the marginal distribution of a single spin given all the others?
Step 1 (cavity field). Remove spin from an -spin equilibrium system. The field it receives from the remaining spins is
This is a sum of weakly correlated terms; by the central limit theorem it converges as to a Gaussian:
where is the self-overlap of the posterior. This Gaussian approximation is the cavity assumption; it becomes exact as due to the weak correlations between different spins.
Step 2 (self-consistency). Using the Nishimori identity , the self-consistent state evolution fixed-point equation is:
where the expectation is over and uniformly. This is a scalar equation in one unknown ; its fixed points and their stability determine whether the algorithm can recover the signal. The equation has the structure of a mean-field self-consistency equation — identical in spirit to those arising in continuum limits of interacting particle systems or mean-field PDEs.
From the Cavity Method to AMP¶
The cavity recursion suggests an iterative algorithm. Define the denoiser (posterior mean of given a Gaussian observation):
For the Ising prior, approximately. The naive iteration of cavity equations suffers from a feedback problem: spin ’s own influence returns through its neighbours, causing double-counting. Correcting for this with a first-order Taylor expansion gives the Onsager correction term, and collecting everything yields Approximate Message Passing (AMP):
The Onsager correction removes the self-feedback of each spin, restoring the validity of the cavity (Gaussian) approximation at each step. Without it the algorithm diverges; with it the trajectory is described exactly in the limit by the scalar state evolution recursion. This is a uniquely strong theoretical guarantee: in contrast to most iterative numerical methods where convergence analysis is approximate, AMP’s trajectory is provably tracked by a deterministic scalar map.
TAP equations. The fixed points of AMP are the solutions of the Thouless–Anderson–Palmer (TAP) equations Thouless et al. (1977):
These are the cavity-corrected mean-field equations; they coincide with the saddle-point equations of the replica calculation — a strong cross-check of both methods.
Low-Rank AMP for Clustering GMMs¶
The rank-one AMP extends straightforwardly to rank- asymmetric clustering by replacing scalars with length- vectors and matrices, giving the Low-rank AMP (Low-rAMP) algorithm of Lesieur et al. (2016). Low-rAMP achieves the Bayes-optimal MMSE and runs in time linear in the data size per iteration.
The Bethe Free Entropy¶
(Day 3 continuation.)
The cavity method gives fixed-point equations, but a single scalar potential — the Bethe free entropy — whose extremisation reproduces them also unlocks the full phase diagram.
Definition:
Derivation via telescoping. Write as a Cesàro mean of single-spin increments . By self-averaging, each increment has the same limiting value:
Using the CLT approximation for the cavity field and Stein’s lemma ( for ) to handle the disorder-average correction term , one arrives at the closed-form expression:
Extremising over (using from Nishimori) recovers the state evolution fixed-point equation. The Bethe free entropy is thus the potential function that AMP implicitly optimises — the analogue of a Lyapunov function for the iteration.
Phase Diagrams and Statistical-to-Computational Gaps¶
The Bethe free entropy as a function of can have multiple local maxima, corresponding to distinct fixed points of state evolution. The global structure determines the phase diagram.
For there is no hard phase: the IT and algorithmic thresholds coincide at . For three thresholds separate Lesieur et al. (2016):
The hard phase is the regime where:
The Bethe free entropy has a global maximum at a nontrivial (so Bayes-optimal recovery is possible).
But AMP initialised from converges to the trivial fixed point (failure to recover).
The hard phase is a statistical-to-computational gap: reconstruction is IT-possible but no known polynomial-time algorithm achieves it from an uninformative initialisation. This is believed (but not proved in general) to be a fundamental obstruction, not an artefact of AMP.
Analogy for PDE readers. Think of the Bethe free entropy landscape as the energy of a nonlinear system with multiple equilibria. The IT threshold is where a nontrivial equilibrium first appears (a saddle-node bifurcation). The algorithmic threshold is where the trivial equilibrium loses stability (a transcritical bifurcation). Between these two thresholds, both equilibria coexist: depending on initialisation, the system converges to one or the other.
- Thouless, D. J., Anderson, P. W., & Palmer, R. G. (1977). Solution of `Solvable Model of a Spin Glass’. Philosophical Magazine, 35(3), 593–601.
- Lesieur, T., Krzakala, F., & Zdeborová, L. (2016). Phase Transitions in Sparse PCA. ISIT 2016.
- Mézard, M., Parisi, G., & Virasoro, M. A. (1987). Spin Glass Theory and Beyond. World Scientific.