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=φ(wx)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 kk_* 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-kk_* 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 xiN(0,Id)x_i \sim \mathcal{N}(0,I_d), εiN(0,τ2)\varepsilon_i \sim \mathcal{N}(0,\tau^2), and ask: can a two-layer network f(x;θ)=1mk=1makσ(wkx)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 nO~(dk/2)n \geq \tilde O(d^{k_*/2}), and no efficient algorithm can do better.


Weak Recovery and the Generative Exponent

Definition

Equivalently, kk_* 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:λk0}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 ww_*) 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 kk_*), which has dkd^{k_*} entries. Estimating a rank-1 tensor from nn samples by a spectral method requires ndk/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~=1ni=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[φ(wx)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(wx)]=E[h(wx)]w\mathbb{E}[xh(w^\top x)] = \mathbb{E}[h'(w^\top x)]w). The variance is Ew~λ1w2=1nE[yx2]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: k2k_* \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 k2k_* \geq 2, one replaces yy by a preprocessed label T(y)T(y). The estimator becomes

w~=1ni=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[GY]]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[GY]\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[GY]](E[T(Y)2])1/2(E[E[GY]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[GY=y]T(y) = \mathbb{E}[G|Y=y] (normalized).

Works iff k=1k_* = 1: The optimal preprocessing works iff λ1=E[E[GY]2]>0\lambda_1 = \mathbb{E}[\mathbb{E}[G|Y]^2] > 0, i.e. iff P(E[GY]=0)<1\mathbb{P}(\mathbb{E}[G|Y] = 0) < 1. This fails precisely when E[GY]=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[GY=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)(G21)]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^=1ni=1nyixixiRd×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=φ(wx)y = \varphi(w_*^\top x) and x=gw+xx = g w_* + x^\perp with g=wxN(0,1)g = w_*^\top x \sim \mathcal{N}(0,1) and xwx^\perp \perp w_*:

M=E[M^]=E[φ(wx)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)(gwj+xj)(gwk+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)xjxk]=E[φ(g)]δjk\mathbb{E}[\varphi(g)x_j^\perp x_k^\perp] = \mathbb{E}[\varphi(g)]\delta_{jk} (since xgx^\perp \perp g). Therefore:

M=E[φ(G)]I+E[φ(G)G2]ww=E[φ(G)]=cI+E[φ(G)]=λ2ww,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+λ2ww\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+λ2wwM = cI + \lambda_2 w_*w_*^\top is a rank-1 perturbation of a multiple of the identity. The leading eigenvector is ww_* (assuming λ20\lambda_2 \neq 0).

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

M^MopCdnw.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/dc0n/d \geq c_0 for c0c_0 sufficiently large. Note: if λ1=0\lambda_1 = 0 (i.e. k2k_* \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=[gX~]nX = [g \mid \tilde X]^n where X~Rn×(d1)\tilde X \in \mathbb{R}^{n\times(d-1)} is independent of gg, and

M^=1nXDX,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 kk_*: Degree-kk_* Tensor Preprocessing

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

Define the empirical degree-kk_* tensor:

T^=1ni=1nyiHek(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 kk_*-th Hermite tensor: Qk(x)i1,,ik=xi1xikQ_{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,,Qk1Q_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=Qklower order terms\mathrm{He}_k = Q_k - \text{lower order terms}.

The expectation is ET^=λkwk\mathbb{E}\hat T = \lambda_{k_*} w_*^{\otimes k_*}, a rank-1 tensor proportional to wkw_*^{\otimes k_*}, since all lower Hermite coefficients λ1==λk1=0\lambda_1 = \cdots = \lambda_{k_*-1} = 0 by definition of kk_*.

Partial trace: For kk_* even, extract ww_* by taking the partial trace. Define the contracted matrix

M^(k)=T^[I(k/21)],M^ij(k)=i1,,ik1T^j,i1,i1,i2,i2,,ik/21,ik/21.\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)=λkww\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^=λkwk\mathbb{E}\hat T = \lambda_{k_*} w_*^{\otimes k_*}. Note: the ideal estimator would be w^=arg max{T^,wk: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 k3k \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+wiw_i = c_i w_* + w_i^\perp (unknown):

wR^n(w)=1ni=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 wiciw+wi+signalww_i \leftarrow c_i w_* + w_i^\perp + \text{signal} \cdot w_*, where the signal comes from 1miaiwiR^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)=(σ(w1x),,σ(wmx))\phi(x) = (\sigma(w_1^\top x),\ldots,\sigma(w_m^\top x))^\top, giving the “one-step” kernel Km(1step)(x1,x2)=1miσ(wix1)σ(wix2)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: fKm(1step)fKm(0step)\|f_*\|_{K_m^{(1\mathrm{step})}} \ll \|f_*\|_{K_m^{(0\mathrm{step})}} (the RKHS norm of ff_* in the one-step kernel is much smaller than in the zero-step/NTK kernel), meaning ff_* is easier to approximate in the learned kernel than the random one.

First gradient step gradient:

R^n(w0)=1ni=1n(yi;w0xi)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;w0xi)=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 w0xi0w_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 kk_*, one applies k1k_*-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)=1ni=1n(yi;wxi),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)=1ni=1n(yi;w0xi)=: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)=1ni=1n(yi;w0xi)=: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;w0xi)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 w0xi0w_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 1niTi(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)=(y0+)=yT(y) = -(y - 0^+) = -y (up to a constant), recovering w~1niyixi\tilde w \propto \frac{1}{n}\sum_i y_i x_i, which is the Stein estimator when λ10\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.