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

Feature Learning in Two-Layer Networks: Weak Recovery and the Generative Exponent

ICTP Summer School on Machine Learning — Lecture 7 (Day 9, Morning)

These notes cover the second lecture of Day 9 by Andrea Montanari. We ask when a two-layer network trained by (stochastic) gradient descent can learn the single-index model y=φ(w∗⊤x)y = \varphi(w_*^\top x) in polynomial time with n=O~(d)n = \tilde O(d) samples. The mean field theory (MFT) provides a sharp separation from the NTK regime: while Rademacher complexity remains small along MFT dynamics, it blows up in the NTK regime. The lecture introduces the generative exponent k∗k_* of a link function φ\varphi and proves that: (a) weak recovery requires n≥Ω(dk∗/2)n \geq \Omega(d^{k_*/2}) for any efficient algorithm (lower bound from SQ/LDP hardness), and (b) a computationally efficient algorithm achieving weak recovery with n=O~(dk∗/2)n = \tilde O(d^{k_*/2}) is given by a degree-k∗k_* preprocessing estimator, as proved in Damian et al. (2024).

MFT vs. NTK: Rademacher Complexity

We begin with a structural observation that sharpens the NTK/feature-learning distinction.

In mean field theory (MFT), the Rademacher complexity Rdn(Ft)\mathrm{Rd}_n(\mathcal{F}_t) — where Ft\mathcal{F}_t is the function class at time tt — stays small (=O(1)= O(1)) on times t=O(1)t = O(1). This is because in MFT the mean field potential Ψ(θ;ρt)\Psi(\theta;\rho_t) has a small number of effective degrees of freedom (essentially 1, by the symmetry reduction for the single-index model), and the Barron norm ∥ft∥σ\|f_t\|_\sigma remains bounded.

In the NTK regime, however, as we showed via the GMMM theorem (Lecture 6), Rdn(F)≥cσ>0\mathrm{Rd}_n(\mathcal{F}) \geq c\sigma > 0 when the network class can overfit. The Rademacher bound does not vanish.

This distinction is the precise sense in which MFT enables generalization that NTK cannot: the effective complexity of the hypothesis class stays controlled throughout training.

Case Study: Single-Index Model

We focus on the single-index model yi=φ(⟨w∗,xi⟩)+εiy_i = \varphi(\langle w_*,x_i\rangle) + \varepsilon_i with xi∼N(0,Id)x_i \sim \mathcal{N}(0,I_d), εi∼N(0,τ2)\varepsilon_i \sim \mathcal{N}(0,\tau^2), and ask: can a two-layer network f(x;θ)=1m∑k=1makσ(wk⊤x)f(x;\theta) = \frac{1}{m}\sum_{k=1}^m a_k\sigma(w_k^\top x) learn this model efficiently?

Three approaches and their sample complexities:

The answer depends on the link function φ\varphi via the generative exponent defined below. By the results of Damian et al. (2024), there is a polynomial-time algorithm achieving weak recovery when n≥O~(dk∗/2)n \geq \tilde O(d^{k_*/2}), and no efficient algorithm can do better.


Weak Recovery and the Generative Exponent

Definition

Equivalently, k∗k_* is the index of the first nonzero Hermite coefficient λk=E[φ(G)Hek(G)]\lambda_k = \mathbb{E}[\varphi(G)\mathrm{He}_k(G)] of φ\varphi: k∗=inf⁡{k:λk≠0}k_* = \inf\{k : \lambda_k \neq 0\}.

Note: λ1=E[φ(G)G]\lambda_1 = \mathbb{E}[\varphi(G)G] (the Stein coefficient), so k∗=1k_* = 1 iff E[φ(G)G]≠0\mathbb{E}[\varphi(G)G] \neq 0.

Examples:

The Weak Recovery Problem

Weak recovery means finding w^\hat w such that ∣⟨w^,w∗⟩∣≥ε>0|\langle\hat w, w_*\rangle| \geq \varepsilon > 0 (non-trivial correlation with w∗w_*) with high probability. It is a necessary first step toward full estimation.

Goal: construct an efficient estimator achieving weak recovery using n=O~(dk∗/2)n = \tilde O(d^{k_*/2}) samples.

Why k∗/2k_*/2? As we will see, the natural preprocessing statistics live in (Rd)⊗k∗(\mathbb{R}^d)^{\otimes k_*} (a tensor of order k∗k_*), which has dk∗d^{k_*} entries. Estimating a rank-1 tensor from nn samples by a spectral method requires n≫dk∗/2n \gg d^{k_*/2} (the threshold for a Wishart-type matrix with dk∗/2×dk∗/2d^{k_*/2} \times d^{k_*/2} structure).


Weak Recovery Idea #1: Score Function (Preprocessing)

Linear Preprocessing (k∗=1k_* = 1)

When k∗=1k_* = 1, i.e. λ1=E[YG]≠0\lambda_1 = \mathbb{E}[Y G] \neq 0, the estimator

w~=1n∑i=1nyixi,w^=w~∥w~∥,\tilde w = \frac{1}{n}\sum_{i=1}^n y_i x_i, \quad \hat w = \frac{\tilde w}{\|\tilde w\|},

achieves weak recovery. Its expectation is Ew~=E[yx]=E[φ(w∗⊤x) x]=λ1w∗\mathbb{E}\tilde w = \mathbb{E}[yx] = \mathbb{E}[\varphi(w_*^\top x)\,x] = \lambda_1 w_* (by Stein’s lemma E[xh(w⊤x)]=E[h′(w⊤x)]w\mathbb{E}[xh(w^\top x)] = \mathbb{E}[h'(w^\top x)]w). The variance is E∥w~−λ1w∗∥2=1nE[∥yx∥2]≤Cdn\mathbb{E}\|\tilde w - \lambda_1 w_*\|^2 = \frac{1}{n}\mathbb{E}[\|yx\|^2] \leq \frac{Cd}{n}, so ∥w^−w∗∥=O(d/n)\|\hat w - w_*\| = O(\sqrt{d/n}) and weak recovery holds for n/dn/d bounded away from 0 (proposition-feature-learning in Lecture 6).

Failure case: k∗≥2k_* \geq 2, which happens when E[YG]=0\mathbb{E}[YG] = 0, i.e. when φ\varphi is an even function or more generally has no odd-degree component in its Hermite expansion. The prototype is phase retrieval where φ(u)=u2\varphi(u) = u^2.

General Preprocessing: Optimizing the Linear Functional

To handle k∗≥2k_* \geq 2, one replaces yy by a preprocessed label T(y)T(y). The estimator becomes

w~=1n∑i=1nT(yi) xi,w^=w~∥w~∥.\tilde w = \frac{1}{n}\sum_{i=1}^n T(y_i)\,x_i, \quad \hat w = \frac{\tilde w}{\|\tilde w\|}.

The expectation is E[w~]=E[T(Y)X]=E[T(Y)E[G∣Y]] w∗=λ1(T) w∗\mathbb{E}[\tilde w] = \mathbb{E}[T(Y)X] = \mathbb{E}[T(Y)\mathbb{E}[G|Y]]\,w_* = \lambda_1(T)\,w_* where λ1(T)=E[T(Y)G]\lambda_1(T) = \mathbb{E}[T(Y)G]. This is non-zero iff E[T(Y)G]≠0\mathbb{E}[T(Y)G] \neq 0, i.e. iff TT is not orthogonal to E[G∣Y]\mathbb{E}[G|Y].

Optimal choice (the Preprocessing Trick): maximize E[T(Y)G]\mathbb{E}[T(Y)G] subject to E[T(Y)2]=1\mathbb{E}[T(Y)^2] = 1. By Cauchy–Schwarz:

E[T(Y)G]=E[T(Y)E[G∣Y]]≤(E[T(Y)2])1/2(E[E[G∣Y]2])1/2=λ1(T)opt1/2,\mathbb{E}[T(Y)G] = \mathbb{E}[T(Y)\mathbb{E}[G|Y]] \leq (\mathbb{E}[T(Y)^2])^{1/2}\big(\mathbb{E}[\mathbb{E}[G|Y]^2]\big)^{1/2} = \lambda_1(T)_\mathrm{opt}^{1/2},

with equality at T(y)=E[G∣Y=y]T(y) = \mathbb{E}[G|Y=y] (normalized).

Works iff k∗=1k_* = 1: The optimal preprocessing works iff λ1=E[E[G∣Y]2]>0\lambda_1 = \mathbb{E}[\mathbb{E}[G|Y]^2] > 0, i.e. iff P(E[G∣Y]=0)<1\mathbb{P}(\mathbb{E}[G|Y] = 0) < 1. This fails precisely when E[G∣Y]=0\mathbb{E}[G|Y] = 0 a.s., which happens when φ\varphi is even (e.g. phase retrieval: φ(u)=u2\varphi(u) = u^2 means Y=G2+εY = G^2 + \varepsilon, so E[G∣Y=y]=0\mathbb{E}[G|Y=y] = 0 since GG and −G-G are exchangeable given YY).


Weak Recovery Idea #2: Second-Moment Matrix

When k∗=2k_* = 2: Second-Moment Estimator

For k∗=2k_* = 2 (i.e. λ1=0\lambda_1 = 0 but λ2=E[φ(G)He2(G)]=E[φ(G)(G2−1)]≠0\lambda_2 = \mathbb{E}[\varphi(G)\mathrm{He}_2(G)] = \mathbb{E}[\varphi(G)(G^2-1)] \neq 0), consider the empirical second-moment matrix:

M^=1n∑i=1nyi xixi⊤∈Rd×d,w^=v1(M^) (leading eigenvector).\hat M = \frac{1}{n}\sum_{i=1}^n y_i\,x_i x_i^\top \in \mathbb{R}^{d\times d}, \quad \hat w = v_1(\hat M) \text{ (leading eigenvector)}.

Population mean: Using y=φ(w∗⊤x)y = \varphi(w_*^\top x) and x=gw∗+x⊥x = g w_* + x^\perp with g=w∗⊤x∼N(0,1)g = w_*^\top x \sim \mathcal{N}(0,1) and x⊥⊥w∗x^\perp \perp w_*:

M=E[M^]=E[φ(w∗⊤x) xx⊤]=E[φ(g) xx⊤].M = \mathbb{E}[\hat M] = \mathbb{E}[\varphi(w_*^\top x)\,xx^\top] = \mathbb{E}[\varphi(g)\,xx^\top].

Computing: E[φ(g)xjxk]=E[φ(g)(gw∗j+xj⊥)(gw∗k+xk⊥)]\mathbb{E}[\varphi(g) x_j x_k] = \mathbb{E}[\varphi(g)(gw_{*j} + x_j^\perp)(gw_{*k}+x_k^\perp)]. Cross terms vanish by independence, and E[φ(g)xj⊥xk⊥]=E[φ(g)]δjk\mathbb{E}[\varphi(g)x_j^\perp x_k^\perp] = \mathbb{E}[\varphi(g)]\delta_{jk} (since x⊥⊥gx^\perp \perp g). Therefore:

M=E[φ(G)] I+E[φ(G)G2] w∗w∗⊤=E[φ(G)]⏟=c I+E[φ′′(G)]⏟=λ2 w∗w∗⊤,M = \mathbb{E}[\varphi(G)]\,I + \mathbb{E}[\varphi(G)G^2]\,w_*w_*^\top = \underbrace{\mathbb{E}[\varphi(G)]}_{=c}\,I + \underbrace{\mathbb{E}[\varphi''(G)]}_{=\lambda_2}\,w_*w_*^\top,

where the second step uses E[φ(G)G2]=E[φ(G)He2(G)]+E[φ(G)]=λ2+c\mathbb{E}[\varphi(G)G^2] = \mathbb{E}[\varphi(G)\mathrm{He}_2(G)] + \mathbb{E}[\varphi(G)] = \lambda_2 + c, giving EM^=cI+λ2w∗w∗⊤\mathbb{E}\hat M = cI + \lambda_2 w_*w_*^\top. (Here λ2=E[φ′′(G)]=E[φ(G)He2(G)]\lambda_2 = \mathbb{E}[\varphi''(G)] = \mathbb{E}[\varphi(G)\mathrm{He}_2(G)] by integration by parts.)

So M=cI+λ2w∗w∗⊤M = cI + \lambda_2 w_*w_*^\top is a rank-1 perturbation of a multiple of the identity. The leading eigenvector is w∗w_* (assuming λ2≠0\lambda_2 \neq 0).

Concentration: M^−M=1n∑i=1nZi\hat M - M = \frac{1}{n}\sum_{i=1}^n Z_i where Zi=yixixi⊤−MZ_i = y_ix_ix_i^\top - M are i.i.d. mean-zero. By an ε\varepsilon-net argument (high-dimensional probability, HDP):

∥M^−M∥op≤Cdnw.h.p.\|\hat M - M\|_\mathrm{op} \leq C\sqrt{\frac{d}{n}} \quad \text{w.h.p.}

By Davis–Kahan (eigenvalue perturbation), ∥v1(M^)−v1(M)∥≤Cd/n/∣λ2∣\|v_1(\hat M) - v_1(M)\| \leq C\sqrt{d/n}/|\lambda_2|, giving weak recovery whenever n/d≥c0n/d \geq c_0 for c0c_0 sufficiently large. Note: if λ1=0\lambda_1 = 0 (i.e. k∗≥2k_* \geq 2) and n/d<c1n/d < c_1, then weak recovery via the second-moment method is impossible — a sharp threshold.

WLOG Reduction

WLOG assume w∗=e1w_* = e_1 and define g=⟨x,e1⟩=Xe1g = \langle x, e_1\rangle = X e_1 (first coordinate). Then X=[g∣X~]nX = [g \mid \tilde X]^n where X~∈Rn×(d−1)\tilde X \in \mathbb{R}^{n\times(d-1)} is independent of gg, and

M^=1nX⊤DX,D=diag(y1,…,yn).\hat M = \frac{1}{n}X^\top D X, \qquad D = \mathrm{diag}(y_1,\ldots,y_n).

This is a rank-2 + Wishart structure: M^≈λ2n(Xe1)(Xe1)⊤+W\hat M \approx \frac{\lambda_2}{n}(Xe_1)(Xe_1)^\top + W where W=1nX~⊤DX~W = \frac{1}{n}\tilde X^\top D\tilde X is approximately a Wishart matrix (spectrum of a low-rank perturbation of a random matrix) — a classical problem in random matrix theory.


The Generative Exponent and the Damian et al. Theorem

General k∗k_*: Degree-k∗k_* Tensor Preprocessing

For general k∗k_*, neither linear nor second-moment preprocessing works. The key idea is to preprocess with a degree-k∗k_* statistic.

Define the empirical degree-k∗k_* tensor:

T^=1n∑i=1nyi Hek∗(xi)∈(Rd)⊗k∗,\hat T = \frac{1}{n}\sum_{i=1}^n y_i\,\mathrm{He}_{k_*}(x_i) \in (\mathbb{R}^d)^{\otimes k_*},

where Hek∗(x)\mathrm{He}_{k_*}(x) denotes the k∗k_*-th Hermite tensor: Qk∗(x)i1,…,ik∗=xi1⋯xik∗Q_{k_*}(x)_{i_1,\ldots,i_{k_*}} = x_{i_1}\cdots x_{i_{k_*}} (symmetrized monomial), with Hek∗\mathrm{He}_{k_*} obtained by orthogonalizing Q0,Q1,…,Qk∗−1Q_0, Q_1, \ldots, Q_{k_*-1} (Gram–Schmidt), giving He0=Q0\mathrm{He}_0 = Q_0, He1=Q1\mathrm{He}_1 = Q_1, Hek=Qk−lower order terms\mathrm{He}_k = Q_k - \text{lower order terms}.

The expectation is ET^=λk∗w∗⊗k∗\mathbb{E}\hat T = \lambda_{k_*} w_*^{\otimes k_*}, a rank-1 tensor proportional to w∗⊗k∗w_*^{\otimes k_*}, since all lower Hermite coefficients λ1=⋯=λk∗−1=0\lambda_1 = \cdots = \lambda_{k_*-1} = 0 by definition of k∗k_*.

Partial trace: For k∗k_* even, extract w∗w_* by taking the partial trace. Define the contracted matrix

M^(k∗)=T^[I⊗(k∗/2−1)],M^ij(k∗)=∑i1,…,ik∗−1T^j,i1,i1,i2,i2,…,ik∗/2−1,ik∗/2−1.\hat M^{(k_*)} = \hat T[I^{\otimes(k_*/2-1)}], \quad \hat M^{(k_*)}_{ij} = \sum_{i_1,\ldots,i_{k_*-1}}\hat T_{j,i_1,i_1,i_2,i_2,\ldots,i_{k_*/2-1},i_{k_*/2-1}}.

Then EM^(k∗)=λk∗w∗w∗⊤\mathbb{E}\hat M^{(k_*)} = \lambda_{k_*} w_*w_*^\top (a rank-1 matrix), and w^=v1(M^(k∗))\hat w = v_1(\hat M^{(k_*)}) achieves weak recovery.

The key quantity is ET^=λk∗w∗⊗k∗\mathbb{E}\hat T = \lambda_{k_*} w_*^{\otimes k_*}. Note: the ideal estimator would be w^=arg max⁡{⟨T^,w⊗k∗⟩:∥w∥=1}\hat w = \operatorname*{arg\,max}\{\langle\hat T, w^{\otimes k_*}\rangle : \|w\| = 1\}, the best rank-1 approximation to T^\hat T, but this is NP-hard in general (tensor PCA is hard for k≥3k \geq 3). The partial-trace method sidesteps this by reducing to a matrix spectral problem at the cost of a d\sqrt{d} factor in the sample complexity.

Two-Layer Network Implementation

Can a two-layer net implement this efficiently? Here is a gradient-based algorithm:

  1. One step of GD on the network risk R^n(a,w)\hat R_n(a,w) with respect to ww, starting from a random initialization where wi=ciw∗+wi⊥w_i = c_i w_* + w_i^\perp (unknown):

∇wR^n(w)=1n∑i=1nℓ′(yi;⟨w,xi⟩) xi.\nabla_w\hat R_n(w) = \frac{1}{n}\sum_{i=1}^n \ell'(y_i;\langle w,x_i\rangle)\,x_i.

After one GD step: the weights move in the direction wi←ciw∗+wi⊥+signal⋅w∗w_i \leftarrow c_i w_* + w_i^\perp + \text{signal} \cdot w_*, where the signal comes from 1m∑iai∇wiR^n\frac{1}{m}\sum_i a_i\nabla_{w_i}\hat R_n.

  1. Freeze wiw_i and minimize R^n\hat R_n over aia_i (a linear regression): ϕ(x)=(σ(w1⊤x),…,σ(wm⊤x))⊤\phi(x) = (\sigma(w_1^\top x),\ldots,\sigma(w_m^\top x))^\top, giving the “one-step” kernel Km(1step)(x1,x2)=1m∑iσ(wi⊤x1)σ(wi⊤x2)K_m^{(1\mathrm{step})}(x_1,x_2) = \frac{1}{m}\sum_i\sigma(w_i^\top x_1)\sigma(w_i^\top x_2).

The key observation: ∥f∗∥Km(1step)≪∥f∗∥Km(0step)\|f_*\|_{K_m^{(1\mathrm{step})}} \ll \|f_*\|_{K_m^{(0\mathrm{step})}} (the RKHS norm of f∗f_* in the one-step kernel is much smaller than in the zero-step/NTK kernel), meaning f∗f_* is easier to approximate in the learned kernel than the random one.

First gradient step gradient:

∇R^n(w0)=1n∑i=1nℓ′(yi; w0⊤xi) xi,ℓ(y;z)=(y−σ(z))2,\nabla\hat R_n(w_0) = \frac{1}{n}\sum_{i=1}^n \ell'(y_i;\,w_0^\top x_i)\,x_i, \quad \ell(y;z) = (y-\sigma(z))^2,

so ℓ′(yi;w0⊤xi)=Ti(yi)\ell'(y_i;w_0^\top x_i) = T_i(y_i) evaluated at the current prediction, which is exactly the preprocessing function! As w0⊤xi≈0w_0^\top x_i \approx 0 at initialization, Ti(yi)=ℓ′(yi;0)∝(yi−σ(0))T_i(y_i) = \ell'(y_i;0) \propto (y_i - \sigma(0)), giving the degree-1 preprocessing. For higher k∗k_*, one applies k∗−1k_*-1 preprocessing steps to extract the generative exponent.


Gradient and Hessian of the Single-Neuron Risk

The analysis above connects to the gradient and Hessian of the single-neuron empirical risk

R^n(w)=1n∑i=1nℓ(yi; w⊤xi),e.g.  ℓ(y;z)=(y−σ(z))2.\hat R_n(w) = \frac{1}{n}\sum_{i=1}^n \ell(y_i;\,w^\top x_i), \quad e.g.\; \ell(y;z) = (y-\sigma(z))^2.

At w=w0w = w_0, the gradient and Hessian are

∇R^n(w0)=1n∑i=1nℓ′(yi; w0⊤xi)⏟=:Ti(yi) xi,\nabla\hat R_n(w_0) = \frac{1}{n}\sum_{i=1}^n \underbrace{\ell'(y_i;\,w_0^\top x_i)}_{=:T_i(y_i)}\,x_i,
∇2R^n(w0)=1n∑i=1nℓ′′(yi; w0⊤xi)⏟=:Ti(yi) xixi⊤.\nabla^2\hat R_n(w_0) = \frac{1}{n}\sum_{i=1}^n \underbrace{\ell''(y_i;\,w_0^\top x_i)}_{=:T_i(y_i)}\,x_ix_i^\top.

Both have the form of a weighted sum of outer products, where the weights Ti(yi)=ℓ′(yi;w0⊤xi)T_i(y_i) = \ell'(y_i; w_0^\top x_i) are label-dependent preprocessings. This connects the gradient step to the preprocessing trick: one step of GD at initialization w0w_0 with w0⊤xi≈0w_0^\top x_i \approx 0 produces the estimator w~=∇R^n(w0)\tilde w = \nabla\hat R_n(w_0), which is exactly the linear preprocessing estimator 1n∑iTi(yi)xi\frac{1}{n}\sum_i T_i(y_i) x_i for Ti(y)=ℓ′(y;0)T_i(y) = \ell'(y;0).

For the square loss with σ=ReLU\sigma = \mathrm{ReLU}: T(y)=−(y−0+)=−yT(y) = -(y - 0^+) = -y (up to a constant), recovering w~∝1n∑iyixi\tilde w \propto \frac{1}{n}\sum_i y_i x_i, which is the Stein estimator when λ1≠0\lambda_1 \neq 0.

References
  1. Damian, A., Pillaud-Vivien, L., Lee, J. D., & Bruna, J. (2024). Computational-statistical gaps in Gaussian single-index models. Proceedings of the 37th Annual Conference on Learning Theory, 1262–1262.