Simple Algorithm
Deep Learning · Emergence · 30 min

Criticality & Finite-Width Effects

Tuning initialization to criticality, and why the depth-to-width ratio governs finite networks.

Initialization theory usually imagines infinitely wide layers, where a random network's signals are exactly Gaussian and perfectly predictable. Real networks are finite, and the corrections pile up layer after layer. Tuned to criticality, a network neither explodes nor vanishes on average; what remains is controlled by one number, the ratio of depth to width. It decides how far a network strays from the infinite-width picture, and with it how much the network can learn features at all.

What you’ll learn

  • State the criticality conditions for the kernel recursion and the two universality classes of activations (scale-invariant, like ReLU, and K⋆=0K^\star = 0, like tanh), and derive each class's behavior at criticality.
  • Show that at finite width the size of a layer's signal is a product of independent random factors, derive that its relative variance grows like L/nL/n (by 2/n2/n per layer for linear networks and 5/n5/n for ReLU), and explain the log-normal drift that follows.
  • Explain why the neural tangent kernel fluctuates and moves during training at finite width, and why this is the mechanism of representation learning that the infinite-width limit lacks.
  • Relate the aspect ratio L/nL/n to trainability, and to the alternatives of changing the parameterization (μP) or the architecture (residual scaling).

Criticality and two universality classes

First the infinite-width picture of signal propagation, in one paragraph and in the notation of Roberts, Yaida and Hanin's The Principles of Deep Learning Theory (PDLT). With weights Wij∼N(0,CW/n)W_{ij}\sim\mathcal N(0, C_W/n) and biases bi∼N(0,Cb)b_i\sim\mathcal N(0, C_b), at infinite width each pre-activation of layer ℓ\ell is Gaussian with variance K(ℓ)K^{(\ell)} (the kernel, for a single input), and

K(ℓ+1)=Cb+CW ⟨ϕ(z)2⟩K(ℓ),χ∥=∂K(ℓ+1)∂K(ℓ)∣K⋆,χ⊥=CW ⟨ϕ′(z)2⟩K⋆K^{(\ell+1)} = C_b + C_W\,\big\langle\phi(z)^2\big\rangle_{K^{(\ell)}},\qquad\chi_\parallel = \frac{\partial K^{(\ell+1)}}{\partial K^{(\ell)}}\Big|_{K^\star},\qquad\chi_\perp = C_W\,\big\langle\phi'(z)^2\big\rangle_{K^\star}
⟨⋅⟩K\langle\cdot\rangle_K is an average over z∼N(0,K)z\sim\mathcal N(0, K). The parallel susceptibility χ∥\chi_\parallel says how a perturbation of the signal's size grows per layer; the perpendicular one χ⊥\chi_\perp how the difference between two nearby inputs grows, and it also multiplies the mean square of backpropagated gradients. χ⊥=1\chi_\perp = 1 is the "edge of chaos" of Poole et al. (2016) and Schoenholz et al. (2017).
DerivationBoth classes, derived
  1. χ∥=χ⊥=CW a+2+a−22=1⟹K(ℓ)=K(1) for every ℓ\chi_\parallel = \chi_\perp = C_W\,\frac{a_+^2 + a_-^2}{2} = 1\quad\Longrightarrow\quad K^{(\ell)} = K^{(1)}\ \text{for every }\ell

    For a scale-invariant ϕ\phi and a symmetric Gaussian zz, half the mass sits on each side: ⟨ϕ(z)2⟩K=12(a+2+a−2)K\langle\phi(z)^2\rangle_K = \tfrac12(a_+^2 + a_-^2)K, and likewise ⟨ϕ′(z)2⟩=12(a+2+a−2)\langle\phi'(z)^2\rangle = \tfrac12(a_+^2 + a_-^2). The recursion is linear, K(ℓ+1)=Cb+CWa+2+a−22K(ℓ)K^{(\ell+1)} = C_b + C_W\tfrac{a_+^2 + a_-^2}2K^{(\ell)}, so both susceptibilities equal CW(a+2+a−2)/2C_W(a_+^2 + a_-^2)/2, and criticality fixes CWC_W as stated, with Cb=0C_b = 0:

  2. K(ℓ+1)=K(ℓ)−2(K(ℓ))2+O(K3)⟹K(ℓ)≈12ℓK^{(\ell+1)} = K^{(\ell)} - 2\big(K^{(\ell)}\big)^2 + \order{K^3}\quad\Longrightarrow\quad K^{(\ell)}\approx\frac{1}{2\ell}

    For tanh, expand tanh⁡2z=z2−23z4+O(z6)\tanh^2z = z^2 - \tfrac23z^4 + \order{z^6} and use ⟨z4⟩K=3K2\langle z^4\rangle_K = 3K^2. With CW=1C_W = 1 and Cb=0C_b = 0 the recursion becomes, for small KK,

  3. (The continuum version dK/dℓ=−2K2dK/d\ell = -2K^2 integrates to 1/K=2ℓ+const1/K = 2\ell + \text{const}.) Both susceptibilities tend to 11 as K→0K\to0, so the signal and the gradient fade only polynomially, like 1/ℓ1/\sqrt\ell in RMS. Away from criticality, for example CW<1C_W < 1, the decay is exponential.

Predict before you look

A critical tanh network (CW=1C_W = 1, Cb=0C_b = 0) starts with K(1)=1K^{(1)} = 1. Using K(ℓ)≈1/(2ℓ)K^{(\ell)}\approx1/(2\ell), what is the RMS of the pre-activations at layer 50?

Show the answer

0.1

K(50)≈1/100K^{(50)}\approx1/100, so the RMS is about 0.10.1 (iterating the exact recursion gives 0.1020.102). The signalprop widget shows the same law: a tanh network at gain 11 keeps about 0.170.17 of its first-layer RMS after 50 layers and 0.110.11 after 100, a slow power-law fade instead of the exponential collapse at smaller gains.

Finite width: corrections of order L/n

At width nn the infinite-width story is only the average. Given layer ℓ\ell, the next pre-activations are exactly Gaussian, but with a random variance: the empirical kernel K^ℓ=Cb+CWn∑jϕ(zj(ℓ))2\hat K_\ell = C_b + \frac{C_W}{n}\sum_j\phi(z^{(\ell)}_j)^2, a sum over nn units that fluctuates by O(1/n)\order{1/\sqrt n}. Integrating over it makes each layer a mixture of Gaussians: nearly Gaussian, with a connected four-point correlation of order 1/n1/n. Across layers the fluctuations compound, as a simple calculation shows.

DerivationA layer’s signal is a product of random factors
  1. K^L=K^0∏ℓ=1LXℓ,E[Xℓ]=1\hat K_L = \hat K_0\prod_{\ell=1}^{L}X_\ell,\qquad\E[X_\ell] = 1

    Take a critical ReLU network (CW=2C_W = 2, Cb=0C_b = 0). Given K^ℓ\hat K_\ell, the pre-activations of layer ℓ+1\ell + 1 are i.i.d. N(0,K^ℓ)\mathcal N(0,\hat K_\ell), so the next empirical kernel is K^ℓ+1=2n∑iReLU⁡(zi)2=K^ℓ Xℓ+1\hat K_{\ell+1} = \frac2n\sum_i\operatorname{ReLU}(z_i)^2 = \hat K_\ell\,X_{\ell+1}, where Xℓ+1=2n∑iReLU⁡(ξi)2X_{\ell+1} = \frac2n\sum_i\operatorname{ReLU}(\xi_i)^2 with fresh ξi∼N(0,1)\xi_i\sim\mathcal N(0,1). The factors are independent of each other and of K^ℓ\hat K_\ell:

  2. Var⁡(K^L)E[K^L]2=(1+cn)L−1 ≈ cLn(L≪n),c=5 (ReLU), 2 (linear)\frac{\Var(\hat K_L)}{\E[\hat K_L]^2} = \Big(1 + \frac cn\Big)^{L} - 1\ \approx\ \frac{cL}{n}\quad(L\ll n),\qquad c = 5\ \text{(ReLU)},\ 2\ \text{(linear)}

    Their variance follows from E[ReLU⁡(ξ)4]=32\E[\operatorname{ReLU}(\xi)^4] = \tfrac32 and E[ReLU⁡(ξ)2]=12\E[\operatorname{ReLU}(\xi)^2] = \tfrac12: Var⁡(ReLU⁡(ξ)2)=32−14=54\Var(\operatorname{ReLU}(\xi)^2) = \tfrac32 - \tfrac14 = \tfrac54, so Var⁡(X)=4n2⋅n⋅54=5n\Var(X) = \frac4{n^2}\cdot n\cdot\frac54 = \frac5n. For a linear network (CW=1C_W = 1, 1n∑ξi2\frac1n\sum\xi_i^2) the same computation gives 2n\frac2n. Independence makes second moments multiply:

  3. log⁡K^L ≈ N(log⁡K^0−cL2n, cLn)\log\hat K_L\ \approx\ \mathcal N\Big(\log\hat K_0 - \frac{cL}{2n},\ \frac{cL}{n}\Big)

    The mean is preserved exactly, as criticality promises, but the fluctuations grow with L/nL/n, and once L/nL/n is of order one they grow exponentially, like ecL/ne^{cL/n}. Taking logarithms, log⁡K^L\log\hat K_L is a sum of LL independent terms with mean ≈−c2n\approx-\frac{c}{2n} and variance ≈cn\approx\frac cn, so it is approximately Gaussian: K^L\hat K_L is roughly log-normal, and its typical value drifts below its mean, like e−cL/(2n)e^{-cL/(2n)}.

Predict before you look

A critical ReLU network has width n=500n = 500, and the signal passes through L=20L = 20 random layers. Using the linear approximation, what is the relative variance Var⁡(K^L)/E[K^L]2\Var(\hat K_L)/\E[\hat K_L]^2 of the final layer's squared signal?

Show the answer

0.2

cL/n=5×20/500=0.2cL/n = 5\times20/500 = 0.2 (exactly, 1.0120−1≈0.221.01^{20} - 1\approx0.22): a relative standard deviation of about 45%45\% from one random draw to the next, although every layer is "correctly" initialized. A linear network of the same shape would give 2×20/500=0.082\times20/500 = 0.08.

PDLT develops this into a systematic expansion. At criticality the network's output distribution is a Gaussian process plus corrections in powers of the aspect ratio r=L/nr = L/n: the four-point vertex, which measures non-Gaussianity, grows linearly with depth, so at leading order every correction is of order L/nL/n. Normalized by the squared kernel, it is νL/n\nu L/n, where ν=3A4/A22−1\nu = 3A_4/A_2^2 - 1 with Ak=(a+k+a−k)/2A_k = (a_+^k + a_-^k)/2 for scale-invariant activations: 55 for ReLU and 22 for linear, the same constants cc as above, and ν=23\nu = \tfrac23 for the K⋆=0K^\star = 0 class. Wide-and-shallow networks (r→0r\to0) are close to the infinite-width Gaussian process; as rr approaches one the expansion breaks down and fluctuations dominate. The same accounting explains the slow downward drift of a He-initialized ReLU network in the signalprop widget (about 0.50.5 of the first layer's RMS after 50 layers at width 128, against the log-normal estimate e−cL/(4n)≈0.6e^{-cL/(4n)}\approx0.6 for a typical draw): the typical value sits below the preserved mean.

When the kernel moves: representation learning

Why care about finite width beyond stability? Because infinite width, in the standard parameterization, also removes learning of features. Gradient descent on a network moves its outputs according to the neural tangent kernel Θ(x,x′)=∑μ∂θμf(x) ∂θμf(x′)\Theta(\mathbf x,\mathbf x') = \sum_\mu\partial_{\theta_\mu}f(\mathbf x)\,\partial_{\theta_\mu}f(\mathbf x'). As the width goes to infinity at fixed depth, Θ\Theta becomes deterministic and stays constant during training: the network trains like a linear model in a fixed feature space, the lazy regime, and its hidden representations do not change in any way that matters.

This suggests a trade-off in architecture. As L/n→0L/n\to0 a network is stable but its features barely move; as L/nL/n grows, feature learning strengthens, and so do the fluctuations that make training erratic and the predictions of the expansion unreliable. PDLT motivates an intermediate optimal aspect ratio on these grounds and estimates it heuristically in an appendix, from an information-theoretic criterion (the mutual information between groups of neurons, which vanishes at infinite width, first grows with L/nL/n and then falls). The estimate depends on the activation, larger for tanh than for ReLU because tanh's ν\nu is smaller, and residual connections shift it to larger values. The same picture also explains why very deep, narrow plain networks are hard to train even at criticality. Two other ways out of the lazy limit are taught elsewhere in the course: change the parameterization so that features move by order one at infinite width (μP; μP & Hyperparameter Transfer), or change the architecture so that depth is tamed, with residual branches scaled like 1/L1/\sqrt L (Scaling Residual Branches with Depth).

Check your understanding

In the standard (NTK) parameterization, what happens to the neural tangent kernel as the width grows to infinity at fixed depth, and what does finite width change?

  1. It becomes deterministic and constant in training, so features do not move; finite width makes it fluctuate and evolve at order L/nL/n, which is feature learning
  2. It grows without bound, so training diverges; finite width keeps it bounded
  3. Nothing changes: the kernel is constant at every width
  4. It becomes random; finite width makes it deterministic
Show the answer

A. It becomes deterministic and constant in training, so features do not move; finite width makes it fluctuate and evolve at order L/nL/n, which is feature learning

The infinite-width limit at fixed depth is the lazy, kernel regime. The corrections that make finite networks fluctuate are the same ones that let their kernels, and hence their representations, change during training.

What it means in practice, and what is open

RegimeAspect ratio L/nL/nBehavior at initializationTraining
Infinite width, fixed depth00Gaussian process; kernel deterministiclazy: linear model in fixed features
Wide and moderately deepsmallnearly Gaussian; corrections O(L/n)\order{L/n}stable, with feature learning at order L/nL/n
Deep and narroworder one or morelog-normal fluctuations, ecL/ne^{cL/n} relative varianceerratic even at criticality; normalization, residual scaling or orthogonal weights needed
Real networks mix all of this with normalization, residual connections and attention, which change the recursions; the clean results above are for plain fully connected networks at initialization.

Key takeaways

  • Criticality means χ∥=χ⊥=1\chi_\parallel = \chi_\perp = 1: signals and gradients neither grow nor shrink exponentially with depth. Scale-invariant activations are critical at CW=2/(a+2+a−2)C_W = 2/(a_+^2 + a_-^2) (He for ReLU) with a constant kernel; K⋆=0K^\star = 0 activations such as tanh at CW=1/ϕ′(0)2C_W = 1/\phi'(0)^2, with a kernel fading like 1/(2ℓ)1/(2\ell).
  • At width nn each layer multiplies the signal's squared size by an independent factor with mean one and variance c/nc/n (c=5c = 5 for ReLU, 22 for linear), so its relative variance is (1+c/n)L−1≈cL/n(1 + c/n)^L - 1\approx cL/n and the signal is roughly log-normal, with a typical value drifting below the mean.
  • The aspect ratio L/nL/n controls all leading finite-width corrections (PDLT; Hanin & Nica): including the fluctuation and the motion of the neural tangent kernel, which is the representation learning that infinite width at fixed depth removes.
  • Shallow-and-wide networks are nearly Gaussian processes; deep-and-narrow ones fluctuate wildly even at criticality. μP and scaled residual branches are the other routes to well-behaved large models.

Check yourself

In the interactive lesson these are scored with your confidence, and what you miss comes back for review.

Question 1

In PDLT's notation (Wij∼N(0,CW/n)W_{ij}\sim\mathcal N(0, C_W/n), bi∼N(0,Cb)b_i\sim\mathcal N(0, C_b)), where is a ReLU network critical?

  1. Cb=0C_b = 0, CW=1C_W = 1
  2. Cb=0C_b = 0, CW=2C_W = 2, He initialization, where the kernel is the same at every layer
  3. Any CWC_W, as long as Cb>0C_b > 0
  4. ReLU networks cannot be made critical
Show the answer

B. Cb=0C_b = 0, CW=2C_W = 2, He initialization, where the kernel is the same at every layer

ReLU is scale-invariant with a+=1a_+ = 1, a−=0a_- = 0, so χ∥=χ⊥=CW/2\chi_\parallel = \chi_\perp = C_W/2, which equals 11 at CW=2C_W = 2. At infinite width the kernel is then exactly constant in depth.

Question 2

How does the kernel K(ℓ)K^{(\ell)} of a critical tanh network behave with depth?

  1. It stays exactly constant
  2. It decays exponentially
  3. It grows like ℓ\ell
  4. It decays like a power law, K(ℓ)≈1/(2ℓ)K^{(\ell)}\approx1/(2\ell), because tanh's fixed point is K⋆=0K^\star = 0
Show the answer

D. It decays like a power law, K(ℓ)≈1/(2ℓ)K^{(\ell)}\approx1/(2\ell), because tanh's fixed point is K⋆=0K^\star = 0

tanh⁡2z≈z2−23z4\tanh^2z\approx z^2 - \tfrac23z^4 gives K→K−2K2K\to K - 2K^2 per layer. Polynomial decay is what criticality buys for this class; exponential decay is the off-critical behavior.

Question 3

Two critical ReLU networks: A has depth 10 and width 1,000; B has depth 100 and width 100. Which is closer to the infinite-width prediction at initialization, and why?

  1. B, because deeper networks average out more randomness
  2. They are equally close, since both are critical
  3. A, because the size of the finite-width corrections is set by the aspect ratio L/nL/n: 0.010.01 for A against 11 for B
  4. Neither: finite networks never resemble the infinite-width limit
Show the answer

C. A, because the size of the finite-width corrections is set by the aspect ratio L/nL/n: 0.010.01 for A against 11 for B

The relative variance of the squared signal is (1+5/n)L−1(1 + 5/n)^L - 1: about 0.050.05 for A (L/n=0.01L/n = 0.01) against about 130130 for B (L/n=1L/n = 1, where the growth is already exponential), whose signal is wildly log-normal.

Question 4

At criticality the mean of K^L\hat K_L is preserved exactly. Why does a typical deep, narrow network nevertheless show a signal that shrinks with depth?

  1. K^L\hat K_L is a product of independent factors with mean 11, so it is roughly log-normal: its typical value eElog⁡K^Le^{\E\log\hat K_L} falls like e−cL/(2n)e^{-cL/(2n)} while rare large draws keep the mean at its value
  2. Because criticality only holds for the first few layers
  3. Because of rounding errors in floating point
  4. Because ReLU's derivative is smaller than one
Show the answer

A. K^L\hat K_L is a product of independent factors with mean 11, so it is roughly log-normal: its typical value eElog⁡K^Le^{\E\log\hat K_L} falls like e−cL/(2n)e^{-cL/(2n)} while rare large draws keep the mean at its value

Jensen's inequality: Elog⁡X<log⁡EX=0\E\log X < \log\E X = 0 for a random factor with mean 11. Summed over LL layers, the median drifts down by about cL/(2n)cL/(2n) in log-scale, though the mean does not move.

Further reading

  • D. A. Roberts, S. Yaida & B. Hanin, The Principles of Deep Learning Theory (Cambridge University Press, 2022), arXiv:2106.10165.
  • B. Poole, S. Lahiri, M. Raghu, J. Sohl-Dickstein & S. Ganguli, "Exponential expressivity in deep neural networks through transient chaos," NeurIPS (2016).
  • B. Hanin, "Which neural net architectures give rise to exploding and vanishing gradients?," NeurIPS (2018).
  • B. Hanin & M. Nica, "Products of many large random matrices and gradients in deep neural networks," Communications in Mathematical Physics 376 (2020).
  • B. Hanin & M. Nica, "Finite depth and width corrections to the neural tangent kernel," ICLR (2020).