CSE-41XX
Course Curriculum

3. Large Numbers, Self-Averaging & Infinite-Width Neural Networks

Mathematical foundations of large-N asymptotics: Stirling's approximation, high-dimensional concentration, self-averaging, Gaussian Process limits (NNGP), Neural Tangent Kernel (NTK) dynamics, non-asymptotic transport bounds, mini-batch SGD central limit theorems, and 1/N effective field theory expansions.

Large Numbers, Self-Averaging & Infinite-Width Neural Networks

Why does statistical physics make exact, deterministic predictions about macroscopic systems composed of 102310^{23} chaotic particles? And why do modern deep neural networks with billions of randomly initialized parameters converge reliably, behave deterministically in the wide limit, and generalize predictably across unseen data?

The answer to both questions lies in the mathematics of large numbers, concentration of measure, and self-averaging. In physical systems, microscopic fluctuations cancel out, giving rise to sharp thermodynamic laws. In deep learning, sending the layer width NN \to \infty simplifies intractable non-convex optimization into linear dynamics over deterministic kernel regimes: the Neural Network Gaussian Process (NNGP) and the Neural Tangent Kernel (NTK).

When finite width N<N < \infty is restored, the system develops fluctuations and interactions that can be systematically computed via 1/N1/N perturbative expansions (Feynman diagrams in statistical field theory), shedding light on representation learning and finite-sample SGD noise.


1. Microscopic Multiplicities, Binomial Distribution & Stirling's Asymptotics

To understand how deterministic macroscopic behavior emerges from stochastic microscopic degrees of freedom, we begin with the simplest combinatorial system: non-interacting binary degrees of freedom (e.g., non-interacting gas molecules in a partitioned volume or uncoupled Ising spins σi{1,+1}\sigma_i \in \{-1, +1\}).

1.1 Multiplicity and the Binomial Distribution

Consider NN independent particles placed in a container divided into two equal halves. Each particle has probability p=1/2p = 1/2 of occupying the left half and 1p=1/21-p = 1/2 of occupying the right half. The total number of microstates is Ωtotal=2N\Omega_{\mathrm{total}} = 2^N.

The number of distinct configurations (microstates) where exactly mm particles reside in the left half is given by the binomial coefficient:

Ω(m;N)=(Nm)=N!m!(Nm)!\Omega(m; N) = \binom{N}{m} = \frac{N!}{m!\,(N-m)!}

The probability P(m;N)P(m; N) of observing macrostate mm under the postulate of equal a priori probabilities is:

P(m;N)=(Nm)pm(1p)Nm=12NN!m!(Nm)!P(m; N) = \binom{N}{m} p^m (1-p)^{N-m} = \frac{1}{2^N} \frac{N!}{m!\,(N-m)!}

For small NN, P(m;N)P(m; N) is spread broadly across possible values of mm. But when NN is on the order of Avogadro's number (N1023N \approx 10^{23}), observing even a 0.0001%0.0001\% relative deviation from the mean m=N/2m^* = N/2 becomes astronomically impossible.


1.2 Step-by-Step Derivation of Stirling's Approximation via Laplace's Method

To analyze the behavior of N!N! as NN \to \infty, we express the factorial using Euler's Gamma function:

N!=Γ(N+1)=0tNetdt=0eNlnttdtN! = \Gamma(N+1) = \int_0^\infty t^N e^{-t} \, dt = \int_0^\infty e^{N \ln t - t} \, dt

Let h(t)=Nlntth(t) = N \ln t - t. To apply Laplace's method (the saddle-point approximation), we locate the maximum t0t_0 of h(t)h(t):

h(t)=Nt1=0    t0=Nh'(t) = \frac{N}{t} - 1 = 0 \implies t_0 = N

The second derivative at the saddle point is:

h(t0)=Nt02=1N<0h''(t_0) = -\frac{N}{t_0^2} = -\frac{1}{N} < 0

Now perform a change of variables t=N(1+u)t = N(1 + u), so that dt=Ndudt = N \, du:

h(t)=Nln(N(1+u))N(1+u)=NlnNN+N[ln(1+u)u]\begin{aligned} h(t) &= N \ln(N(1+u)) - N(1+u) \\ &= N \ln N - N + N \left[ \ln(1+u) - u \right] \end{aligned}

Using the Taylor series expansion ln(1+u)=uu22+u33O(u4)\ln(1+u) = u - \frac{u^2}{2} + \frac{u^3}{3} - \mathcal{O}(u^4):

ln(1+u)u=u22+u33u44+\ln(1+u) - u = -\frac{u^2}{2} + \frac{u^3}{3} - \frac{u^4}{4} + \dots

Substituting this into the integral:

N!=1exp(NlnNNNu22+Nu33)Ndu=NN+1eN1eNu22exp(Nu33Nu44+)du\begin{aligned} N! &= \int_{-1}^\infty \exp\left( N \ln N - N - \frac{N u^2}{2} + \frac{N u^3}{3} - \dots \right) N \, du \\ &= N^{N+1} e^{-N} \int_{-1}^\infty e^{-\frac{N u^2}{2}} \exp\left( \frac{N u^3}{3} - \frac{N u^4}{4} + \dots \right) du \end{aligned}

Let v=Nuv = \sqrt{N} u, so du=dvNdu = \frac{dv}{\sqrt{N}}:

N!=NN+1eN1NNev2/2exp(v33Nv44N+)dvN! = N^{N+1} e^{-N} \frac{1}{\sqrt{N}} \int_{-\sqrt{N}}^\infty e^{-v^2 / 2} \exp\left( \frac{v^3}{3\sqrt{N}} - \frac{v^4}{4N} + \dots \right) dv

Expanding the exponential perturbatively:

exp(v33Nv44N)=1+v33N+(v618Nv44N)+O(N3/2)\exp\left( \frac{v^3}{3\sqrt{N}} - \frac{v^4}{4N} \right) = 1 + \frac{v^3}{3\sqrt{N}} + \left( \frac{v^6}{18N} - \frac{v^4}{4N} \right) + \mathcal{O}(N^{-3/2})

Using Gaussian moments ev2/2dv=2π\int_{-\infty}^\infty e^{-v^2/2} dv = \sqrt{2\pi}, v3ev2/2dv=0\int_{-\infty}^\infty v^3 e^{-v^2/2} dv = 0 (odd symmetry), v4ev2/2dv=32π\int_{-\infty}^\infty v^4 e^{-v^2/2} dv = 3\sqrt{2\pi}, and v6ev2/2dv=152π\int_{-\infty}^\infty v^6 e^{-v^2/2} dv = 15\sqrt{2\pi}:

ev2/2[1+1N(v618v44)]dv=2π[1+1N(151834)]=2π[1+112N+O(N2)]\begin{aligned} \int_{-\infty}^\infty e^{-v^2/2} \left[ 1 + \frac{1}{N}\left( \frac{v^6}{18} - \frac{v^4}{4} \right) \right] dv &= \sqrt{2\pi} \left[ 1 + \frac{1}{N}\left( \frac{15}{18} - \frac{3}{4} \right) \right] \\ &= \sqrt{2\pi} \left[ 1 + \frac{1}{12N} + \mathcal{O}(N^{-2}) \right] \end{aligned}

Thus, we obtain the full asymptotic Stirling series:

Theorem: Stirling's Formula with Next-to-Leading Order

N!=2πN(Ne)N(1+112N+1288N213951840N3+O(N4))N! = \sqrt{2\pi N} \left(\frac{N}{e}\right)^N \left( 1 + \frac{1}{12N} + \frac{1}{288N^2} - \frac{139}{51840N^3} + \mathcal{O}(N^{-4}) \right)

Taking the natural logarithm:

lnN!=NlnNN+12ln(2πN)+112N+O(N2)\ln N! = N \ln N - N + \frac{1}{2}\ln(2\pi N) + \frac{1}{12N} + \mathcal{O}(N^{-2})

1.3 Asymptotics of the Binomial Distribution & Gaussian Emergence

We now evaluate the binomial log-probability lnP(m;N)\ln P(m; N) for m=Np+δmm = N p + \delta m, where δm=O(N)\delta m = \mathcal{O}(\sqrt{N}) represents microscopic fluctuations around the expected mean.

Using lnN!NlnNN+12ln(2πN)\ln N! \approx N \ln N - N + \frac{1}{2}\ln(2\pi N):

lnP(m;N)=lnN!lnm!ln(Nm)!+mlnp+(Nm)ln(1p)NlnNN+12ln(2πN)[mlnmm+12ln(2πm)][(Nm)ln(Nm)(Nm)+12ln(2π(Nm))]+mlnp+(Nm)ln(1p)\begin{aligned} \ln P(m; N) &= \ln N! - \ln m! - \ln(N-m)! + m \ln p + (N-m) \ln(1-p) \\ &\approx N \ln N - N + \frac{1}{2}\ln(2\pi N) \\ &\quad - \left[ m \ln m - m + \frac{1}{2}\ln(2\pi m) \right] \\ &\quad - \left[ (N-m) \ln(N-m) - (N-m) + \frac{1}{2}\ln(2\pi(N-m)) \right] \\ &\quad + m \ln p + (N-m) \ln(1-p) \end{aligned}

Let x=m/N=p+δmN=p+ϵx = m/N = p + \frac{\delta m}{N} = p + \epsilon, where ϵ=δmN=O(N1/2)\epsilon = \frac{\delta m}{N} = \mathcal{O}(N^{-1/2}). Expanding the terms:

mlnm(Nm)ln(Nm)+mlnp+(Nm)ln(1p)=N[xlnxp+(1x)ln1x1p]=NDKL(xp)\begin{aligned} -m \ln m - (N-m)\ln(N-m) + m \ln p + (N-m)\ln(1-p) &= -N \left[ x \ln\frac{x}{p} + (1-x)\ln\frac{1-x}{1-p} \right] \\ &= -N D_{\mathrm{KL}}(x \,\|\, p) \end{aligned}

Expanding the Kullback-Leibler divergence DKL(p+ϵp)D_{\mathrm{KL}}(p + \epsilon \,\|\, p) around ϵ=0\epsilon = 0:

DKL(p+ϵp)=DKLϵ=0+ϵDKLϵϵ=0+ϵ222DKLϵ2ϵ=0+O(ϵ3)D_{\mathrm{KL}}(p+\epsilon \,\|\, p) = \left. D_{\mathrm{KL}} \right|_{\epsilon=0} + \left. \epsilon \frac{\partial D_{\mathrm{KL}}}{\partial \epsilon} \right|_{\epsilon=0} + \left. \frac{\epsilon^2}{2} \frac{\partial^2 D_{\mathrm{KL}}}{\partial \epsilon^2} \right|_{\epsilon=0} + \mathcal{O}(\epsilon^3)

The derivatives are:

DKLϵ=ln(p+ϵp)ln(1pϵ1p)    DKLϵϵ=0=0\frac{\partial D_{\mathrm{KL}}}{\partial \epsilon} = \ln\left(\frac{p+\epsilon}{p}\right) - \ln\left(\frac{1-p-\epsilon}{1-p}\right) \implies \left. \frac{\partial D_{\mathrm{KL}}}{\partial \epsilon} \right|_{\epsilon=0} = 0 2DKLϵ2=1p+ϵ+11pϵ    2DKLϵ2ϵ=0=1p+11p=1p(1p)\frac{\partial^2 D_{\mathrm{KL}}}{\partial \epsilon^2} = \frac{1}{p+\epsilon} + \frac{1}{1-p-\epsilon} \implies \left. \frac{\partial^2 D_{\mathrm{KL}}}{\partial \epsilon^2} \right|_{\epsilon=0} = \frac{1}{p} + \frac{1}{1-p} = \frac{1}{p(1-p)}

Thus:

NDKL(p+ϵp)=N(ϵ22p(1p)+O(ϵ3))=(δm)22Np(1p)+O(N1/2)-N D_{\mathrm{KL}}(p+\epsilon \,\|\, p) = -N \left( \frac{\epsilon^2}{2p(1-p)} + \mathcal{O}(\epsilon^3) \right) = -\frac{(\delta m)^2}{2 N p (1-p)} + \mathcal{O}(N^{-1/2})

The prefactor terms become:

12ln(N2πm(Nm))=12ln(12πNp(1p))+O(N1/2)\frac{1}{2} \ln \left( \frac{N}{2\pi m (N-m)} \right) = \frac{1}{2} \ln \left( \frac{1}{2\pi N p (1-p)} \right) + \mathcal{O}(N^{-1/2})

Exponentiating both sides yields the classical de Moivre–Laplace Limit Theorem:

P(m;N)12πσ2exp((mμ)22σ2),μ=Np,σ2=Np(1p)P(m; N) \approx \frac{1}{\sqrt{2\pi \sigma^2}} \exp\left( -\frac{(m - \mu)^2}{2\sigma^2} \right), \quad \mu = Np, \quad \sigma^2 = Np(1-p)

1.4 Absolute vs. Relative Fluctuations

This derivation illuminates the foundational principle of statistical mechanics:

QuantityAbsolute ScalingRelative Scaling (Fraction of Mean)
Mean m\langle m \rangleO(N)\mathcal{O}(N)11
Standard Deviation σm\sigma_mO(N)\mathcal{O}(\sqrt{N})σmm=O(1N)\frac{\sigma_m}{\langle m \rangle} = \mathcal{O}\left(\frac{1}{\sqrt{N}}\right)
Variance Var(m)\operatorname{Var}(m)O(N)\mathcal{O}(N)Var(m)m2=O(1N)\frac{\operatorname{Var}(m)}{\langle m \rangle^2} = \mathcal{O}\left(\frac{1}{N}\right)

Relative Fluctuations: σSS=σNμ1N\text{Relative Fluctuations: } \frac{\sigma_S}{\langle S \rangle} = \frac{\sigma}{\sqrt{N} \mu} \propto \frac{1}{\sqrt{N}}

System Size NNRelative Fluctuations (1N\frac{1}{\sqrt{N}})Physical Regime
N=100N = 100±10%\pm 10\%Microscopic noise dominated
N=106N = 10^6±0.1%\pm 0.1\%Mesoscopic smooth averaging
N=1023N = 10^{23}±1011.5%\pm 10^{-11.5}\%Macroscopic thermodynamic certainty

In a room with N=1026N = 10^{26} gas molecules, the relative fluctuation is:

σmm11026=1013\frac{\sigma_m}{\langle m \rangle} \approx \frac{1}{\sqrt{10^{26}}} = 10^{-13}

Macroscopic observables behave deterministically because the probability density approaches a Dirac delta function δ(m/Np)\delta(m/N - p) in the thermodynamic limit NN \to \infty.


2. High-Dimensional LLN, CLT & Concentration of Measure

In deep learning, we do not merely sum scalar coin flips; we deal with random weight matrices WRdout×din\mathbf{W} \in \mathbb{R}^{d_{\mathrm{out}} \times d_{\mathrm{in}}}, high-dimensional activations hRN\mathbf{h} \in \mathbb{R}^N, and gradient vectors gRP\mathbf{g} \in \mathbb{R}^P with P109P \gg 10^9.

2.1 The Multidimensional Central Limit Theorem

Let x1,x2,,xNRd\mathbf{x}_1, \mathbf{x}_2, \dots, \mathbf{x}_N \in \mathbb{R}^d be independent and identically distributed (i.i.d.) random vectors with mean E[xi]=μ\mathbb{E}[\mathbf{x}_i] = \boldsymbol{\mu} and covariance matrix Cov(xi)=ΣRd×d\operatorname{Cov}(\mathbf{x}_i) = \mathbf{\Sigma} \in \mathbb{R}^{d \times d}.

Define the empirical mean:

xˉN=1Ni=1Nxi\bar{\mathbf{x}}_N = \frac{1}{N} \sum_{i=1}^N \mathbf{x}_i

By the Weak Law of Large Numbers (WLLN), xˉNPμ\bar{\mathbf{x}}_N \xrightarrow{P} \boldsymbol{\mu} as NN \to \infty. The fluctuations around the mean are governed by the Multidimensional Central Limit Theorem:

N(xˉNμ)dN(0,Σ)\sqrt{N} (\bar{\mathbf{x}}_N - \boldsymbol{\mu}) \xrightarrow{d} \mathcal{N}(\mathbf{0}, \mathbf{\Sigma})

ϕZN(t)=[ϕX(tN)]N=[1σ2t22N+o(1N)]NNeσ2t22\phi_{Z_N}(t) = \left[ \phi_X\left( \frac{t}{\sqrt{N}} \right) \right]^N = \left[ 1 - \frac{\sigma^2 t^2}{2N} + o\left(\frac{1}{N}\right) \right]^N \xrightarrow{N \to \infty} e^{-\frac{\sigma^2 t^2}{2}}


2.2 Geometry of High Dimensions: Spherical Concentration

High-dimensional space defies low-dimensional intuition. Two fundamental phenomena dictate the behavior of high-dimensional Gaussian random variables xN(0,Id)\mathbf{x} \sim \mathcal{N}(\mathbf{0}, \mathbf{I}_d):

Phenomenon 1: Concentration on the Sphere Surface (The "Soap Bubble" Effect)

The squared norm x2=i=1dxi2\|\mathbf{x}\|^2 = \sum_{i=1}^d x_i^2 is the sum of dd independent χ12\chi_1^2 random variables.

  • E[x2]=d\mathbb{E}[\|\mathbf{x}\|^2] = d
  • Var(x2)=2d\operatorname{Var}(\|\mathbf{x}\|^2) = 2d

The relative fluctuation of the radius is:

Var(x)E[x]2d/(2d)d=12dd0\frac{\sqrt{\operatorname{Var}(\|\mathbf{x}\|)}}{\mathbb{E}[\|\mathbf{x}\|]} \approx \frac{\sqrt{2d} / (2\sqrt{d})}{\sqrt{d}} = \frac{1}{\sqrt{2d}} \xrightarrow{d \to \infty} 0

By Bernstein's inequality:

P(x2d1ϵ)2exp(dϵ28)\mathbb{P}\left( \left| \frac{\|\mathbf{x}\|^2}{d} - 1 \right| \ge \epsilon \right) \le 2 \exp\left( - \frac{d \epsilon^2}{8} \right)

Almost all the probability mass of a dd-dimensional standard Gaussian vector resides inside a thin hyperspherical shell of radius d\sqrt{d} and thickness O(1)\mathcal{O}(1).

Phenomenon 2: Quasi-Orthogonality of Random Vectors

Let u,vN(0,Id)\mathbf{u}, \mathbf{v} \sim \mathcal{N}(\mathbf{0}, \mathbf{I}_d) be independent random vectors. The cosine of their angle θ\theta is:

cosθ=uvuvi=1duivid\cos \theta = \frac{\mathbf{u}^\top \mathbf{v}}{\|\mathbf{u}\| \|\mathbf{v}\|} \approx \frac{\sum_{i=1}^d u_i v_i}{d}

Since uiviu_i v_i are independent random variables with mean 0 and variance 1:

E[cosθ]=0,Var(cosθ)1d\mathbb{E}[\cos \theta] = 0, \quad \operatorname{Var}(\cos \theta) \approx \frac{1}{d} P(cosθϵ)2exp(dϵ22)\mathbb{P}(|\cos \theta| \ge \epsilon) \le 2 \exp\left( -\frac{d \epsilon^2}{2} \right)

In high dimensions, any two independent random vectors are almost certainly orthogonal: θπ/2±O(d1/2)\theta \approx \pi/2 \pm \mathcal{O}(d^{-1/2}).

High-Dimensional Hypersphere Volume Concentration


3. Self-Averaging in Statistical Physics & Deep Learning

3.1 Mathematical Definition of Self-Averaging

In disordered physical systems (e.g., spin glasses, random alloys) or deep neural networks initialized with random weights, the Hamiltonian HN(σ;J)\mathcal{H}_N(\boldsymbol{\sigma}; \mathbf{J}) or empirical loss L^N(w;D)\hat{\mathcal{L}}_N(\mathbf{w}; \mathcal{D}) depends on quenched random variables JP(J)\mathbf{J} \sim P(\mathbf{J}) or initial weights WP(W)\mathbf{W} \sim P(\mathbf{W}).

Definition: Self-Averaging Observable

An intensive observable ANA_N (such as free energy per spin fN=FN/Nf_N = F_N / N, magnetization per spin mN=MN/Nm_N = M_N / N, or neural network test loss LN\mathcal{L}_N) is self-averaging if its sample-to-sample variance across realizations of disorder vanishes in the thermodynamic limit:

RA(N)VarJ[AN](EJ[AN])2=EJ[AN2](EJ[AN])2(EJ[AN])2N0R_A(N) \equiv \frac{\operatorname{Var}_{\mathbf{J}}[A_N]}{(\mathbb{E}_{\mathbf{J}}[A_N])^2} = \frac{\mathbb{E}_{\mathbf{J}}[A_N^2] - (\mathbb{E}_{\mathbf{J}}[A_N])^2}{(\mathbb{E}_{\mathbf{J}}[A_N])^2} \xrightarrow{N \to \infty} 0
  • Strong Self-Averaging: RA(N)=O(N1)R_A(N) = \mathcal{O}(N^{-1}).
  • Weak Self-Averaging: RA(N)=O(Nα)R_A(N) = \mathcal{O}(N^{-\alpha}) with 0<α<10 < \alpha < 1 (typical at critical points).
  • Non-Self-Averaging: RA(N)=O(1)R_A(N) = \mathcal{O}(1) as NN \to \infty (signals broken ergodicity or replica symmetry breaking).

3.2 Quenched vs. Annealed Averages

When averaging thermodynamic quantities over disorder D={xi,yi}i=1n\mathcal{D} = \{\mathbf{x}_i, y_i\}_{i=1}^n or random weights W\mathbf{W}:

1. Annealed Average (Disorder in Thermal Equilibrium)

The disorder degrees of freedom fluctuate on the same timescale as the system variables:

Fann=1βlnED[Z(D)]=1βlndDP(D)dweβH(w;D)F_{\mathrm{ann}} = -\frac{1}{\beta} \ln \mathbb{E}_{\mathcal{D}}[Z(\mathcal{D})] = -\frac{1}{\beta} \ln \int d\mathcal{D} P(\mathcal{D}) \int d\mathbf{w} \, e^{-\beta \mathcal{H}(\mathbf{w}; \mathcal{D})}

2. Quenched Average (Frozen Disorder)

The disorder is fixed permanently, and the system reaches thermal equilibrium for that specific realization:

Fquenched=1βED[lnZ(D)]=1βdDP(D)ln(dweβH(w;D))F_{\mathrm{quenched}} = -\frac{1}{\beta} \mathbb{E}_{\mathcal{D}}[\ln Z(\mathcal{D})] = -\frac{1}{\beta} \int d\mathcal{D} P(\mathcal{D}) \ln \left( \int d\mathbf{w} \, e^{-\beta \mathcal{H}(\mathbf{w}; \mathcal{D})} \right)

By Jensen's inequality, since the logarithm is strictly concave:

E[lnZ]lnE[Z]    FquenchedFann\mathbb{E}[\ln Z] \le \ln \mathbb{E}[Z] \implies F_{\mathrm{quenched}} \ge F_{\mathrm{ann}}

In deep learning, the dataset D\mathcal{D} and the random initialization W0\mathbf{W}_0 act as quenched disorder. Because the training loss is self-averaging in the wide limit, the quenched free energy equals the typical free energy of a single randomly initialized network.


4. The Infinite-Width Limit: Neural Network Gaussian Processes (NNGP)

In 1995, Radford Neal proved that single-hidden-layer Bayesian neural networks converge to Gaussian Processes as width NN \to \infty. In 2018, Lee et al. and Matthews et al. extended this result to deep multi-layer architectures.

4.1 Multi-Layer Perceptron Setup

Consider an LL-hidden-layer fully connected neural network defined recursively:

fi(1)(x)=j=1d0Wij(1)xj+bi(1)hi(l)(x)=σ(fi(l)(x)),l=1,,Lfi(l+1)(x)=σwNlj=1NlWij(l+1)hj(l)(x)+σbbi(l+1)\begin{aligned} f^{(1)}_i(\mathbf{x}) &= \sum_{j=1}^{d_0} W^{(1)}_{ij} x_j + b^{(1)}_i \\ h^{(l)}_i(\mathbf{x}) &= \sigma\left( f^{(l)}_i(\mathbf{x}) \right), \quad l = 1, \dots, L \\ f^{(l+1)}_i(\mathbf{x}) &= \frac{\sigma_w}{\sqrt{N_l}} \sum_{j=1}^{N_l} W^{(l+1)}_{ij} h^{(l)}_j(\mathbf{x}) + \sigma_b b^{(l+1)}_i \end{aligned}

Where:

  • xRd0\mathbf{x} \in \mathbb{R}^{d_0} is the input vector.
  • NlN_l is the width (number of neurons) of layer ll.
  • Wij(l)i.i.d.N(0,1)W^{(l)}_{ij} \overset{\mathrm{i.i.d.}}{\sim} \mathcal{N}(0, 1) are Gaussian weights scaled by σwNl\frac{\sigma_w}{\sqrt{N_l}}.
  • bi(l)i.i.d.N(0,1)b^{(l)}_i \overset{\mathrm{i.i.d.}}{\sim} \mathcal{N}(0, 1) are Gaussian biases scaled by σb\sigma_b.
  • σ:RR\sigma: \mathbb{R} \to \mathbb{R} is a non-linear activation function (e.g., ReLU, GeLU, erf).

4.2 Step-by-Step Induction for NNGP Convergence

We prove by induction on layer index ll that for any finite collection of inputs {x1,,xk}\{\mathbf{x}_1, \dots, \mathbf{x}_k\}, the joint pre-activations (fi(l)(x1),,fi(l)(xk))\left( f^{(l)}_i(\mathbf{x}_1), \dots, f^{(l)}_i(\mathbf{x}_k) \right) converge in distribution to a zero-mean multivariate Gaussian as N1,,Nl1N_1, \dots, N_{l-1} \to \infty.

Base Case: Layer l=1l = 1

For any input x\mathbf{x}, the pre-activation is:

fi(1)(x)=j=1d0Wij(1)xj+σbbi(1)f^{(1)}_i(\mathbf{x}) = \sum_{j=1}^{d_0} W^{(1)}_{ij} x_j + \sigma_b b^{(1)}_i

Since Wij(1)W^{(1)}_{ij} and bi(1)b^{(1)}_i are independent Gaussians, fi(1)(x)f^{(1)}_i(\mathbf{x}) is an exact linear combination of independent zero-mean Gaussians. For any two inputs x,x\mathbf{x}, \mathbf{x}':

E[fi(1)(x)]=0\mathbb{E}[f^{(1)}_i(\mathbf{x})] = 0 K(1)(x,x)E[fi(1)(x)fi(1)(x)]=j=1d0k=1d0xjxkE[Wij(1)Wik(1)]+σb2E[bi(1)bi(1)]=σw2d0xx+σb2\begin{aligned} \mathcal{K}^{(1)}(\mathbf{x}, \mathbf{x}') &\equiv \mathbb{E}\left[ f^{(1)}_i(\mathbf{x}) f^{(1)}_i(\mathbf{x}') \right] \\ &= \sum_{j=1}^{d_0} \sum_{k=1}^{d_0} x_j x'_k \, \mathbb{E}[W^{(1)}_{ij} W^{(1)}_{ik}] + \sigma_b^2 \mathbb{E}[b^{(1)}_i b^{(1)}_i] \\ &= \frac{\sigma_w^2}{d_0} \mathbf{x}^\top \mathbf{x}' + \sigma_b^2 \end{aligned}

For distinct neurons iii \neq i', E[fi(1)(x)fi(1)(x)]=0\mathbb{E}[f^{(1)}_i(\mathbf{x}) f^{(1)}_{i'}(\mathbf{x}')] = 0. Thus, fi(1)GP(0,K(1))f^{(1)}_i \sim \mathcal{GP}(0, \mathcal{K}^{(1)}) independently for each ii.

Inductive Step: Layer ll+1l \to l+1

Assume that as Nl1N_{l-1} \to \infty, the pre-activations (f1(l),,fNl(l))\left( f^{(l)}_1, \dots, f^{(l)}_{N_l} \right) are i.i.d. draws from a zero-mean Gaussian Process with covariance K(l)(x,x)\mathcal{K}^{(l)}(\mathbf{x}, \mathbf{x}').

Conditioned on the previous layer activations hj(l)(x)=σ(fj(l)(x))h^{(l)}_j(\mathbf{x}) = \sigma(f^{(l)}_j(\mathbf{x})), the pre-activation of neuron ii at layer l+1l+1 is:

fi(l+1)(x)=σwNlj=1NlWij(l+1)hj(l)(x)+σbbi(l+1)f^{(l+1)}_i(\mathbf{x}) = \frac{\sigma_w}{\sqrt{N_l}} \sum_{j=1}^{N_l} W^{(l+1)}_{ij} h^{(l)}_j(\mathbf{x}) + \sigma_b b^{(l+1)}_i

Conditioned on h(l)h^{(l)}, fi(l+1)(x)f^{(l+1)}_i(\mathbf{x}) is a sum of NlN_l independent random terms:

ζj(x)σwNlWij(l+1)hj(l)(x)\zeta_j(\mathbf{x}) \equiv \frac{\sigma_w}{\sqrt{N_l}} W^{(l+1)}_{ij} h^{(l)}_j(\mathbf{x})

The conditional mean is zero: E[ζj(x)h(l)]=0\mathbb{E}[\zeta_j(\mathbf{x}) \mid h^{(l)}] = 0. The conditional covariance is:

Cov(fi(l+1)(x),fi(l+1)(x)|h(l))=σb2+σw2Nlj=1Nlk=1Nlhj(l)(x)hk(l)(x)E[Wij(l+1)Wik(l+1)]=σb2+σw2(1Nlj=1Nlhj(l)(x)hj(l)(x))=σb2+σw2(1Nlj=1Nlσ(fj(l)(x))σ(fj(l)(x)))\begin{aligned} \operatorname{Cov}\left( f^{(l+1)}_i(\mathbf{x}), f^{(l+1)}_i(\mathbf{x}') \,\middle|\, h^{(l)} \right) &= \sigma_b^2 + \frac{\sigma_w^2}{N_l} \sum_{j=1}^{N_l} \sum_{k=1}^{N_l} h^{(l)}_j(\mathbf{x}) h^{(l)}_k(\mathbf{x}') \, \mathbb{E}\left[ W^{(l+1)}_{ij} W^{(l+1)}_{ik} \right] \\ &= \sigma_b^2 + \sigma_w^2 \left( \frac{1}{N_l} \sum_{j=1}^{N_l} h^{(l)}_j(\mathbf{x}) h^{(l)}_j(\mathbf{x}') \right) \\ &= \sigma_b^2 + \sigma_w^2 \left( \frac{1}{N_l} \sum_{j=1}^{N_l} \sigma(f^{(l)}_j(\mathbf{x})) \sigma(f^{(l)}_j(\mathbf{x}')) \right) \end{aligned}

By the Strong Law of Large Numbers, as the width NlN_l \to \infty, the empirical average over neurons converges almost surely to the statistical expectation:

1Nlj=1Nlσ(fj(l)(x))σ(fj(l)(x))a.s.Ef(l)GP(0,K(l))[σ(f(l)(x))σ(f(l)(x))]\frac{1}{N_l} \sum_{j=1}^{N_l} \sigma(f^{(l)}_j(\mathbf{x})) \sigma(f^{(l)}_j(\mathbf{x}')) \xrightarrow{\text{a.s.}} \mathbb{E}_{f^{(l)} \sim \mathcal{GP}(0, \mathcal{K}^{(l)})}\left[ \sigma(f^{(l)}(\mathbf{x})) \sigma(f^{(l)}(\mathbf{x}')) \right]

By the Multidimensional Central Limit Theorem, fi(l+1)(x)f^{(l+1)}_i(\mathbf{x}) converges in distribution to an unconditional zero-mean Gaussian process fi(l+1)GP(0,K(l+1))f^{(l+1)}_i \sim \mathcal{GP}(0, \mathcal{K}^{(l+1)}) with recursive kernel:

NNGP Kernel Master Recursion Formula

K(l+1)(x,x)=σb2+σw2Tσ(K(l)(x,x),K(l)(x,x),K(l)(x,x))\mathcal{K}^{(l+1)}(\mathbf{x}, \mathbf{x}') = \sigma_b^2 + \sigma_w^2 \mathcal{T}_\sigma\left( \mathcal{K}^{(l)}(\mathbf{x}, \mathbf{x}), \mathcal{K}^{(l)}(\mathbf{x}', \mathbf{x}'), \mathcal{K}^{(l)}(\mathbf{x}, \mathbf{x}') \right)

where the functional map Tσ\mathcal{T}_\sigma is defined as:

Tσ(K11,K22,K12)R2σ(u)σ(v)exp(12(uv)(K11K12K12K22)1(uv))2πK11K22K122dudv\mathcal{T}_\sigma(K_{11}, K_{22}, K_{12}) \equiv \int_{\mathbb{R}^2} \sigma(u) \sigma(v) \, \frac{\exp\left( -\frac{1}{2} \begin{pmatrix} u \\ v \end{pmatrix}^\top \begin{pmatrix} K_{11} & K_{12} \\ K_{12} & K_{22} \end{pmatrix}^{-1} \begin{pmatrix} u \\ v \end{pmatrix} \right)}{2\pi \sqrt{K_{11} K_{22} - K_{12}^2}} \, du \, dv

4.3 Closed-Form Analytical Kernels: The Arc-Cosine / ReLU Case

For the Rectified Linear Unit (ReLU) activation σ(z)=max(0,z)\sigma(z) = \max(0, z), Cho and Saul (2009) derived the exact closed-form evaluation of TReLU\mathcal{T}_{\mathrm{ReLU}}.

Let u,vN(0,(KxxKxxKxxKxx))u, v \sim \mathcal{N}\left( \mathbf{0}, \begin{pmatrix} K_{xx} & K_{xx'} \\ K_{xx'} & K_{x'x'} \end{pmatrix} \right). Define the correlation angle:

θarccos(KxxKxxKxx),θ[0,π]\theta \equiv \arccos\left( \frac{K_{xx'}}{\sqrt{K_{xx} K_{x'x'}}} \right), \quad \theta \in [0, \pi]

Using polar transformation u=Kxxrcosϕu = \sqrt{K_{xx}} r \cos \phi, v=Kxxrcos(ϕθ)v = \sqrt{K_{x'x'}} r \cos(\phi - \theta):

TReLU(Kxx,Kxx,Kxx)=KxxKxx2π[sinθ+(πθ)cosθ]=KxxKxx2π[1(KxxKxxKxx)2+(πarccosKxxKxxKxx)KxxKxxKxx]\begin{aligned} \mathcal{T}_{\mathrm{ReLU}}(K_{xx}, K_{x'x'}, K_{xx'}) &= \frac{\sqrt{K_{xx} K_{x'x'}}}{2\pi} \left[ \sin \theta + (\pi - \theta) \cos \theta \right] \\ &= \frac{\sqrt{K_{xx} K_{x'x'}}}{2\pi} \left[ \sqrt{1 - \left(\frac{K_{xx'}}{\sqrt{K_{xx} K_{x'x'}}}\right)^2} + \left( \pi - \arccos\frac{K_{xx'}}{\sqrt{K_{xx} K_{x'x'}}} \right) \frac{K_{xx'}}{\sqrt{K_{xx} K_{x'x'}}} \right] \end{aligned}

For the derivative kernel K˙(l)(x,x)σw2E[σ(u)σ(v)]\dot{\mathcal{K}}^{(l)}(\mathbf{x}, \mathbf{x}') \equiv \sigma_w^2 \mathbb{E}[\sigma'(u) \sigma'(v)] (where σ(z)=Θ(z)\sigma'(z) = \Theta(z) is the Heaviside step function):

T˙ReLU(Kxx,Kxx,Kxx)=12π(πθ)=12π(πarccosKxxKxxKxx)\dot{\mathcal{T}}_{\mathrm{ReLU}}(K_{xx}, K_{x'x'}, K_{xx'}) = \frac{1}{2\pi} (\pi - \theta) = \frac{1}{2\pi} \left( \pi - \arccos\frac{K_{xx'}}{\sqrt{K_{xx} K_{x'x'}}} \right)

5. Dynamic Thermodynamic Limit: The Neural Tangent Kernel (NTK)

While the NNGP describes Bayesian neural networks at initialization, real neural networks are trained with gradient descent. Jacot, Gabriel, and Hongler (NeurIPS 2018) discovered that in the infinite-width limit, gradient descent dynamics become entirely linear and analytically solvable through the Neural Tangent Kernel (NTK).

df(xtest)dt=Θ(xtest,Xtrain)(f(Xtrain)y)\frac{df(x_{\text{test}})}{dt} = -\Theta(x_{\text{test}}, X_{\text{train}}) \left( f(X_{\text{train}}) - y \right)

5.1 Derivation of Continuous-Time Gradient Flow

Let f(x;θ)f(\mathbf{x}; \boldsymbol{\theta}) be the neural network output parameterized by θRP\boldsymbol{\theta} \in \mathbb{R}^P. We train on a dataset D={(xi,yi)}i=1n\mathcal{D} = \{(\mathbf{x}_i, y_i)\}_{i=1}^n with Mean Squared Error (MSE) loss:

L(θ)=12i=1n(f(xi;θ)yi)2\mathcal{L}(\boldsymbol{\theta}) = \frac{1}{2} \sum_{i=1}^n \left( f(\mathbf{x}_i; \boldsymbol{\theta}) - y_i \right)^2

Under continuous-time gradient descent (dθtdt=ηθL(θt)\frac{d\boldsymbol{\theta}_t}{dt} = -\eta \nabla_{\boldsymbol{\theta}} \mathcal{L}(\boldsymbol{\theta}_t) with learning rate η\eta):

dθtdt=ηi=1n(f(xi;θt)yi)θf(xi;θt)\frac{d\boldsymbol{\theta}_t}{dt} = -\eta \sum_{i=1}^n \left( f(\mathbf{x}_i; \boldsymbol{\theta}_t) - y_i \right) \nabla_{\boldsymbol{\theta}} f(\mathbf{x}_i; \boldsymbol{\theta}_t)

By the multivariate chain rule, the time derivative of the network output at an arbitrary query point x\mathbf{x} is:

df(x;θt)dt=(θf(x;θt))dθtdt=ηi=1n[θf(x;θt)θf(xi;θt)](f(xi;θt)yi)\begin{aligned} \frac{d f(\mathbf{x}; \boldsymbol{\theta}_t)}{dt} &= \left( \nabla_{\boldsymbol{\theta}} f(\mathbf{x}; \boldsymbol{\theta}_t) \right)^\top \frac{d\boldsymbol{\theta}_t}{dt} \\ &= -\eta \sum_{i=1}^n \left[ \nabla_{\boldsymbol{\theta}} f(\mathbf{x}; \boldsymbol{\theta}_t)^\top \nabla_{\boldsymbol{\theta}} f(\mathbf{x}_i; \boldsymbol{\theta}_t) \right] \left( f(\mathbf{x}_i; \boldsymbol{\theta}_t) - y_i \right) \end{aligned}

Definition: Empirical Neural Tangent Kernel

The empirical Neural Tangent Kernel (NTK) at time tt is the inner product of network gradients in parameter space:

Θ^t(x,x)θf(x;θt),θf(x;θt)=p=1Pf(x;θt)θpf(x;θt)θp\hat{\Theta}_t(\mathbf{x}, \mathbf{x}') \equiv \left\langle \nabla_{\boldsymbol{\theta}} f(\mathbf{x}; \boldsymbol{\theta}_t), \nabla_{\boldsymbol{\theta}} f(\mathbf{x}'; \boldsymbol{\theta}_t) \right\rangle = \sum_{p=1}^P \frac{\partial f(\mathbf{x}; \boldsymbol{\theta}_t)}{\partial \theta_p} \frac{\partial f(\mathbf{x}'; \boldsymbol{\theta}_t)}{\partial \theta_p}

In vector notation across the training set XRn×d0\mathbf{X} \in \mathbb{R}^{n \times d_0} with predictions ft=f(X;θt)Rn\mathbf{f}_t = f(\mathbf{X}; \boldsymbol{\theta}_t) \in \mathbb{R}^n and labels yRn\mathbf{y} \in \mathbb{R}^n:

dftdt=ηΘ^t(X,X)(fty)\frac{d \mathbf{f}_t}{dt} = -\eta \hat{\boldsymbol{\Theta}}_t(\mathbf{X}, \mathbf{X}) (\mathbf{f}_t - \mathbf{y})

5.2 The Two Pillars of Infinite-Width NTK Theory

As the widths N1,,NLN_1, \dots, N_L \to \infty:

1. Self-Averaging at Initialization (t=0t = 0)

The empirical kernel converges in probability to a deterministic, invariant kernel Θ\mathbf{\Theta}_\infty:

Θ^0(x,x)PΘ(x,x)as N\hat{\Theta}_0(\mathbf{x}, \mathbf{x}') \xrightarrow{P} \Theta_\infty(\mathbf{x}, \mathbf{x}') \quad \text{as } N \to \infty

2. Kernel Freeze / Lazy Training Regime (t>0t > 0)

Throughout gradient descent training, the parameters move by at most θtθ0=O(1/N)\|\boldsymbol{\theta}_t - \boldsymbol{\theta}_0\| = \mathcal{O}(1/\sqrt{N}). The relative change in the empirical tangent kernel is strictly bounded:

supt0Θ^tΘ^0F=O(1N)N0\sup_{t \ge 0} \left\| \hat{\boldsymbol{\Theta}}_t - \hat{\boldsymbol{\Theta}}_0 \right\|_F = \mathcal{O}\left(\frac{1}{\sqrt{N}}\right) \xrightarrow{N \to \infty} 0

Because Θ^tΘ\hat{\boldsymbol{\Theta}}_t \equiv \mathbf{\Theta}_\infty is constant in time, the non-linear gradient flow reduces to a linear ordinary differential equation:

dftdt=ηΘ(fty)\frac{d \mathbf{f}_t}{dt} = -\eta \mathbf{\Theta}_\infty (\mathbf{f}_t - \mathbf{y})

Subtracting y\mathbf{y} from both sides:

d(fty)dt=ηΘ(fty)    fty=exp(ηΘt)(f0y)\frac{d(\mathbf{f}_t - \mathbf{y})}{dt} = -\eta \mathbf{\Theta}_\infty (\mathbf{f}_t - \mathbf{y}) \implies \mathbf{f}_t - \mathbf{y} = \exp\left( -\eta \mathbf{\Theta}_\infty t \right) (\mathbf{f}_0 - \mathbf{y})

ft(Xtrain)=y+eηΘtraint(f0(Xtrain)y)f_t(X_{\text{train}}) = y + e^{-\eta \Theta_{\text{train}} t} (f_0(X_{\text{train}}) - y)

At convergence (tt \to \infty), assuming Θ(X,X)\mathbf{\Theta}_\infty(\mathbf{X}, \mathbf{X}) is strictly positive definite:

Theorem: Closed-Form Infinite-Width Predictor

f(x)=f0(x)+Θ(x,X)Θ(X,X)1(yf0(X))f_\infty(\mathbf{x}^*) = f_0(\mathbf{x}^*) + \mathbf{\Theta}_\infty(\mathbf{x}^*, \mathbf{X}) \mathbf{\Theta}_\infty(\mathbf{X}, \mathbf{X})^{-1} \left( \mathbf{y} - f_0(\mathbf{X}) \right)

Under Gaussian initialization f0GP(0,KNNGP)f_0 \sim \mathcal{GP}(0, \mathcal{K}_{\mathrm{NNGP}}), the ensemble prediction is:

Eθ0[f(x)]=Θ(x,X)Θ(X,X)1y\mathbb{E}_{\boldsymbol{\theta}_0}[f_\infty(\mathbf{x}^*)] = \mathbf{\Theta}_\infty(\mathbf{x}^*, \mathbf{X}) \mathbf{\Theta}_\infty(\mathbf{X}, \mathbf{X})^{-1} \mathbf{y}

5.3 Step-by-Step Derivation of the Recursive NTK Formula

We derive the exact recursive expression for Θ(L+1)(x,x)\Theta^{(L+1)}(\mathbf{x}, \mathbf{x}') across hidden layers.

Recall the parameter set θ=l=1L+1{W(l),b(l)}\boldsymbol{\theta} = \bigcup_{l=1}^{L+1} \{ \mathbf{W}^{(l)}, \mathbf{b}^{(l)} \}. The empirical NTK decomposes as a sum of layer-wise contributions:

Θ^(L+1)(x,x)=l=1L+1[f(x)W(l),f(x)W(l)+f(x)b(l),f(x)b(l)]\hat{\Theta}^{(L+1)}(\mathbf{x}, \mathbf{x}') = \sum_{l=1}^{L+1} \left[ \left\langle \frac{\partial f(\mathbf{x})}{\partial \mathbf{W}^{(l)}}, \frac{\partial f(\mathbf{x}')}{\partial \mathbf{W}^{(l)}} \right\rangle + \left\langle \frac{\partial f(\mathbf{x})}{\partial \mathbf{b}^{(l)}}, \frac{\partial f(\mathbf{x}')}{\partial \mathbf{b}^{(l)}} \right\rangle \right]

Let f(x)f(L+1)(x)f(\mathbf{x}) \equiv f^{(L+1)}(\mathbf{x}). By backpropagation:

f(x)Wij(l+1)=f(x)fi(l+1)(x)fi(l+1)(x)Wij(l+1)=δi(l+1)(x)σwNlhj(l)(x)\frac{\partial f(\mathbf{x})}{\partial W^{(l+1)}_{ij}} = \frac{\partial f(\mathbf{x})}{\partial f^{(l+1)}_i(\mathbf{x})} \frac{\partial f^{(l+1)}_i(\mathbf{x})}{\partial W^{(l+1)}_{ij}} = \delta^{(l+1)}_i(\mathbf{x}) \frac{\sigma_w}{\sqrt{N_l}} h^{(l)}_j(\mathbf{x})

where δi(l)(x)f(x)fi(l)(x)\delta^{(l)}_i(\mathbf{x}) \equiv \frac{\partial f(\mathbf{x})}{\partial f^{(l)}_i(\mathbf{x})}. The backward recursion is:

δj(l)(x)=k=1Nl+1δk(l+1)(x)σwNlWkj(l+1)σ(fj(l)(x))\delta^{(l)}_j(\mathbf{x}) = \sum_{k=1}^{N_{l+1}} \delta^{(l+1)}_k(\mathbf{x}) \frac{\sigma_w}{\sqrt{N_l}} W^{(l+1)}_{kj} \sigma'\left( f^{(l)}_j(\mathbf{x}) \right)

Evaluating the inner product for weight matrix W(l+1)\mathbf{W}^{(l+1)}:

f(x)W(l+1),f(x)W(l+1)=i=1Nl+1j=1Nl(δi(l+1)(x)σwNlhj(l)(x))(δi(l+1)(x)σwNlhj(l)(x))=σw2(i=1Nl+1δi(l+1)(x)δi(l+1)(x))(1Nlj=1Nlhj(l)(x)hj(l)(x))\begin{aligned} \left\langle \frac{\partial f(\mathbf{x})}{\partial \mathbf{W}^{(l+1)}}, \frac{\partial f(\mathbf{x}')}{\partial \mathbf{W}^{(l+1)}} \right\rangle &= \sum_{i=1}^{N_{l+1}} \sum_{j=1}^{N_l} \left( \delta^{(l+1)}_i(\mathbf{x}) \frac{\sigma_w}{\sqrt{N_l}} h^{(l)}_j(\mathbf{x}) \right) \left( \delta^{(l+1)}_i(\mathbf{x}') \frac{\sigma_w}{\sqrt{N_l}} h^{(l)}_j(\mathbf{x}') \right) \\ &= \sigma_w^2 \left( \sum_{i=1}^{N_{l+1}} \delta^{(l+1)}_i(\mathbf{x}) \delta^{(l+1)}_i(\mathbf{x}') \right) \left( \frac{1}{N_l} \sum_{j=1}^{N_l} h^{(l)}_j(\mathbf{x}) h^{(l)}_j(\mathbf{x}') \right) \end{aligned}

In the infinite-width limit:

  1. The forward term converges to the NNGP kernel: 1Nlj=1Nlhj(l)(x)hj(l)(x)a.s.K(l)(x,x)\frac{1}{N_l} \sum_{j=1}^{N_l} h^{(l)}_j(\mathbf{x}) h^{(l)}_j(\mathbf{x}') \xrightarrow{\text{a.s.}} \mathcal{K}^{(l)}(\mathbf{x}, \mathbf{x}')
  2. The backward term satisfies the recursive relation: j=1Nlδj(l)(x)δj(l)(x)a.s.K˙(l)(x,x)(k=1Nl+1δk(l+1)(x)δk(l+1)(x))\sum_{j=1}^{N_l} \delta^{(l)}_j(\mathbf{x}) \delta^{(l)}_j(\mathbf{x}') \xrightarrow{\text{a.s.}} \dot{\mathcal{K}}^{(l)}(\mathbf{x}, \mathbf{x}') \left( \sum_{k=1}^{N_{l+1}} \delta^{(l+1)}_k(\mathbf{x}) \delta^{(l+1)}_k(\mathbf{x}') \right)

Combining forward and backward recursions produces the NTK Master Recursion Formula:

Theorem: NTK Layer Recursion

For a deep network of depth LL, the NTK at layer l+1l+1 is related to layer ll by:

Θ(l+1)(x,x)=Θ(l)(x,x)K˙(l+1)(x,x)+K(l+1)(x,x)\Theta^{(l+1)}(\mathbf{x}, \mathbf{x}') = \Theta^{(l)}(\mathbf{x}, \mathbf{x}') \dot{\mathcal{K}}^{(l+1)}(\mathbf{x}, \mathbf{x}') + \mathcal{K}^{(l+1)}(\mathbf{x}, \mathbf{x}')

with base condition Θ(1)(x,x)=K(1)(x,x)=σw2d0xx+σb2\Theta^{(1)}(\mathbf{x}, \mathbf{x}') = \mathcal{K}^{(1)}(\mathbf{x}, \mathbf{x}') = \frac{\sigma_w^2}{d_0} \mathbf{x}^\top \mathbf{x}' + \sigma_b^2.


6. Quantitative Non-Asymptotic Rates: Eldan, Mikulincer & Schramm (COLT 2021)

While classical NNGP and NTK theorems assert that neural networks converge to Gaussian processes as NN \to \infty, physical and engineering implementations operate at finite width N<N < \infty. How fast does this convergence occur in function space?

Ronen Eldan, Dan Mikulincer, and Tselil Schramm (COLT 2021) established the first non-asymptotic, quantitative convergence rates in transportation distance.

6.1 Function Space Transportation Metrics

Let C(Sd1)\mathcal{C}(\mathbb{S}^{d-1}) be the Banach space of continuous functions on the unit sphere equipped with the supremum norm f=supxSd1f(x)\|f\|_\infty = \sup_{\mathbf{x} \in \mathbb{S}^{d-1}} |f(\mathbf{x})|.

The Wasserstein-1 (Kantorovich-Rubinstein) distance between the law of a finite-width network μN=Law(fN)\mu_N = \operatorname{Law}(f_N) and the Gaussian process measure γ=GP(0,K)\gamma = \mathcal{GP}(0, \mathcal{K}) is:

W1(μN,γ)supΨ:C(Sd1)RΨLip1EfμN[Ψ(f)]Egγ[Ψ(g)]\mathcal{W}_1(\mu_N, \gamma) \equiv \sup_{\substack{\Psi: \mathcal{C}(\mathbb{S}^{d-1}) \to \mathbb{R} \\ \|\Psi\|_{\mathrm{Lip}} \le 1}} \left| \mathbb{E}_{f \sim \mu_N}[\Psi(f)] - \mathbb{E}_{g \sim \gamma}[\Psi(g)] \right|

where ΨLip=supfgΨ(f)Ψ(g)fg1\|\Psi\|_{\mathrm{Lip}} = \sup_{f \neq g} \frac{|\Psi(f) - \Psi(g)|}{\|f - g\|_\infty} \le 1.


6.2 The Eldan-Mikulincer-Schramm Convergence Theorem

Theorem: Eldan, Mikulincer & Schramm (COLT 2021)

Let fN(x)=1Ni=1Naiσ(wix)f_N(\mathbf{x}) = \frac{1}{\sqrt{N}} \sum_{i=1}^N a_i \sigma(\mathbf{w}_i^\top \mathbf{x}) be a random two-layer neural network with wiN(0,Id)\mathbf{w}_i \sim \mathcal{N}(\mathbf{0}, \mathbf{I}_d) and aiN(0,1)a_i \sim \mathcal{N}(0, 1) independent.

  1. Non-Polynomial Smooth Activations: If σC3(R)\sigma \in C^3(\mathbb{R}) is non-polynomial with bounded derivatives, then there exists a constant C(d,σ)<C(d, \sigma) < \infty such that:
W1(Law(fN),GP(0,K))C(d,σ)N\mathcal{W}_1\left( \operatorname{Law}(f_N), \mathcal{GP}(0, \mathcal{K}) \right) \le \frac{C(d, \sigma)}{\sqrt{N}}
  1. Polynomial Activations: If σ(z)=k=0pckHek(z)\sigma(z) = \sum_{k=0}^p c_k \operatorname{He}_k(z) is a polynomial of degree pp expressed in the Hermite polynomial basis Hek\operatorname{He}_k, then:
W1(Law(fN),GP(0,K))C(d,p)p5/2N\mathcal{W}_1\left( \operatorname{Law}(f_N), \mathcal{GP}(0, \mathcal{K}) \right) \le C(d, p) \frac{p^{5/2}}{\sqrt{N}}

6.3 Proof Strategy via Infinite-Dimensional Malliavin-Stein Exchangeable Pairs

The proof constructs an exchangeable pair (fN,fN)(f_N, f_N') by resampling a single hidden neuron iUniform({1,,N})i^* \sim \operatorname{Uniform}(\{1, \dots, N\}) with fresh parameters (wi,ai)(\mathbf{w}'_{i^*}, a'_{i^*}).

The conditional change in the network function is:

E[fNfNfN]=1NfN\mathbb{E}[f_N' - f_N \mid f_N] = -\frac{1}{N} f_N

By constructing an infinite-dimensional Stein operator AΨ(f)=ΔKΨ(f)f,Ψ(f)H\mathcal{A} \Psi(f) = \Delta_{\mathcal{K}} \Psi(f) - \langle f, \nabla \Psi(f) \rangle_{\mathcal{H}} on the Reproducing Kernel Hilbert Space (RKHS) H\mathcal{H}, the error decomposes into second-order operator fluctuations bounded by O(N1/2)\mathcal{O}(N^{-1/2}) via the classical Berry-Esseen inequality on Hilbert spaces.

This proves that the relative error of approximating a finite-width network by its Gaussian process limit scales precisely as:

Approximation ErrorO(1N)\text{Approximation Error} \sim \mathcal{O}\left( \frac{1}{\sqrt{N}} \right)

matching the thermodynamic fluctuation rate of physical ensembles.


7. Asymptotic Variance and Mini-Batch SGD under LLN/CLT

Stochastic Gradient Descent (SGD) introduces a second layer of large-number asymptotics: sampling mini-batches Bt{1,,n}B_t \subset \{1, \dots, n\} from a training dataset of size nn.

LB(θ)=L(θ)+ξt,E[ξt]=0,Cov(ξt)=Σ(θ)B\nabla L_B(\theta) = \nabla L(\theta) + \xi_t, \quad \mathbb{E}[\xi_t] = 0, \quad \text{Cov}(\xi_t) = \frac{\Sigma(\theta)}{B}

7.1 The Mini-Batch Central Limit Theorem

At parameter state θ\boldsymbol{\theta}, let i(θ)\nabla \ell_i(\boldsymbol{\theta}) be the gradient on datapoint ii. The full dataset gradient is L(θ)=1ni=1ni(θ)\nabla \mathcal{L}(\boldsymbol{\theta}) = \frac{1}{n} \sum_{i=1}^n \nabla \ell_i(\boldsymbol{\theta}).

When we draw a mini-batch B{1,,n}B \subset \{1, \dots, n\} of size B=b|B| = b uniformly with replacement, the mini-batch gradient is:

gB(θ)=1bkBk(θ)\mathbf{g}_B(\boldsymbol{\theta}) = \frac{1}{b} \sum_{k \in B} \nabla \ell_k(\boldsymbol{\theta})

By the Multidimensional Central Limit Theorem, as batch size bb \to \infty with bnb \ll n:

b(gB(θ)L(θ))dN(0,Σ(θ))\sqrt{b} \left( \mathbf{g}_B(\boldsymbol{\theta}) - \nabla \mathcal{L}(\boldsymbol{\theta}) \right) \xrightarrow{d} \mathcal{N}\left( \mathbf{0}, \mathbf{\Sigma}(\boldsymbol{\theta}) \right)

where Σ(θ)RP×P\mathbf{\Sigma}(\boldsymbol{\theta}) \in \mathbb{R}^{P \times P} is the empirical gradient covariance matrix:

Σ(θ)1ni=1n(i(θ)L(θ))(i(θ)L(θ))\mathbf{\Sigma}(\boldsymbol{\theta}) \equiv \frac{1}{n} \sum_{i=1}^n \left( \nabla \ell_i(\boldsymbol{\theta}) - \nabla \mathcal{L}(\boldsymbol{\theta}) \right) \left( \nabla \ell_i(\boldsymbol{\theta}) - \nabla \mathcal{L}(\boldsymbol{\theta}) \right)^\top

7.2 Continuous-Time Stochastic Differential Equation (SDE) Limit

For small learning rate η1\eta \ll 1, the discrete update θk+1=θkηgBk(θk)\boldsymbol{\theta}_{k+1} = \boldsymbol{\theta}_k - \eta \mathbf{g}_{B_k}(\boldsymbol{\theta}_k) converges weakly to the continuous Itô Stochastic Differential Equation:

dθt=L(θt)dt+ηbΣ1/2(θt)dWtd\boldsymbol{\theta}_t = -\nabla \mathcal{L}(\boldsymbol{\theta}_t) \, dt + \sqrt{\frac{\eta}{b}} \mathbf{\Sigma}^{1/2}(\boldsymbol{\theta}_t) \, d\mathbf{W}_t

where Wt\mathbf{W}_t is standard PP-dimensional Brownian motion.

Fluctuation-Dissipation Relation in SGD

Comparing this to the physical Langevin equation dxt=U(xt)dt+2kBTdWtd\mathbf{x}_t = -\nabla U(\mathbf{x}_t) dt + \sqrt{2 k_B T} d\mathbf{W}_t, we identify the effective SGD temperature:

Teff=η2bT_{\mathrm{eff}} = \frac{\eta}{2 b}
  • Increasing learning rate η\eta or decreasing batch size bb increases thermal noise.
  • The ratio ηb\frac{\eta}{b} acts as the thermodynamic temperature controlling exploration across non-convex loss valleys.
Physical Langevin SystemStochastic Gradient Descent (SGD / SGLD)Physical Correspondence
Colloid Coordinate (xx)Network Weights (θ\theta)Particle state vector
Potential Landscape (V(x)V(x))Loss Landscape (L(θ)L(\theta))Conservative potential field
Conservative Drift (V-\nabla V)Batch Gradient (L(θ)-\nabla L(\theta))Deterministic force
Solvent Collisions (Thermal Noise)Mini-batch Sampling Noise (ξt\xi_t)Stochastic fluctuation force
Effective Temperature (T=ησ22BT = \frac{\eta \sigma^2}{2B})Noise-to-Batch RatioControls exploration vs exploitation

7.3 Asymptotic Covariance: The Continuous Lyapunov Equation

Near a local minimum θ\boldsymbol{\theta}^* where L(θ)=0\nabla \mathcal{L}(\boldsymbol{\theta}^*) = \mathbf{0}, we approximate the loss by its quadratic expansion L(θ)12(θθ)H(θθ)\mathcal{L}(\boldsymbol{\theta}) \approx \frac{1}{2} (\boldsymbol{\theta} - \boldsymbol{\theta}^*)^\top \mathbf{H} (\boldsymbol{\theta} - \boldsymbol{\theta}^*), with Hessian H=2L(θ)\mathbf{H} = \nabla^2 \mathcal{L}(\boldsymbol{\theta}^*).

The linearized SDE is an Ornstein-Uhlenbeck process:

d(θtθ)=H(θtθ)dt+ηbΣ1/2dWtd(\boldsymbol{\theta}_t - \boldsymbol{\theta}^*) = -\mathbf{H} (\boldsymbol{\theta}_t - \boldsymbol{\theta}^*) \, dt + \sqrt{\frac{\eta}{b}} \mathbf{\Sigma}_*^{1/2} \, d\mathbf{W}_t

where Σ=Σ(θ)\mathbf{\Sigma}_* = \mathbf{\Sigma}(\boldsymbol{\theta}^*). The stationary covariance matrix ClimtE[(θtθ)(θtθ)]\mathbf{C} \equiv \lim_{t \to \infty} \mathbb{E}[(\boldsymbol{\theta}_t - \boldsymbol{\theta}^*)(\boldsymbol{\theta}_t - \boldsymbol{\theta}^*)^\top] satisfies the continuous Lyapunov equation:

Theorem: SGD Stationary Covariance & Lyapunov Equation

HC+CH=ηbΣ\mathbf{H} \mathbf{C} + \mathbf{C} \mathbf{H} = \frac{\eta}{b} \mathbf{\Sigma}_*

When the noise is aligned with the Hessian (Σσ02H\mathbf{\Sigma}_* \approx \sigma_0^2 \mathbf{H}):

C=ησ022bI\mathbf{C} = \frac{\eta \sigma_0^2}{2 b} \mathbf{I}

In general, using the Kronecker product C=ηb(HI+IH)1vec(Σ)\mathbf{C} = \frac{\eta}{b} \left( \mathbf{H} \otimes \mathbf{I} + \mathbf{I} \otimes \mathbf{H} \right)^{-1} \operatorname{vec}(\mathbf{\Sigma}_*).

7.4 Polyak-Ruppert Averaging and Quenched CLT (JMLR 2024–2026)

Recent works in JMLR (Li et al., 2026; Singh et al., 2025) establish quenched Central Limit Theorems for the Polyak-Ruppert tail-averaged estimator θˉT=1Tt=1Tθt\bar{\boldsymbol{\theta}}_T = \frac{1}{T} \sum_{t=1}^T \boldsymbol{\theta}_t:

T(θˉTθ)dN(0,H1ΣH1)\sqrt{T} (\bar{\boldsymbol{\theta}}_T - \boldsymbol{\theta}^*) \xrightarrow{d} \mathcal{N}\left( \mathbf{0}, \mathbf{H}^{-1} \mathbf{\Sigma}_* \mathbf{H}^{-1} \right)

Remarkably, the asymptotic variance H1ΣH1\mathbf{H}^{-1} \mathbf{\Sigma}_* \mathbf{H}^{-1} is independent of the learning rate η\eta and matches the statistical Cramér-Rao efficiency lower bound!


8. Beyond Infinite-Width: Field Theory & 1/N Expansions for Bayesian Networks

Despite its mathematical elegance, the infinite-width limit (NN \to \infty) suffers from a fundamental limitation: representations do not evolve. Because suptΘ^tΘ^00\sup_t \|\hat{\boldsymbol{\Theta}}_t - \hat{\boldsymbol{\Theta}}_0\| \to 0, the network behaves as a fixed linear kernel machine and cannot perform feature learning.

To understand feature learning, representation adaptation, and finite-size generalization, we must compute 1/N1/N perturbative corrections to the partition function (Pacelli et al., Nature Machine Intelligence 2023; Roberts, Yaida & Hanin, 2022).

Neural Network Feynman Diagrams and 1/N Propagators


8.1 The Bayesian Neural Network Partition Function

Consider a Bayesian neural network with dataset D={(xa,ya)}a=1P\mathcal{D} = \{(\mathbf{x}_a, y_a)\}_{a=1}^P. The joint posterior partition function is:

Z=dWdbP0(W,b)exp(β2a=1P(f(xa;W,b)ya)2)\mathcal{Z} = \int d\mathbf{W} \, d\mathbf{b} \, P_0(\mathbf{W}, \mathbf{b}) \exp\left( -\frac{\beta}{2} \sum_{a=1}^P \left( f(\mathbf{x}_a; \mathbf{W}, \mathbf{b}) - y_a \right)^2 \right)

where P0(W,b)=l=1Lexp(Nl2σw2Tr(W(l)W(l))12σb2b(l)2)P_0(\mathbf{W}, \mathbf{b}) = \prod_{l=1}^L \exp\left( -\frac{N_l}{2\sigma_w^2} \operatorname{Tr}(\mathbf{W}^{(l)} {\mathbf{W}^{(l)}}^\top) - \frac{1}{2\sigma_b^2} \|\mathbf{b}^{(l)}\|^2 \right) is the Gaussian prior.


8.2 The Hubbard-Stratonovich Transformation to Collective Field QabQ_{ab}

Integrating out the microscopic Gaussian weights W(l)\mathbf{W}^{(l)} introduces a collective matrix field: the empirical layer-wise Gram matrix Qab(l)1Nlj=1Nlhj(l)(xa)hj(l)(xb)Q_{ab}^{(l)} \equiv \frac{1}{N_l} \sum_{j=1}^{N_l} h^{(l)}_j(\mathbf{x}_a) h^{(l)}_j(\mathbf{x}_b).

By inserting the functional identity:

1=DQ(l)δ(NlQ(l)h(l)h(l))=DQ(l)DQ~(l)exp(iTr[Q~(l)(NlQ(l)h(l)h(l))])1 = \int \mathcal{D}\mathbf{Q}^{(l)} \, \delta\left( N_l \mathbf{Q}^{(l)} - \mathbf{h}^{(l)} {\mathbf{h}^{(l)}}^\top \right) = \int \mathcal{D}\mathbf{Q}^{(l)} \mathcal{D}\tilde{\mathbf{Q}}^{(l)} \exp\left( i \operatorname{Tr}\left[ \tilde{\mathbf{Q}}^{(l)} \left( N_l \mathbf{Q}^{(l)} - \mathbf{h}^{(l)} {\mathbf{h}^{(l)}}^\top \right) \right] \right)

the partition function transforms into an effective field theory:

Z=l=1LDQ(l)DQ~(l)exp(Seff[Q,Q~])\mathcal{Z} = \int \prod_{l=1}^L \mathcal{D}\mathbf{Q}^{(l)} \mathcal{D}\tilde{\mathbf{Q}}^{(l)} \exp\left( - S_{\mathrm{eff}}[\mathbf{Q}, \tilde{\mathbf{Q}}] \right)

where the effective action scales with layer width NN:

Seff[Q,Q~]=N(il=1LTr(Q~(l)Q(l))+l=1LWl(Q~(l),Q(l1)))+β2a=1P(faya)2S_{\mathrm{eff}}[\mathbf{Q}, \tilde{\mathbf{Q}}] = N \left( -i \sum_{l=1}^L \operatorname{Tr}(\tilde{\mathbf{Q}}^{(l)} \mathbf{Q}^{(l)}) + \sum_{l=1}^L \mathcal{W}_l(\tilde{\mathbf{Q}}^{(l)}, \mathbf{Q}^{(l-1)}) \right) + \frac{\beta}{2} \sum_{a=1}^P (f_a - y_a)^2

8.3 Saddle-Point (Mean Field) and Gaussian Free Field (NN \to \infty)

As NN \to \infty, the path integral Z=DQeNSeff[Q]\mathcal{Z} = \int \mathcal{D}\mathbf{Q} \, e^{-N S_{\mathrm{eff}}[\mathbf{Q}]} is dominated by the saddle-point condition:

δSeffδQ(l)=0,δSeffδQ~(l)=0\frac{\delta S_{\mathrm{eff}}}{\delta \mathbf{Q}^{(l)}} = 0, \quad \frac{\delta S_{\mathrm{eff}}}{\delta \tilde{\mathbf{Q}}^{(l)}} = 0

The saddle-point solution Q(l)\mathbf{Q}_*^{(l)} satisfies the deterministic recursive equation:

Q(l)=KNNGP(l)\mathbf{Q}_*^{(l)} = \mathcal{K}_{\mathrm{NNGP}}^{(l)}

At N=N = \infty, fluctuations around Q\mathbf{Q}_* vanish, recovering the Gaussian Process (free field theory).


8.4 Systematic 1/N1/N Expansion & Feynman Diagram Vertex Corrections

For large but finite width N<N < \infty, we expand the collective field Q=Q+1NδQ\mathbf{Q} = \mathbf{Q}_* + \frac{1}{\sqrt{N}} \delta \mathbf{Q}:

Seff[Q]=NS0[Q]+12δQΔ1δQ+1NV33!(δQ)3+1NV44!(δQ)4+O(N3/2)S_{\mathrm{eff}}[\mathbf{Q}] = N S_0[\mathbf{Q}_*] + \frac{1}{2} \delta \mathbf{Q}^\top \mathbf{\Delta}^{-1} \delta \mathbf{Q} + \frac{1}{\sqrt{N}} \frac{V_3}{3!} (\delta \mathbf{Q})^3 + \frac{1}{N} \frac{V_4}{4!} (\delta \mathbf{Q})^4 + \mathcal{O}(N^{-3/2})

Where:

  • Δ\mathbf{\Delta} is the Gaussian propagator (fluctuation covariance of the kernel).
  • V3V_3 is the 3-point interaction vertex (skewness).
  • V4V_4 is the 4-point interaction vertex (connected 4-point correlator / kurtosis).

Neural Network Feynman Diagrams and 1/N Propagators

The connected 4-point correlator of neuron pre-activations:

fi(xa)fi(xb)fj(xc)fj(xd)cfi(xa)fi(xb)fj(xc)fj(xd)KabKcdKacKbdKadKbc\left\langle f_i(\mathbf{x}_a) f_i(\mathbf{x}_b) f_j(\mathbf{x}_c) f_j(\mathbf{x}_d) \right\rangle_c \equiv \left\langle f_i(\mathbf{x}_a) f_i(\mathbf{x}_b) f_j(\mathbf{x}_c) f_j(\mathbf{x}_d) \right\rangle - \mathcal{K}_{ab} \mathcal{K}_{cd} - \mathcal{K}_{ac} \mathcal{K}_{bd} - \mathcal{K}_{ad} \mathcal{K}_{bc}

evaluates to:

fi(xa)fi(xb)fj(xc)fj(xd)c=1NVabcd(4)+O(1N2)\left\langle f_i(\mathbf{x}_a) f_i(\mathbf{x}_b) f_j(\mathbf{x}_c) f_j(\mathbf{x}_d) \right\rangle_c = \frac{1}{N} \mathcal{V}^{(4)}_{abcd} + \mathcal{O}\left(\frac{1}{N^2}\right)

Physical Meaning: Feature Learning via Attractive Interaction

Pacelli et al. (Nature Machine Intelligence 2023) showed that the 4-point interaction vertex V4V_4 induces an effective attractive coupling between datapoints with similar labels.

Unlike infinite-width networks where the kernel is frozen, finite-width networks dynamically deform their internal metric Q\mathbf{Q}, bringing similar representations closer together and enabling true feature learning.


9. Classical Statistical Mechanics vs. Deep Learning: Master Correspondence

The following table summarizes the structural equivalence between classical statistical mechanics and infinite-width deep learning:

Concept / QuantityClassical Statistical MechanicsModern Deep Learning / Neural Networks
Microscopic VariablesParticle positions & momenta (qi,pi)(\mathbf{q}_i, \mathbf{p}_i), spins σi\sigma_iNetwork weights Wij(l)\mathbf{W}^{(l)}_{ij}, biases bi(l)b^{(l)}_i
System SizeNumber of particles N1023N \approx 10^{23}Network width NN \to \infty, parameters P109P \gg 10^9
Microscopic MultiplicityPhase space volume Ω(E,V,N)=δ(EH)dΓ\Omega(E, V, N) = \int \delta(E - \mathcal{H}) d\GammaWeight space volume satisfying loss L(w)ϵ\mathcal{L}(\mathbf{w}) \le \epsilon
Thermodynamic LimitNN \to \infty, VV \to \infty, N/V=ρ=constN/V = \rho = \text{const}Width NN \to \infty, depth L=constL = \text{const}
Law of Large NumbersSelf-averaging of free energy f=F/Nf = F/NSelf-averaging of NTK Θ^Θ\hat{\Theta} \to \Theta_\infty, Loss L^\hat{\mathcal{L}}
Central Limit TheoremGaussian momentum distribution (Maxwell-Boltzmann)Pre-activations converge to Gaussian Process (NNGP)
Relative FluctuationsσE/E=O(N1/2)0\sigma_E / \langle E \rangle = \mathcal{O}(N^{-1/2}) \to 0Distance to GP limit W1(fN,GP)C/N\mathcal{W}_1(f_N, \mathcal{GP}) \le C / \sqrt{N}
Thermal / SGD NoiseHeat bath fluctuations 2kBTdWt\sqrt{2 k_B T} d\mathbf{W}_tMini-batch gradient noise η/bΣ1/2dWt\sqrt{\eta / b} \mathbf{\Sigma}^{1/2} d\mathbf{W}_t
TemperatureEquilibrium temperature TTEffective SGD temperature Teff=η2bT_{\mathrm{eff}} = \frac{\eta}{2b}
Mean Field TheoryCurie-Weiss mean field equation m=tanh(βzJm)m = \tanh(\beta z J m)Infinite-width NNGP / Frozen NTK dynamics
Beyond Mean FieldGinzburg-Landau Wilson action, Feynman loops1/N1/N field theory expansion, 4-point vertex, feature learning

10. Summary & Open Frontiers

Core Takeaways

  1. Large Numbers Tame Complexity: In both physical systems (102310^{23} particles) and overparameterized neural networks (NN \to \infty), microscopic randomness concentrates into deterministic macroscopic observables via the Law of Large Numbers and saddle-point integration.
  2. The NNGP & NTK Limits: At infinite width, randomly initialized neural networks are mathematically equivalent to Gaussian processes (NNGP), and their training dynamics under gradient descent linearize according to a static kernel (NTK).
  3. Finite-Width Fluctuation Theory: Finite networks converge to their infinite-width limits at a rate of O(N1/2)\mathcal{O}(N^{-1/2}) in Wasserstein-1 distance.
  4. SGD as a Thermodynamic Process: Mini-batch SGD behaves as an Ornstein-Uhlenbeck diffusion around minima with effective temperature Teff=η/(2b)T_{\mathrm{eff}} = \eta / (2b), leading to stationary covariance governed by the Lyapunov equation.
  5. Feature Learning as an Interacting Field Theory: Real deep networks learn features precisely because N<N < \infty. The 1/N1/N corrections introduce 4-point Feynman diagram interactions that deform data representations during training.

11. Practice Problems with Step-by-Step Solutions

Problem 1: Exact High-Order Stirling Expansion for the Partition Function

Consider a collection of NN independent, non-interacting classical magnetic dipoles in an external magnetic field BB. Each dipole can point either parallel (σi=+1\sigma_i = +1, energy μB-\mu B) or anti-parallel (σi=1\sigma_i = -1, energy +μB+\mu B).

  1. Write the exact microstate multiplicity Ω(E)\Omega(E) for total energy E=MμBE = -M \mu B, where M=i=1Nσi{N,N+2,,N}M = \sum_{i=1}^N \sigma_i \in \{-N, -N+2, \dots, N\}.
  2. Use Stirling's approximation including the 12ln(2πN)\frac{1}{2}\ln(2\pi N) and O(1/N)\mathcal{O}(1/N) terms to calculate the microcanonical entropy S(E)=kBlnΩ(E)S(E) = k_B \ln \Omega(E).
  3. Derive the temperature T(E)T(E) via 1T=SE\frac{1}{T} = \frac{\partial S}{\partial E} and show how finite-NN corrections shift the effective temperature.

Solution to Problem 1:

Step 1: Multiplicity
Let N+N_+ be the number of dipoles with σi=+1\sigma_i = +1 and NN_- be the number with σi=1\sigma_i = -1.

N++N=N,N+N=M=EμB    N+=NE/(μB)2,N=N+E/(μB)2N_+ + N_- = N, \quad N_+ - N_- = M = -\frac{E}{\mu B} \implies N_+ = \frac{N - E/(\mu B)}{2}, \quad N_- = \frac{N + E/(\mu B)}{2}

The multiplicity is:

Ω(E)=(NN+)=N!N+!N!\Omega(E) = \binom{N}{N_+} = \frac{N!}{N_+! \, N_-!}

Step 2: Entropy with Next-to-Leading Order Stirling Corrections
Using lnK!=KlnKK+12ln(2πK)+112K+O(K2)\ln K! = K \ln K - K + \frac{1}{2}\ln(2\pi K) + \frac{1}{12K} + \mathcal{O}(K^{-2}):

lnΩ(E)=lnN!lnN+!lnN!=NlnNN+lnN+NlnN+12ln(N2πN+N)+112(1N1N+1N)+O(N2)\begin{aligned} \ln \Omega(E) &= \ln N! - \ln N_+! - \ln N_-! \\ &= N \ln N - N_+ \ln N_+ - N_- \ln N_- + \frac{1}{2} \ln\left( \frac{N}{2\pi N_+ N_-} \right) + \frac{1}{12}\left( \frac{1}{N} - \frac{1}{N_+} - \frac{1}{N_-} \right) + \mathcal{O}(N^{-2}) \end{aligned}

Let m=M/N=E/(NμB)(1,1)m = M/N = -E / (N \mu B) \in (-1, 1), so N±=N(1±m)2N_\pm = \frac{N(1 \pm m)}{2}:

S(E)=NkB[ln21+m2ln(1+m)1m2ln(1m)]kB2ln(πN(1m2)2)kB3N(1m2)+O(N2)S(E) = N k_B \left[ \ln 2 - \frac{1+m}{2}\ln(1+m) - \frac{1-m}{2}\ln(1-m) \right] - \frac{k_B}{2}\ln\left( \frac{\pi N (1-m^2)}{2} \right) - \frac{k_B}{3N(1-m^2)} + \mathcal{O}(N^{-2})

Step 3: Temperature and Finite-Size Correction
Using mE=1NμB\frac{\partial m}{\partial E} = -\frac{1}{N \mu B}:

1T=SE=mESm=1NμB(NkB12ln(1+m1m)+kBm1m22kBm3N(1m2)2+O(N2))=kB2μBln(1+m1m)kBmNμB(1m2)+O(N2)\begin{aligned} \frac{1}{T} &= \frac{\partial S}{\partial E} = \frac{\partial m}{\partial E} \frac{\partial S}{\partial m} \\ &= -\frac{1}{N \mu B} \left( -N k_B \frac{1}{2} \ln\left( \frac{1+m}{1-m} \right) + \frac{k_B m}{1-m^2} - \frac{2 k_B m}{3N(1-m^2)^2} + \mathcal{O}(N^{-2}) \right) \\ &= \frac{k_B}{2\mu B} \ln\left( \frac{1+m}{1-m} \right) - \frac{k_B m}{N \mu B (1-m^2)} + \mathcal{O}(N^{-2}) \end{aligned}

The first term is the standard thermodynamic relation m=tanh(μBkBT)m = -\tanh\left(\frac{\mu B}{k_B T}\right). The second term shows that for finite NN, fluctuations reduce the effective magnitude of the magnetization by an order O(1/N)\mathcal{O}(1/N).


Problem 2: NTK Dynamics for Single-Sample Linear Regression

Consider training a wide neural network on a single training example (x1,y1)(\mathbf{x}_1, y_1) with MSE loss L(θ)=12(f(x1;θ)y1)2\mathcal{L}(\boldsymbol{\theta}) = \frac{1}{2}(f(\mathbf{x}_1; \boldsymbol{\theta}) - y_1)^2 using continuous gradient flow with learning rate η\eta.

  1. Derive the analytical time evolution of the residual error ϵ(t)f(x1;θt)y1\epsilon(t) \equiv f(\mathbf{x}_1; \boldsymbol{\theta}_t) - y_1.
  2. Compute the trajectory of the network prediction f(x;θt)f(\mathbf{x}^*; \boldsymbol{\theta}_t) on an arbitrary test input x\mathbf{x}^*.
  3. Express the asymptotic generalization error f(x;θ)y(x)|f(\mathbf{x}^*; \boldsymbol{\theta}_\infty) - y(\mathbf{x}^*)| in terms of the kernel alignment ratio Θ(x,x1)Θ(x1,x1)\frac{\Theta_\infty(\mathbf{x}^*, \mathbf{x}_1)}{\Theta_\infty(\mathbf{x}_1, \mathbf{x}_1)}.

Solution to Problem 2:

Step 1: Residual Dynamics
The differential equation for the single training point prediction is:

df(x1;θt)dt=ηΘ(x1,x1)(f(x1;θt)y1)\frac{d f(\mathbf{x}_1; \boldsymbol{\theta}_t)}{dt} = -\eta \Theta_\infty(\mathbf{x}_1, \mathbf{x}_1) \left( f(\mathbf{x}_1; \boldsymbol{\theta}_t) - y_1 \right)

Let ϵ(t)=f(x1;θt)y1\epsilon(t) = f(\mathbf{x}_1; \boldsymbol{\theta}_t) - y_1. Then dϵ(t)dt=ηΘ(x1,x1)ϵ(t)\frac{d\epsilon(t)}{dt} = -\eta \Theta_\infty(\mathbf{x}_1, \mathbf{x}_1) \epsilon(t), yielding:

ϵ(t)=ϵ(0)exp(ηΘ(x1,x1)t)=(f(x1;θ0)y1)eηΘ(x1,x1)t\epsilon(t) = \epsilon(0) \exp\left( -\eta \Theta_\infty(\mathbf{x}_1, \mathbf{x}_1) t \right) = (f(\mathbf{x}_1; \boldsymbol{\theta}_0) - y_1) e^{-\eta \Theta_\infty(\mathbf{x}_1, \mathbf{x}_1) t}

The training error decays exponentially with characteristic convergence time:

τ=1ηΘ(x1,x1)\tau = \frac{1}{\eta \Theta_\infty(\mathbf{x}_1, \mathbf{x}_1)}

Step 2: Test Point Trajectory
For test input x\mathbf{x}^*:

df(x;θt)dt=ηΘ(x,x1)(f(x1;θt)y1)=ηΘ(x,x1)(f(x1;θ0)y1)eηΘ(x1,x1)t\frac{d f(\mathbf{x}^*; \boldsymbol{\theta}_t)}{dt} = -\eta \Theta_\infty(\mathbf{x}^*, \mathbf{x}_1) \left( f(\mathbf{x}_1; \boldsymbol{\theta}_t) - y_1 \right) = -\eta \Theta_\infty(\mathbf{x}^*, \mathbf{x}_1) (f(\mathbf{x}_1; \boldsymbol{\theta}_0) - y_1) e^{-\eta \Theta_\infty(\mathbf{x}_1, \mathbf{x}_1) t}

Integrating from 00 to tt:

f(x;θt)=f(x;θ0)ηΘ(x,x1)(f(x1;θ0)y1)0teηΘ(x1,x1)sds=f(x;θ0)+Θ(x,x1)Θ(x1,x1)(1eηΘ(x1,x1)t)(y1f(x1;θ0))\begin{aligned} f(\mathbf{x}^*; \boldsymbol{\theta}_t) &= f(\mathbf{x}^*; \boldsymbol{\theta}_0) - \eta \Theta_\infty(\mathbf{x}^*, \mathbf{x}_1) (f(\mathbf{x}_1; \boldsymbol{\theta}_0) - y_1) \int_0^t e^{-\eta \Theta_\infty(\mathbf{x}_1, \mathbf{x}_1) s} \, ds \\ &= f(\mathbf{x}^*; \boldsymbol{\theta}_0) + \frac{\Theta_\infty(\mathbf{x}^*, \mathbf{x}_1)}{\Theta_\infty(\mathbf{x}_1, \mathbf{x}_1)} \left( 1 - e^{-\eta \Theta_\infty(\mathbf{x}_1, \mathbf{x}_1) t} \right) \left( y_1 - f(\mathbf{x}_1; \boldsymbol{\theta}_0) \right) \end{aligned}

Step 3: Asymptotic Generalization
As tt \to \infty, taking expectation over initialization (f0GP(0,K)f_0 \sim \mathcal{GP}(0, \mathcal{K}) with zero mean):

E[f(x)]=Θ(x,x1)Θ(x1,x1)y1\mathbb{E}[f_\infty(\mathbf{x}^*)] = \frac{\Theta_\infty(\mathbf{x}^*, \mathbf{x}_1)}{\Theta_\infty(\mathbf{x}_1, \mathbf{x}_1)} y_1

If the true underlying target function is y(x)y(\mathbf{x}^*), the generalization error on x\mathbf{x}^* is:

Error(x)=Θ(x,x1)Θ(x1,x1)y1y(x)\text{Error}(\mathbf{x}^*) = \left| \frac{\Theta_\infty(\mathbf{x}^*, \mathbf{x}_1)}{\Theta_\infty(\mathbf{x}_1, \mathbf{x}_1)} y_1 - y(\mathbf{x}^*) \right|

Generalization succeeds if and only if the normalized kernel similarity Θ(x,x1)Θ(x1,x1)\frac{\Theta_\infty(\mathbf{x}^*, \mathbf{x}_1)}{\Theta_\infty(\mathbf{x}_1, \mathbf{x}_1)} accurately mirrors the true functional correlation y(x)y1\frac{y(\mathbf{x}^*)}{y_1}.


12. References & Key Literature

On this page

Large Numbers, Self-Averaging & Infinite-Width Neural Networks1. Microscopic Multiplicities, Binomial Distribution & Stirling's Asymptotics1.1 Multiplicity and the Binomial Distribution1.2 Step-by-Step Derivation of Stirling's Approximation via Laplace's Method1.3 Asymptotics of the Binomial Distribution & Gaussian Emergence1.4 Absolute vs. Relative Fluctuations2. High-Dimensional LLN, CLT & Concentration of Measure2.1 The Multidimensional Central Limit Theorem2.2 Geometry of High Dimensions: Spherical ConcentrationPhenomenon 1: Concentration on the Sphere Surface (The "Soap Bubble" Effect)Phenomenon 2: Quasi-Orthogonality of Random Vectors3. Self-Averaging in Statistical Physics & Deep Learning3.1 Mathematical Definition of Self-Averaging3.2 Quenched vs. Annealed Averages1. Annealed Average (Disorder in Thermal Equilibrium)2. Quenched Average (Frozen Disorder)4. The Infinite-Width Limit: Neural Network Gaussian Processes (NNGP)4.1 Multi-Layer Perceptron Setup4.2 Step-by-Step Induction for NNGP ConvergenceBase Case: Layer l=1l = 1Inductive Step: Layer ll+1l \to l+14.3 Closed-Form Analytical Kernels: The Arc-Cosine / ReLU Case5. Dynamic Thermodynamic Limit: The Neural Tangent Kernel (NTK)5.1 Derivation of Continuous-Time Gradient Flow5.2 The Two Pillars of Infinite-Width NTK Theory1. Self-Averaging at Initialization (t=0t = 0)2. Kernel Freeze / Lazy Training Regime (t>0t > 0)5.3 Step-by-Step Derivation of the Recursive NTK Formula6. Quantitative Non-Asymptotic Rates: Eldan, Mikulincer & Schramm (COLT 2021)6.1 Function Space Transportation Metrics6.2 The Eldan-Mikulincer-Schramm Convergence Theorem6.3 Proof Strategy via Infinite-Dimensional Malliavin-Stein Exchangeable Pairs7. Asymptotic Variance and Mini-Batch SGD under LLN/CLT7.1 The Mini-Batch Central Limit Theorem7.2 Continuous-Time Stochastic Differential Equation (SDE) LimitFluctuation-Dissipation Relation in SGD7.3 Asymptotic Covariance: The Continuous Lyapunov Equation7.4 Polyak-Ruppert Averaging and Quenched CLT (JMLR 2024–2026)8. Beyond Infinite-Width: Field Theory & 1/N Expansions for Bayesian Networks8.1 The Bayesian Neural Network Partition Function8.2 The Hubbard-Stratonovich Transformation to Collective Field QabQ_{ab}8.3 Saddle-Point (Mean Field) and Gaussian Free Field (NN \to \infty)8.4 Systematic 1/N1/N Expansion & Feynman Diagram Vertex Corrections9. Classical Statistical Mechanics vs. Deep Learning: Master Correspondence10. Summary & Open FrontiersCore Takeaways11. Practice Problems with Step-by-Step SolutionsSolution to Problem 1:Solution to Problem 2:12. References & Key Literature