Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Lecture Notes
ICTP-INdAM-SLMath Summer Graduate School for Machine Learning, Trieste, 15–19 June 2026

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-nn 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 λspi<λIT<λalg\lambda_\text{spi} < \lambda_\text{IT} < \lambda_\text{alg}. Part 3 generalises to rank-rr 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:

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, nn (dimension) and mm (sample size) go to infinity with the rank r=O(1)r = \mathcal{O}(1) and the load α=m/n=O(1)\alpha = m/n = \mathcal{O}(1) fixed.

Generative Model

Following Lesieur et al. (2016), each data point is drawn as

xi=ρnVti+ui,tiUniform[r],VkN(0,In),uiN(0,In).x_i = \sqrt{\frac{\rho}{n}}\,V_{t_i} + u_i, \qquad t_i \sim \mathrm{Uniform}[r], \quad V_k \sim \mathcal{N}(0,I_n), \quad u_i \sim \mathcal{N}(0,I_n).

Here VkRnV_k \in \mathbb{R}^n is the (unknown) centroid of cluster kk, ti{1,,r}t_i \in \{1,\ldots,r\} is the (unknown) cluster assignment of point ii, and uiu_i is observation noise. The signal strength ρ\rho plays the role of an inverse noise level: larger ρ\rho means more separated centroids and easier clustering.

Reformulation as Low-Rank Matrix Factorisation

Pack the unknowns into a centroid matrix VRn×rV \in \mathbb{R}^{n \times r} (columns = centroids) and a one-hot assignment matrix S{0,1}m×rS \in \{0,1\}^{m \times r} (each row has exactly one 1). The observation matrix XRn×mX \in \mathbb{R}^{n \times m} is:

X=ρnVSrank-r signal+UnoiseRn×m.X = \sqrt{\frac{\rho}{n}}\underbrace{VS^\top}_{\text{rank-}r\text{ signal}} + \underbrace{U}_{\text{noise}} \in \mathbb{R}^{n\times m}.

This is a low-rank-plus-noise problem: recover VV and SS from a noisy rank-rr 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:

P(S,VX)=1Z(X)iPV(vi)jPS(sj)eH(S,V),P(S,V\mid X) = \frac{1}{\mathcal{Z}(X)}\prod_i P_V(\underline{v}_i)\prod_j P_S(\underline{s}_j)\,e^{\mathcal{H}(S,V)},

where H\mathcal{H} is the log-likelihood of observing XX given (S,V)(S,V) and Z(X)\mathcal{Z}(X) 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 ff:

Ex,y[fy(x)]=Ex,y[fy(x)](Bayes-optimal),\mathbb{E}_{x^*,y}\big[f_y(x^*)\big] = \mathbb{E}_{x,y}\big[f_y(x)\big] \qquad \text{(Bayes-optimal),}

where xx^* is the true signal and xx 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,

m=q(Bayes-optimal).m = q \qquad \text{(Bayes-optimal).}

In the replica language of Lecture 1, this collapses the two order parameters mm and qq into one, substantially simplifying the saddle-point equations. It is analogous to a symmetry that collapses the PDE system from order 2n2n to order nn.

From Clustering to the Sherrington–Kirkpatrick Model

For r=1r = 1 the observation matrix is symmetric and the problem reduces to the spiked Wigner model:

Y=λnxx+ξ,xRn,ξij=ξjiiidN(0,1).Y = \sqrt{\frac{\lambda}{n}}\,\underline{x}\,\underline{x}^\top + \xi, \qquad \underline{x}\in\mathbb{R}^n, \quad \xi_{ij}=\xi_{ji}\overset{\text{iid}}{\sim}\mathcal{N}(0,1).

With an Ising (±1\pm 1) prior PX(xi)=12(δxi,1+δxi,1)P_X(x_i) = \frac{1}{2}(\delta_{x_i,1}+\delta_{x_i,-1}), so xi2=1x_i^2 = 1, the posterior Hamiltonian reduces to

H(x)=λni<jYijxixj,\mathcal{H}(\underline{x}) = \sqrt{\frac{\lambda}{n}}\sum_{i<j}Y_{ij}\,x_i x_j,

which is precisely the planted Sherrington–Kirkpatrick (SK) Hamiltonian — a disordered ferromagnet with couplings JijYijJ_{ij} \propto Y_{ij} that contain a hidden rank-one signal λ/nxixj\sqrt{\lambda/n}\,x_i^*x_j^* 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 x0x_0 given all the others?

Step 1 (cavity field). Remove spin x0x_0 from an nn-spin equilibrium system. The field it receives from the remaining spins is

λniJ0ixi.\sqrt{\frac{\lambda}{n}}\sum_i J_{0i}\,x_i.

This is a sum of n1n-1 weakly correlated terms; by the central limit theorem it converges as nn\to\infty to a Gaussian:

λniξ0ixi    λq  z,zN(0,1),\sqrt{\frac{\lambda}{n}}\sum_i \xi_{0i}\,x_i \;\rightsquigarrow\; \sqrt{\lambda q}\;z, \qquad z\sim\mathcal{N}(0,1),

where q=1nixi2q = \frac{1}{n}\sum_i \langle x_i \rangle^2 is the self-overlap of the posterior. This Gaussian approximation is the cavity assumption; it becomes exact as nn \to \infty due to the weak correlations between different spins.

Step 2 (self-consistency). Using the Nishimori identity m=qm = q, the self-consistent state evolution fixed-point equation is:

m=Ez,x0 ⁣[tanh ⁣(λmz+λmx0)x0],m = \mathbb{E}_{z,x_0^*}\!\left[\tanh\!\left(\sqrt{\lambda m}\,z + \lambda m\,x_0^*\right)\,x_0^*\right],

where the expectation is over zN(0,1)z \sim \mathcal{N}(0,1) and x0=±1x_0^* = \pm 1 uniformly. This is a scalar equation in one unknown m[0,1]m \in [0,1]; 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 xx given a Gaussian observation):

η(A,B)=dxPX(x)xeA2x2+BxdxPX(x)eA2x2+Bx.\eta(A,B) = \frac{\int dx\,P_X(x)\,x\,e^{-\frac{A}{2}x^2+Bx}}{\int dx\,P_X(x)\,e^{-\frac{A}{2}x^2+Bx}}.

For the Ising prior, η(A,B)=tanh(B)/(1+Atanh(B)2)\eta(A,B) = \tanh(B)/(1 + A\tanh(B)^2) approximately. The naive iteration of cavity equations suffers from a feedback problem: spin ii’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):

{ht=λnYxtλ ⁣(1niηi)Onsager correctionxt1,xt+1=η ⁣(λnxtxt,  ht).\begin{cases} \underline{h}^t = \sqrt{\dfrac{\lambda}{n}}\,Y\,\underline{x}^t - \underbrace{\lambda\!\left(\dfrac{1}{n}\sum_i\eta_i'\right)}_{\text{Onsager correction}}\underline{x}^{t-1}, \\[3mm] \underline{x}^{t+1} = \eta\!\left(\dfrac{\lambda}{n}\underline{x}^t\cdot\underline{x}^t,\;\underline{h}^t\right). \end{cases}

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 nn \to \infty 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):

xiη ⁣(λnjixj2,  λnjiYijxj).\langle x_i\rangle \approx \eta\!\left(\frac{\lambda}{n}\sum_{j\neq i}\langle x_j^2\rangle,\;\sqrt{\frac{\lambda}{n}}\sum_{j\neq i}Y_{ij}\langle x_j\rangle\right).

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-rr asymmetric clustering by replacing scalars with length-rr 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:

ϕB=limnE ⁣[1nlogZn].\phi_B = \lim_{n\to\infty}\mathbb{E}\!\left[\frac{1}{n}\log Z_n\right].

Derivation via telescoping. Write 1nlogZn\frac{1}{n}\log Z_n as a Cesàro mean of single-spin increments log(Zi/Zi1)\log(Z_i/Z_{i-1}). By self-averaging, each increment has the same limiting value:

ϕB=limnE ⁣[logZnZn1].\phi_B = \lim_{n\to\infty}\mathbb{E}\!\left[\log\frac{Z_n}{Z_{n-1}}\right].

Using the CLT approximation for the cavity field and Stein’s lemma (E[g(Z)Z]=E[g(Z)]\mathbb{E}[g(Z)Z] = \mathbb{E}[g'(Z)] for ZN(0,1)Z \sim \mathcal{N}(0,1)) to handle the disorder-average correction term E[ξijxixj]=E[xi2xj2xixj2]\mathbb{E}[\xi_{ij}\langle x_i x_j\rangle] = \mathbb{E}[\langle x_i^2 x_j^2\rangle - \langle x_i x_j\rangle^2], one arrives at the closed-form expression:

ϕB=λ4m2λ4q2Ez,x0 ⁣[logdx0PX(x0)exp ⁣(λmx0x0λ2x02+λqx0z)].\boxed{\phi_B = \frac{\lambda}{4}m^2 - \frac{\lambda}{4}q^2 - \mathbb{E}_{z,x_0^*}\!\left[\log\int dx_0\,P_X(x_0)\,\exp\!\left(\lambda m\,x_0 x_0^* - \tfrac{\lambda}{2}x_0^2 + \sqrt{\lambda q}\,x_0\,z\right)\right].}

Extremising ϕB\phi_B over mm (using m=qm = q 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 mm can have multiple local maxima, corresponding to distinct fixed points of state evolution. The global structure determines the phase diagram.

For r<rc=4+2αr < r_c = 4 + 2\alpha there is no hard phase: the IT and algorithmic thresholds coincide at ρc(α,r)=r/α\rho_c(\alpha,r) = r/\alpha. For r>rcr > r_c three thresholds separate Lesieur et al. (2016):

ρIT(α,r)=2rlogrα(1+or(1)),ρc(α,r)=rα,ρsp(α,r)=2rlogrα(1+or(1)).\rho_\text{IT}(\alpha,r) = \frac{2r\log r}{\alpha}(1+o_r(1)), \qquad \rho_c(\alpha,r) = \frac{r}{\alpha}, \qquad \rho_\text{sp}(\alpha,r) = \frac{2r\log r}{\alpha}(1+o_r(1)).

The hard phase ρIT<ρ<ρc\rho_\text{IT} < \rho < \rho_c is the regime where:

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.

References
  1. Thouless, D. J., Anderson, P. W., & Palmer, R. G. (1977). Solution of `Solvable Model of a Spin Glass’. Philosophical Magazine, 35(3), 593–601.
  2. Lesieur, T., Krzakala, F., & Zdeborová, L. (2016). Phase Transitions in Sparse PCA. ISIT 2016.
  3. Mézard, M., Parisi, G., & Virasoro, M. A. (1987). Spin Glass Theory and Beyond. World Scientific.