Critical Initialization of Wide and Deep Neural Networks using Partial Jacobians: General Theory and Applications

Darshil Doshi, Tianyu He, Andrey Gromov

TL;DR: Deep neural networks are notoriously difficult to initialize, often suffering from vanishing or exploding gradients as depth increases. This paper introduces "Partial Jacobians" as a practical mathematical tool to diagnose network "criticality." Using this tool, the authors prove that combining LayerNorm (applied to preactivations) with residual connections creates an "everywhere-critical" architecture that is highly trainable regardless of how its weights are initialized.

The Initialization Problem

If you initialize a deep neural network with weights that are too small, the gradients vanish and the network fails to learn. Conversely, if the weights are too large, the gradients explode. To train very deep networks successfully, researchers must carefully tune the variance of weights and biases to hit a "critical point"—often referred to as the edge of chaos.

Historically, finding this critical initialization has relied on complex Gaussian Process approximations in the infinite-width limit. However, these theoretical critical points can be brittle and difficult to calculate for modern, complex architectures. This paper tackles two main questions:

  1. Is there a cheap, empirical way to diagnose if any given network architecture is critically initialized?
  2. Can we design architectures that are inherently robust, bypassing the need for delicate initialization tuning altogether?

Methodology: Partial Jacobians

To address these questions, the authors introduce the concept of the Partial Jacobian, which measures the derivative of preactivations at a deeper layer ($l$) with respect to a shallower layer ($l_0$). To quantify this, they define the Averaged Partial Jacobian Norm (APJN).

By taking the infinite-width limit, the authors derive deterministic recurrence relations for the APJN. This theoretical framework allows them to mathematically track how gradient magnitudes evolve as they pass through fully connected layers, normalization layers, and residual (skip) connections.

Practically, they propose a cheap numerical test using Hutchinson's trace estimator. By simply evaluating the APJN of the penultimate layer with respect to the layer just before it, practitioners can accurately estimate the network's criticality without heavy math.

Key Insights: The "Everywhere-Critical" Regime

The APJN provides a clean, measurable scalar that reveals exactly what phase a network is in: ordered (vanishing gradients), chaotic (exploding gradients), or critical.

Applying LayerNorm to preactivations (before the activation function) dramatically increases the "correlation length" of the network. This means gradients can travel much further through the network before dying out, making the network far more forgiving to bad initializations.

Phase diagrams of network criticality. Notice how combining LayerNorm with residual strength $\mu=1.0$ (rightmost column) creates an 'everywhere-critical' regime across all weight and bias variances.

The most significant finding is that combining Pre-LN with residual connections of strength $\mu=1$ forces the network into an "everywhere-critical" regime. In this state, the network is critical for any initialization of weight and bias variances. Gradients diverge algebraically (very slowly) rather than exponentially, guaranteeing trainability even at massive depths. This theory perfectly explains the empirical success of modern architectures like ResNetV2 and MLP-Mixer, which inherently utilize this Pre-LN plus residual connection structure.

Empirical Validation

To empirically validate their theoretical claims, the authors trained networks on datasets like FashionMNIST (for deep MLPs) and CIFAR-10 (for deep MLP-Mixers), alongside synthetic Gaussian noise tests to map out phase diagrams.

Empirical trainability heatmaps. The uniformly red rightmost column confirms that networks with LayerNorm and $\mu=1.0$ train successfully regardless of initialization.

The authors successfully derived the exact formula for correlation length in deep MLPs with Pre-LN and residual connections, proving that as residual strength $\mu \to 1$, the correlation length diverges. For a modified ResNet110, increasing the residual strength $\mu$ towards 1 monotonically improved training accuracy across a wide range of initializations. Furthermore, when testing a massive 100-block deep MLP-Mixer on CIFAR-10, setting $\mu=0.5$ resulted in successful training only within a very narrow initialization band. However, at $\mu=1.0$ (the everywhere-critical regime), the network trained successfully across almost all tested initializations.

Limitations and Future Work

While powerful, the theoretical derivations rely on the network layers being infinitely wide. Although large residual connections help suppress finite-width corrections, very narrow networks might still deviate slightly from the theory. Additionally, the current mathematical framework does not fully cover the self-attention mechanisms found in Transformers, and its generalization to Graph Neural Networks (GNNs) remains ambiguous.

Future work will focus on extending this theory to attention mechanisms to find optimal initialization schemes for Transformers, and scaling empirical tests to larger datasets like ImageNet and complex language modeling tasks.

Summary updated

BibTeX
@inproceedings{doshi2023critical,
  author = {Darshil Doshi and Tianyu He and Andrey Gromov},
  title = {{Critical Initialization of Wide and Deep Neural Networks using Partial Jacobians: General Theory and Applications}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=xb333aboIu},
}
Figure