Theoretical accounts attribute much of the success of deep neural networks to feature learning, in which training reshapes the representations within hidden layers. In this picture, a theory of deep learning must explain which features a nonlinear network learns, how its weights encode them, and how its neurons represent them. Yet, we still lack a general theory that answers these questions.

We study this question as part of PIRAMID’s Advancements in Learning Theory team, which uses statistical physics to build foundations for mechanistic interpretability and AI safety. Our progress and plans describe a theory agenda centred on hidden weight distributions and covariances that can record learned structure. The mean field sequence introduces this viewpoint by treating each neuron as one member of a population whose distribution must be self consistent. Statistical physics lets us connect the behavior of many interacting neurons with quantities describing the network as a whole, including its hidden weight distribution and prediction error.

We consider toy and solvable models to be important signposts on the road to a comprehensive scientific understanding of feature learning and generalization. When these models are built to the standard of statistical physics, they come with precise regimes of validity, error bounds, and universality classes. This makes it easier to say which conclusions carry over to real models and which should not. Rubin and collaborators give a compelling example of this in a nonlinear network, which we consider to be foundational for developing a more general theory of learned representations. In their solvable setting, they derive the hidden weight distribution and its covariance, with an explicit phase transition that signals a change in the hidden representation connected to improved generalization. We draw on their 2024 study of a feature learning transition and their 2025 theory of adaptive feature learning.

Working through these calculations by hand helped us develop a gears-level understanding of how the theory is built. We could see why the authors study particular quantities, which approximations make the calculation possible, and how the conclusions follow. Working through the calculations also shows where we can build on the model to develop a richer understanding. We wrote this post to share that understanding with readers who have no statistical physics background, and to provide context for recent (arXiv) work (arXiv). Instead of the mathematically heavy adaptive field theory machinery of the original papers, we use a simpler cavity derivation that studies one neuron at a time, tracking the weight distribution after each major step to make the derivation easier to follow. We assume familiarity with neural networks, basic linear algebra, and probability.

A simple setting for feature learning

Basic setup and limitations

Rubin et al.’s toy model describes feature learning in a network with two trainable layers, which learns a target that depends on one unknown direction in its input space. We keep the model narrow to make the qualitative picture and its derivation easier to follow:

  • The inputs are Gaussian with no preferred direction, so the network must identify the useful direction from their relationship to the target. Non-isotropic or non-Gaussian inputs can mix the target modes and complicate the analysis.
  • The target has an easier linear component and a harder cubic component along that same direction. The components are chosen so that fitting the linear part alone leaves the cubic part unexplained, while learning their shared direction could help with both.
  • The network has one hidden layer, studied at Bayesian equilibrium. The Bayesian formulation lets us study whether the network learns that direction through its posterior distribution over weights conditioned on the training data. We study a static picture, which gives no information about learning dynamics.
  • We use high-dimensional approximations in the proportional regime P∼N∼DP\sim N\sim D. Many of these intuitions extend to finite networks, where finite-size corrections can be calculated.

The central prediction of the theory is a phase transition from a hidden weight distribution with no preferred direction to one containing populations aligned with the target direction. We can detect this learned direction in the covariance of the hidden weights, which acquires an extra rank-one variation along that direction. Once the hidden features align, the network can also represent the cubic component more strongly. The improvement in nonlinear prediction follows from a change in the representation, and the theory predicts a large reduction in the number of samples needed to learn it.

We begin with a network learning to predict a number from a high-dimensional input. We choose a target that depends on one direction and give the network examples without telling it which direction is useful. We can then study whether the network learns that direction and how learning it improves prediction.

We draw inputs from a Gaussian distribution with no preferred direction,

x∼𝒩(0,ID), \mathbf x\sim\mathcal N(\mathbf 0,\mathbf I_D),

and choose an unknown unit vector e∈ℝD\mathbf e\in\mathbb R^D. The target, which the papers call the teacher, depends only on the projection

z=e𝖳x. z=\mathbf e^{\mathsf T}\mathbf x.

To study how learning a direction helps with nonlinear prediction, we give the target both a linear and a cubic component,

y(x)=H1(z)+ϵH3(z)=z+ϵ(z3−3z).y(\mathbf x)=H_1(z)+\epsilon H_3(z) =z+\epsilon(z^3-3z).

Subtracting 3z3z from z3z^3 removes its correlation with the linear component, since

𝔼[z(z3−3z)]=𝔼[z4]−3𝔼[z2]=3−3=0. \mathbb E[z(z^3-3z)]=\mathbb E[z^4]-3\mathbb E[z^2]=3-3=0.

The functions H1(z)=zH_1(z)=z and H3(z)=z3−3zH_3(z)=z^3-3z are Hermite polynomials. Their orthogonality means that fitting the linear part alone leaves the cubic part unexplained, even though both depend on the same direction. The coefficient ϵ\epsilon sets the cubic part’s strength.

The student network has two trainable layers and an odd nonlinearity,

f(x)=∑i=1Nai erf⁡(wi𝖳x).f(\mathbf x)=\sum_{i=1}^{N}a_i\,\operatorname{erf}(\mathbf w_i^{\mathsf T}\mathbf x).

Each hidden weight vector wi\mathbf w_i determines the input direction used by one neuron. We measure its alignment with the target direction by the overlap

ρi=wi𝖳e. \rho_i=\mathbf w_i^{\mathsf T}\mathbf e.

Figure 1.1 shows the target and the hidden weight overlap we will track.

We expect the broad approach to extend beyond this setting. Learned structure appears as a change in the hidden weight statistics, which we read from the posterior.

Figure 1.1 One direction carries both target modes

one informative projection

Gaussian inputs projected onto one teacher directionA cloud of input points surrounds the origin. A single diagonal axis marked e crosses the cloud, and faint perpendicular segments show several projections onto it.e\mathbf ez=e𝖳xz=\mathbf e^{\mathsf T}\mathbf x

two orthogonal target modes

Linear and cubic Hermite modes of the teacherA straight green line represents the first Hermite mode. A wine cubic curve represents the third Hermite mode. Both depend on the same scalar coordinate z.H1(z)=zH_1(z)=zH3(z)=z3−3zH_3(z)=z^3-3zzz

a neuron can rotate toward it

Hidden weights described by their overlap with the teacherQuiet radial directions surround an origin. A highlighted hidden weight approaches the teacher axis. Their scalar alignment is rho.e\mathbf ew\mathbf wρ=w𝖳e\rho=\mathbf w^{\mathsf T}\mathbf e
The target uses one scalar projection. Its linear and cubic components share that coordinate. Feature learning appears when hidden weights acquire finite overlap with the target direction.

The linear part contains enough information to estimate the target direction. Consider the average

e^=1P∑μ=1Pyμxμ.\widehat{\mathbf e} =\frac1P\sum_{\mu=1}^{P}y^\mu\mathbf x^\mu.

Only the component of x\mathbf x along e\mathbf e correlates with the target, so

𝔼[yx]=e 𝔼[zH1(z)]+ϵe 𝔼[zH3(z)]=e. \mathbb{E}[y\mathbf x] =\mathbf e\,\mathbb{E}[zH_1(z)] +\epsilon\mathbf e\,\mathbb{E}[zH_3(z)] =\mathbf e.

The squared estimation error is O(D/P)O(D/P), so P=O(D)P=O(D) examples identify e\mathbf e to order one accuracy. The linear term supplies the direction; without it, this estimate has mean zero and does not provide the same route to learning the cubic target.

We still need to explain when the network puts the estimated direction into its hidden weights.

A Bayesian description of learning

We now want to describe which weights the network favors after seeing the training examples. In the Bayesian model, we do so with a probability distribution over weights, called the posterior. We obtain it by combining a prior over weights with a likelihood for the observed targets.

We put independent Gaussian priors on the hidden and readout weights,

wi∼𝒩 ⁣(0,σw2DID),ai∼𝒩(0,sa2), \mathbf w_i\sim\mathcal N\!\left(\mathbf 0,\frac{\sigma_w^2}{D}\mathbf I_D\right), \qquad a_i\sim\mathcal N(0,s_a^2),

and use a Gaussian likelihood with variance TT on a training set of size PP,

p(𝒟∣{ai,wi})∝exp⁡ ⁣[−12T∑μ=1P(yμ−f(xμ))2]. p(\mathcal D\mid\{a_i,\mathbf w_i\}) \propto \exp\!\left[-\frac1{2T}\sum_{\mu=1}^{P} \bigl(y^\mu-f(\mathbf x^\mu)\bigr)^2\right].

The hidden weight prior gives no direction a preference. The likelihood favors weights with smaller prediction errors. Multiplying the priors by the likelihood gives the posterior over all the weights,

p({ai,wi}∣𝒟)∝exp⁡ ⁣[−D2σw2∑i∥wi∥2−12sa2∑iai2−12T∑μ(yμ−f(xμ))2]. p(\{a_i,\mathbf w_i\}\mid\mathcal D)\propto\exp\!\left[-\frac{D}{2\sigma_w^2}\sum_i\|\mathbf w_i\|^2-\frac{1}{2s_a^2}\sum_i a_i^2-\frac{1}{2T}\sum_\mu\bigl(y^\mu-f(\mathbf x^\mu)\bigr)^2\right].

We keep sa2s_a^2 and TT explicit because their dependence on width is part of the model. Standard scaling takes sa2=O(1/N)s_a^2=O(1/N) and T=O(1)T=O(1). The 2024 paper also uses a limit that reduces readout variance and likelihood variance together; the 2025 paper treats both standard and mean field scaling.

Equilibrated Langevin training, with the corresponding noise and weight decay, samples this posterior. We are studying that equilibrium distribution; the time needed to reach it requires a separate calculation.

The prediction error couples all the neurons through their sum, so we cannot yet calculate each neuron’s posterior on its own.

Score one neuron against the residual

We first ask which feature would help one neuron fit the prediction error left by the others. Holding the other neurons fixed lets us study that question through a conditional posterior.

Remove one neuron from the network and call the prediction error left by the other N−1N-1 neurons

rμ=yμ−f−(xμ). r_\mu=y^\mu-f_{-}(\mathbf x^\mu).

For a candidate hidden weight w\mathbf w, define its feature vector on the training set by

ϕμ(w)=erf⁡(w𝖳xμ). \phi_\mu(\mathbf w)=\operatorname{erf}(\mathbf w^{\mathsf T}\mathbf x^\mu).

The selected neuron contributes aϕa\boldsymbol\phi, so the full residual is r−aϕ\mathbf r-a\boldsymbol\phi. In the network posterior, the other neurons’ priors are constant under this conditioning. The remaining terms are

p(a,w∣r,X)∝p0(w)exp⁡ ⁣[−a22sa2−∥r−aϕ(w)∥22T]. p(a,\mathbf w\mid\mathbf r,X)\propto p_0(\mathbf w)\exp\!\left[-\frac{a^2}{2s_a^2}-\frac{\|\mathbf r-a\boldsymbol\phi(\mathbf w)\|^2}{2T}\right].

To integrate over aa, we need the feature’s correlation with the residual and its squared size on the training set,

S(w)=ϕ𝖳r,Q(w)=ϕ𝖳ϕ, S(\mathbf w)=\boldsymbol\phi^{\mathsf T}\mathbf r, \qquad Q(\mathbf w)=\boldsymbol\phi^{\mathsf T}\boldsymbol\phi,

SS measures how well the feature matches what remains to be learned. QQ measures the feature’s size, which we need to distinguish a useful correlation from a large feature. Write

L(w)=1+sa2TQ(w). L(\mathbf w)=1+\frac{s_a^2}{T}Q(\mathbf w).

A Gaussian integral over the readout weight aa now gives the hidden weight posterior,

p(w∣r,X)∝p0(w) L(w)−1/2exp⁡ ⁣[sa2S(w)22T2L(w)].p(\mathbf w\mid\mathbf r,X) \propto p_0(\mathbf w)\,L(\mathbf w)^{-1/2} \exp\!\left[ \frac{s_a^2S(\mathbf w)^2}{2T^2L(\mathbf w)} \right].

Equation is exact while the other neurons are fixed. The prior favors small weights with no preferred direction. The factor L−1/2L^{-1/2} accounts for integrating over the possible readout coefficients, and the exponential rewards a feature that fits the residual. The denominator LL adjusts that reward for the feature’s size.

The fit reward depends on S2S^2, so the signs w\mathbf w and −w-\mathbf w remain equivalent. The mean weight can stay at zero while an even moment such as 𝔼[ρ2]\mathbb{E}[\rho^2] records direction learning.

We still need the residual produced by the whole network. Self consistency will require that residual and the learned hidden weight distribution to agree.

Calculation Integrate the readout weight

The calculation uses the Gaussian integral after collecting the linear and quadratic terms in the readout weight. Expanding the squared error gives

∥r−aϕ∥2=∥r∥2−2aS(w)+a2Q(w). \lVert \mathbf r-a\boldsymbol\phi \rVert^2 =\lVert \mathbf r \rVert^2-2aS(\mathbf w)+a^2Q(\mathbf w).

The terms that depend on aa have the form

−A(w)2a2+B(w)a,A(w)=1sa2+Q(w)T,B(w)=S(w)T. -\frac{A(\mathbf w)}2a^2+B(\mathbf w)a, \qquad A(\mathbf w)=\frac1{s_a^2}+\frac{Q(\mathbf w)}T, \qquad B(\mathbf w)=\frac{S(\mathbf w)}T.

The Gaussian identity

∫−∞∞exp⁡ ⁣(−A2a2+Ba) da=2πAexp⁡ ⁣(B22A) \int_{-\infty}^{\infty} \exp\!\left(-\frac A2a^2+Ba\right)\,\mathrm{d} a =\sqrt{\frac{2\pi}{A}}\exp\!\left(\frac{B^2}{2A}\right)

then gives Equation after removing factors that do not depend on w\mathbf w.

Reduce the hidden weight posterior to one overlap

The posterior in Equation depends on the hidden weight through SS and QQ. We want to express those quantities in terms of its overlap with the target direction, so we can see which overlaps the posterior favors.

We approximate the residual by its linear and cubic components,

r(x)=bH1(z)+cH3(z).r(\mathbf x)=bH_1(z)+cH_3(z).

Here bb and cc are the amounts of the linear and cubic target components that remain unexplained. We use this approximation near the transition, where those components dominate the population residual.

To average the feature against each component, write

g=w𝖳x,q=∥w∥2,ρ=w𝖳e. g=\mathbf w^{\mathsf T}\mathbf x, \qquad q=\lVert \mathbf w \rVert^2, \qquad \rho=\mathbf w^{\mathsf T}\mathbf e.

The feature input gg has variance qq, and its covariance with the target coordinate zz is ρ\rho. Since both are Gaussian, we can calculate their correlations by Gaussian integration by parts, also called Stein’s identity. Its higher order form is

𝔼[F(g)Hk(z)]=ρk𝔼[F(k)(g)].\mathbb{E}[F(g)H_k(z)] =\rho^k\mathbb{E}[F^{(k)}(g)].

For the linear and cubic target components, the identity gives factors of ρ\rho and ρ3\rho^3. For the erf activation, the correlations are

𝔼[erf⁡(g)H1(z)]=2ρπ(1+2q),𝔼[erf⁡(g)H3(z)]=−4ρ3π(1+2q)3/2. \begin{aligned} \mathbb{E}[\operatorname{erf}(g)H_1(z)] &=\frac{2\rho}{\sqrt{\pi(1+2q)}},\\ \mathbb{E}[\operatorname{erf}(g)H_3(z)] &=-\frac{4\rho^3}{\sqrt\pi(1+2q)^{3/2}}. \end{aligned}

Substituting those correlations into the residual gives

m(ρ,q)=𝔼[r(x)erf⁡(g)]=2πρ1+2q(b−2cρ21+2q).m(\rho,q) =\mathbb{E}[r(\mathbf x)\operatorname{erf}(g)] =\frac{2}{\sqrt\pi} \frac{\rho}{\sqrt{1+2q}} \left( b-\frac{2c\rho^2}{1+2q} \right).

The feature variance is

v(q)=𝔼[erf⁡(g)2]=2πarcsin⁡ ⁣(2q1+2q).v(q)=\mathbb{E}[\operatorname{erf}(g)^2] =\frac{2}{\pi}\arcsin\!\left(\frac{2q}{1+2q}\right).

We now replace the sample sums by their population values, S≃PmS\simeq Pm and Q≃PvQ\simeq Pv. To reduce the remaining norm dependence, we keep the squared length perpendicular to the target at its typical prior value, giving q≃σw2+ρ2q\simeq\sigma_w^2+\rho^2. These are the approximations in the scalar description below.

Substituting into Equation gives the overlap posterior

p(ρ∣b,c)∝e−U(ρ;b,c),p(\rho\mid b,c)\propto e^{-U(\rho;b,c)},

with m(ρ)=m(ρ,σw2+ρ2)m(\rho)=m(\rho,\sigma_w^2+\rho^2) and

U(ρ;b,c)=Dρ22σw2+12log⁡L(ρ)−sa2P2m(ρ)22T2L(ρ),L(ρ)=1+sa2PTv(σw2+ρ2).U(\rho;b,c) =\frac{D\rho^2}{2\sigma_w^2} +\frac12\log L(\rho) -\frac{s_a^2P^2m(\rho)^2}{2T^2L(\rho)}, \qquad L(\rho)=1+\frac{s_a^2P}{T}v(\sigma_w^2+\rho^2).

The function UU is the negative log posterior, up to a constant. Lower values mean more probable overlaps. The first term is the prior cost of selecting the target direction in DD dimensions, while the last term rewards a feature that fits the residual.

For small data sets, the posterior concentrates near ρ=0\rho=0. As the fit reward grows, minima at finite ρ\rho can become competitive. Since UU is even, aligned weights occur with both signs.

The sample scale for alignment

We can estimate when the fit reward becomes large enough to compete with the prior. Near zero overlap, m(ρ)m(\rho) is proportional to bρb\rho. For sa2=O(1/N)s_a^2=O(1/N), fixed nonzero bb, and TT and L(0)L(0) of order one, the quadratic terms balance when

P2N=O(D). \frac{P^2}{N}=O(D).

The resulting scale is Palign=O(ND)P_{\mathrm{align}}=O(\sqrt{ND}). In the proportional regime N=O(D)N=O(D), alignment can therefore begin at P=O(D)P=O(D). The balance estimates a sample scale, rather than the location of the first order transition.

A first order transition depends on the depths of the minima, not only on the curvature at zero. As the fit reward increases, side minima can appear, reach the same depth as the central minimum, and then become deeper while the center remains locally stable. Equal depth marks the transition in the leading scalar description. The later loss of local stability is called a spinodal boundary.

Rubin, Seroussi & Ringel (2024) study this change in the posterior. Their mean field limit gives a simpler conditional potential, which illustrates how the minima change. In our notation, sa2s_a^2 is the full readout variance, so the interaction strength is

u=P2sa2T2D. u=\frac{P^2s_a^2}{T^2D}.

Taking L→1L\to1 in Equation gives

U~u(ρ)D=ρ22σw2−2uπρ21+2(σw2+ρ2)(b−2cρ21+2(σw2+ρ2))2.\frac{\widetilde U_u(\rho)}{D} =\frac{\rho^2}{2\sigma_w^2} -\frac{2u}{\pi} \frac{\rho^2}{1+2(\sigma_w^2+\rho^2)} \left( b-\frac{2c\rho^2}{1+2(\sigma_w^2+\rho^2)} \right)^2.

Equation is a further limiting form, not an exact rewrite at standard scaling. Figure 4.1 varies uu while holding bb and cc fixed. In the network calculation, those residual coefficients must also change through self consistency.

Figure 4.1 Aligned neuron populations appear as new posterior wells
Interaction strength uu29.45 Equal-depth coexistence. Population phase GMFL-I. Population second moment R equals 0.15.
The overlap potential as interaction strength changesA line plot of the normalized overlap potential. Move the interaction-strength control to see symmetric side wells appear, dominate, and destabilize the centred state. equal-depth coexistence(U~u(ρ)−min⁡U~u)/D(\widetilde U_u(\rho)-\min\widetilde U_u)/D−1-10011ρ\rho

Drag, or use the arrow keys for fine steps.

Move the control uu to compare the central and aligned minima. The curve fixes σw2=0.5\sigma_w^2=0.5, b=0.30b=0.30, and c=−0.30c=-0.30. The forty dots illustrate an unaligned population, a mixture of unaligned and aligned populations, and an aligned population. Vertical position separates the dots, and the displayed RR is their mean squared overlap. The dots and their mixture weights are illustrative. The control changes an interaction strength, not training time.
Calculation Derive the Gaussian Hermite identity

We can derive the overlap powers by separating the feature input into a part along the target and an independent Gaussian part,

g=ρz+q−ρ2 ξ,ξ∼𝒩(0,1),ξ independent of z. g=\rho z+\sqrt{q-\rho^2}\,\xi, \qquad \xi\sim\mathcal N(0,1), \qquad \xi\ \text{independent of }z.

For fixed ξ\xi, set h(z)=F(g)h(z)=F(g). The one variable Stein identity gives

𝔼[Hk(z)h(z)]=𝔼[h(k)(z)]. \mathbb{E}[H_k(z)h(z)]=\mathbb{E}[h^{(k)}(z)].

Each derivative with respect to zz contributes one factor of ρ\rho, so

h(k)(z)=ρkF(k)(g). h^{(k)}(z)=\rho^kF^{(k)}(g).

Averaging over ξ\xi gives Equation . For F(g)=erf⁡(g)F(g)=\operatorname{erf}(g), the derivative averages are

𝔼[F′(g)]=2π11+2q,𝔼[F′′′(g)]=−4π1(1+2q)3/2. \mathbb{E}[F'(g)] =\frac{2}{\sqrt\pi}\frac1{\sqrt{1+2q}}, \qquad \mathbb{E}[F'''(g)] =-\frac{4}{\sqrt\pi}\frac1{(1+2q)^{3/2}}.
Calculation Check the sample sum approximation

For fixed w\mathbf w and a fixed residual function rr, we can estimate the size of the error in replacing the sample sums by means. Each sample average uses PP independent terms, so

Var⁡ ⁣[S(w)P]=1PVar⁡ ⁣[r(x)erf⁡(w𝖳x)], \operatorname{Var}\!\left[\frac{S(\mathbf w)}P\right] =\frac1P\operatorname{Var}\!\left[r(\mathbf x)\operatorname{erf}(\mathbf w^{\mathsf T}\mathbf x)\right],

and

Var⁡ ⁣[Q(w)P]=1PVar⁡ ⁣[erf⁡(w𝖳x)2]. \operatorname{Var}\!\left[\frac{Q(\mathbf w)}P\right] =\frac1P\operatorname{Var}\!\left[\operatorname{erf}(\mathbf w^{\mathsf T}\mathbf x)^2\right].

Both averages fluctuate on the scale P−1/2P^{-1/2}. With sa2∼N−1s_a^2\sim N^{-1} and P∼N∼DP\sim N\sim D, their first correction to the log posterior at fixed w\mathbf w is O(D)O(\sqrt D), below the leading O(D)O(D) term. Using the population values throughout the posterior is a saddle-point approximation; this fixed-weight estimate alone does not control the error for weights selected by the data.

Calculation Check the perpendicular norm approximation

The approximation q≃σw2+ρ2q\simeq\sigma_w^2+\rho^2 keeps the perpendicular weight length at its typical prior value. To calculate that value, decompose the weight as

w=ρe+w⊥,e𝖳w⊥=0. \mathbf w=\rho\mathbf e+\mathbf w_\perp, \qquad \mathbf e^{\mathsf T}\mathbf w_\perp=0.

Under the Gaussian prior, the D−1D-1 orthogonal coordinates have variance σw2/D\sigma_w^2/D. Therefore

∥w⊥∥2∼σw2DχD−12. \lVert \mathbf w_\perp \rVert^2 \sim\frac{\sigma_w^2}{D}\chi^2_{D-1}.

Its mean approaches σw2\sigma_w^2, and its relative fluctuations have size D−1/2D^{-1/2}.

Prior concentration explains the value we use. Keeping it fixed after conditioning on the data is a further approximation, since the fit reward also depends on the norm.

Calculation Expand the potential near zero overlap

The curvature at zero tells us when the central minimum loses local stability. Expand the residual correlation and the readout factor as

m(ρ)=αρ+O(ρ3),L(ρ)=L0+ℓρ2+O(ρ4). m(\rho)=\alpha\rho+O(\rho^3), \qquad L(\rho)=L_0+\ell\rho^2+O(\rho^4).

Then

m(ρ)2=α2ρ2+O(ρ4),log⁡L(ρ)=log⁡L0+ℓL0ρ2+O(ρ4). m(\rho)^2=\alpha^2\rho^2+O(\rho^4), \qquad \log L(\rho)=\log L_0+\frac{\ell}{L_0}\rho^2+O(\rho^4).

Substitution into the scalar potential gives

U′′(0)=Dσw2+ℓL0−sa2P2α2T2L0. U''(0) =\frac{D}{\sigma_w^2} +\frac{\ell}{L_0} -\frac{s_a^2P^2\alpha^2}{T^2L_0}.

The centered state loses local stability when U′′(0)U''(0) changes sign. A finite-overlap minimum can become preferable before that happens.

The hidden weight covariance records the learned direction

Aligned weights with opposite signs can have zero mean, so the mean alone cannot tell us whether the network learned the direction. We instead measure the squared overlap,

R=𝔼[ρ2]. R=\mathbb{E}[\rho^2].

Before alignment, R=O(D−1)R=O(D^{-1}). Once the posterior assigns finite mass near ρ=±ρ∗\rho=\pm\rho_*, RR becomes O(1)O(1). Symmetry still gives 𝔼[ρ]=0\mathbb{E}[\rho]=0.

Decompose a hidden weight into parts parallel and orthogonal to the teacher,

w=ρe+ξ,e𝖳ξ=0. \mathbf w=\rho\mathbf e+\boldsymbol\xi, \qquad \mathbf e^{\mathsf T}\boldsymbol\xi=0.

The perpendicular directions remain equivalent in our scalar approximation. Keeping their total squared length at σw2\sigma_w^2 gives, to leading order at large DD,

𝔼[ww𝖳]=σw2D−1(I−ee𝖳)+R ee𝖳.\mathbb{E}[\mathbf w\mathbf w^{\mathsf T}] =\frac{\sigma_w^2}{D-1} \bigl(\mathbf I-\mathbf e\mathbf e^{\mathsf T}\bigr) +R\,\mathbf e\mathbf e^{\mathsf T}.

The eigenvalue along e\mathbf e is RR, while each perpendicular eigenvalue remains O(D−1)O(D^{-1}). Once R=O(1)R=O(1), we can recover the learned direction from the covariance’s leading eigenvector. The extra term along ee𝖳\mathbf e\mathbf e^{\mathsf T} is a rank-one change in the hidden weight covariance.

Figure 5.1 The covariance records direction learning

before direction learning

An isotropic hidden-weight distributionHidden weights form an approximately circular cloud around zero in a plane containing the teacher direction.e\mathbf eR=𝔼[ρ2]=O(D−1)R=\EE[\rho^2]=O(D^{-1})

after direction learning

A hidden-weight distribution elongated along the teacherThe cloud is symmetric about zero but elongated along the teacher axis, showing a rank-one covariance increase without a nonzero mean weight.e\mathbf eR=𝔼[ρ2]=O(1)R=\EE[\rho^2]=O(1)
𝔼[ww𝖳]=σw2D−1I+(R−σw2D−1)ee𝖳\EE[\mathbf w\mathbf w^{\mathsf T}]=\frac{\sigma_w^2}{D-1}\mathbf I+\left(R-\frac{\sigma_w^2}{D-1}\right)\mathbf e\mathbf e^{\mathsf T}
Oppositely aligned populations have zero mean but an order one covariance eigenvalue along the target direction. Multiplying the original isotropic covariance by a scalar would change all directions alike and cannot describe that preferred direction.

The hidden weight covariance describes directions in input space. The feature kernel, which we use next, describes correlations between neuron outputs on different inputs. Rubin et al. (2025) retain directional information that a scalar kernel rescaling can miss, even in regimes where rescaling predicts some mean outputs well.

Match the residual to the network’s prediction

We have scored hidden weights against a residual specified by (b,c)(b,c). To describe the network, we must now require its predictions to leave that same residual.

We summarize the learned features by their kernel, which measures how much a typical feature responds to both members of an input pair. For a candidate residual, the hidden weight posterior gives

Kμν(b,c)=Nsa2 𝔼p(w∣b,c) ⁣[erf⁡(w𝖳xμ)erf⁡(w𝖳xν)].K_{\mu\nu}(b,c) =Ns_a^2\, \mathbb{E}_{p(\mathbf w\mid b,c)}\!\left[ \operatorname{erf}(\mathbf w^{\mathsf T}\mathbf x^\mu) \operatorname{erf}(\mathbf w^{\mathsf T}\mathbf x^\nu) \right].

Within the adaptive kernel approximation, we then use Gaussian regression to calculate the mean prediction. The mean residual is

r‾=T(K(b,c)+TI)−1y.\overline{\mathbf r} =T\bigl(\mathbf K(b,c)+T\mathbf I\bigr)^{-1}\mathbf y.

Projecting r‾\overline{\mathbf r} onto the sampled functions H1H_1 and H3H_3 gives new residual coefficients. We choose (b,c)(b,c) so that the new coefficients equal the ones used to construct the posterior. On a finite data set, the projection is a least-squares fit to the two functions, since their sample correlation need not be zero.

Figure 6.1 The learned features and residual must agree
The adaptive-kernel self-consistency loopFour states form a clockwise loop. Residual coefficients determine an overlap posterior, the posterior determines an adaptive kernel, the kernel determines a predictor, and the predictor returns new residual coefficients.r(x)=bH1(z)+cH3(z)r(x)=bH_1(z)+cH_3(z)p(ρ∣b,c)p(\rho\mid b,c)Kb,cK_{b,c}rˉ=T(Kb,c+TI)−1y\bar r=T(K_{b,c}+T\mathbf I)^{-1}yfit one neuron\text{fit one neuron}average features\text{average features}kernel prediction\text{kernel prediction}project residual\text{project residual}
A candidate residual determines the hidden weight posterior. Averaging its features gives a kernel and a new prediction. At a self-consistent solution, that prediction leaves the candidate residual unchanged.

Direction learning reduces the sample count

We can now connect the learned direction to the number of examples needed for nonlinear prediction. The relevant quantity is the strength of the cubic target component in the hidden features.

For a random hidden weight, ρ=O(D−1/2)\rho=O(D^{-1/2}). Its correlation with the cubic target is proportional to ρ3\rho^3, and the kernel contains the square of that correlation. The cubic kernel power is therefore O(D−3)O(D^{-3}). A finite fraction of aligned weights with ρ=O(1)\rho=O(1) gives the same component order one strength.

For the comparison, keep Nsa2Ns_a^2 and TT of order one. A fixed isotropic kernel needs P=O(D3)P=O(D^3) samples for its weak cubic component to become learnable. The adaptive network can use the linear target component to identify the shared direction at P=O(D)P=O(D), then reuse that direction for cubic prediction.

The sample counts in Figure 7.1 reflect the inverse strength of the cubic component. The benefit comes from learning a direction shared by the linear and cubic parts; the argument does not give the same sample count for a purely cubic target.

Figure 7.1 A learned direction changes the cubic sample scale
Two routes to the cubic teacher modeThe upper route keeps random hidden directions. Their overlap is of order one over square root D, so cubic kernel power is of order D to the minus three and sample complexity is D cubed. The lower route uses the linear teacher component to learn the direction with D samples, after which cubic power is order one.fixed featuresadaptive featuresw∼p0\mathbf w\sim p_0ρ=O(D−1/2)\rho=O(D^{-1/2})h32=O(D−3)h_3^2=O(D^{-3})Pfixed=O(D3)P_{\mathrm{fixed}}=O(D^3)H1 estimates eH_1\ \text{estimates }\mathbf ePalign=O(D)P_{\mathrm{align}}=O(D)ρ=O(1),h32=O(1)\rho=O(1),\quad h_3^2=O(1)Padaptive=O(D)P_{\mathrm{adaptive}}=O(D)

fixed features

  1. w∼p0\mathbf w\sim p_0
  2. ρ=O(D−1/2)\rho=O(D^{-1/2})
  3. h32=O(D−3)h_3^2=O(D^{-3})
  4. Pfixed=O(D3)P_{\mathrm{fixed}}=O(D^3)

adaptive features

  1. H1 estimates eH_1\ \text{estimates }\mathbf e
  2. Palign=O(D)P_{\mathrm{align}}=O(D)
  3. ρ=O(1),h32=O(1)\rho=O(1),\quad h_3^2=O(1)
  4. Padaptive=O(D)P_{\mathrm{adaptive}}=O(D)
For fixed features, cubic kernel power falls as the inverse cube of dimension, so the sample count grows as the cube of dimension. The adaptive network uses the linear component to learn the target direction with a sample count proportional to dimension. Finite overlap then gives the cubic component order one strength along the same direction.

Rubin et al. (2025) predict the onset of nonlinear learning at P=O(D)P=O(D), while the fixed infinite-width Gaussian process kernel and scalar rescaling descriptions retain the O(D3)O(D^3) scale. Rubin, Seroussi & Ringel (2024) connect the improvement in cubic prediction to the feature learning transition.

Calculation Derive the cubic sample scale

The cubic power follows by squaring the Gaussian correlation we calculated earlier. For one erf feature, write

h3(w)=𝔼[erf⁡(w𝖳x)H3(z)]=−4ρ3π(1+2q)3/2. h_3(\mathbf w) =\mathbb{E}[\operatorname{erf}(\mathbf w^{\mathsf T}\mathbf x)H_3(z)] =-\frac{4\rho^3}{\sqrt\pi(1+2q)^{3/2}}.

Since 𝔼[H32]=6\mathbb E[H_3^2]=6, the unit-normalized cubic function is H3/6H_3/\sqrt6. The kernel power along that function is

λ3=Nsa26 𝔼w[h3(w)2]. \lambda_3=\frac{Ns_a^2}{6}\,\mathbb E_{\mathbf w}[h_3(\mathbf w)^2].

At initialization, ρ=O(D−1/2)\rho=O(D^{-1/2}), which gives

h3(w)=O(D−3/2),h3(w)2=O(D−3). h_3(\mathbf w)=O(D^{-3/2}), \qquad h_3(\mathbf w)^2=O(D^{-3}).

With Nsa2=O(1)Ns_a^2=O(1), we have λ3=O(D−3)\lambda_3=O(D^{-3}). In the fixed-kernel estimate, the cubic component becomes learnable when Pλ3P\lambda_3 is comparable to TT, giving P=O(D3)P=O(D^3). A finite fraction of weights with order one overlap removes that suppression of the cubic power.

What we are working on

The derivation above connects a change in the hidden weight distribution to an improvement in nonlinear prediction. Alignment with a learned direction strengthens features that help predict the cubic component. The calculation gives a concrete example of how a theory of internal representations can explain generalization. We expect the central approach laid out here to extend beyond this setting. The next challenge is to understand how this picture extends to deeper networks, away from equilibrium, and at finite widths and sample sizes.

Our work asks how networks organize and carry learned features across neuronal populations, and how these insights apply in more realistic settings. The same feature can involve a few neurons with large contributions, many neurons with small contributions, or both. It could involve factorized neurons that learn largely independently, or a population of correlated neurons that together carry the feature. At the output level, different populations can compute the same function while having different hidden weights and representation structures.

Understanding how features and circuits arise from learned representations can help us probe them. Under which conditions would changing a few neurons substantially affect a learned feature? How diffuse or localized are neuron contributions, and how do we know? Answering such questions would help clarify when particular probes, interventions, or control methods work and where their limitations lie. We think there is a lot of work to be done to make the relevant assumptions, limits, and settings concrete enough to inform AI safety, and that statistical physics offers the right techniques and frameworks to improve our understanding.

In a series of upcoming posts, we will share: 1) results showing the coexistence of features carried weakly by the whole population and strongly by a sparse mesoscopic population, along with the ensuing phase diagram; 2) how learning multiple features with different correlation structures can cause a phase transition from shared to modular representations; and 3) implications for interpretability and control derived from these representational structures. Our aim is to explain how learning produces these different internal structures, and what those structures imply for our ability to understand and intervene on neural networks across training, post-training, and deployment scenarios.

References

Rubin, N., Seroussi, I., & Ringel, Z. (2024). Grokking as a first order phase transition in two layer networks. International Conference on Learning Representations.

Rubin, N., Fischer, K., Lindner, J., Seroussi, I., Ringel, Z., Krämer, M., & Helias, M. (2025). From kernels to features: A multi-scale adaptive theory of feature learning. Proceedings of the 42nd International Conference on Machine Learning, 267, 52225–52257.

Vaintrob, D., & Hänni, K. (2026). Width-Robust Learnability in Mean-Field Bayesian Neural Networks. arXiv preprint.

Hänni, K., Mendel, J., Vaintrob, D., & Chan, L. (2024). Mathematical Models of Computation in Superposition. ICML 2024 Mechanistic Interpretability Workshop. (arXiv)