Critical initialization of wide and deep neural networks through partial Jacobians: general theory and applications to LayerNorm

Darshil Doshi, Tianyu He, Andrey Gromov

TL;DR

This paper introduces "partial Jacobians" as a new tool to understand and diagnose the critical initialization of deep neural networks. They show that by carefully applying Layer Normalization and residual connections, networks can be made "everywhere-critical," meaning they are trainable regardless of initialization, a significant step towards more robust and predictable deep learning.

What Problem Does This Paper Address?

Deep neural networks are notoriously difficult to understand theoretically, especially when it comes to initialization. While it's known that in the "infinite width" limit, networks behave like Gaussian Processes (GPs), finding the right initialization for hyperparameters like weight/bias variances remains a challenge. This "critical initialization" is crucial for networks to train effectively, preventing gradients from exploding or vanishing. Existing methods often require fine-tuning or are specific to certain architectures. This paper aims to provide a general, practical, and theoretically grounded way to diagnose and achieve critical initialization across a broader range of deep neural network architectures.

Methods

The core innovation is the introduction of partial Jacobians, defined as the derivatives of preactivations in one layer with respect to preactivations in an earlier layer ($l_0 \le l$). By deriving recurrence relations for the norms of these partial Jacobians (specifically, the Averaged Partial Jacobian Norm or APJN), the authors can analyze how gradients propagate through the network. This allows them to:

  • Diagnose Criticality: A simple numerical test based on APJN can determine if a network is critically initialized.
  • Analyze Architectures: They derive analytical conditions for criticality in fully connected networks with Layer Normalization (applied to preactivations) and residual connections.
  • Develop "Everywhere-Critical" Architectures: They demonstrate that a specific combination of Layer Normalization (on preactivations) and residual connections (with a strength of $\mu=1$) leads to networks that are critical for any initialization.

Datasets

  • MNIST: Used for generating inputs to test partial Jacobians.
  • Fashion-MNIST: Used for training and evaluating MLP networks.
  • CIFAR-10: Used for training and evaluating MLP-Mixer and ResNet architectures.

Key Insights and Ideas

  • Partial Jacobians as a Diagnostic Tool: This new concept provides a more granular view of gradient propagation than traditional Jacobian analysis, allowing for a precise diagnosis of criticality.
  • LayerNorm on Preactivations is Key: Applying Layer Normalization before the activation function (on preactivations) significantly enhances the correlation length, making networks more trainable and less sensitive to initialization.
  • The Power of $\mu=1$ Residual Connections: When residual connections have a strength of $\mu=1$, they can, in conjunction with LayerNorm, lead to an "everywhere-critical" regime, simplifying initialization considerably.
  • Architecture Dictates Initialization: The study reinforces the idea that the network's architecture itself can be designed to be inherently trainable, reducing the burden on manual hyperparameter tuning.

Key Results

  • Empirical Test for Criticality: The paper presents a practical and computationally cheap test to diagnose critical initialization using APJN.
  • Analytical Conditions for Criticality: They derive theoretical conditions for critical initialization in MLPs with LayerNorm and residual connections.
  • "Everywhere-Critical" Architectures: They demonstrate that specific combinations of LayerNorm (on preactivations) and $\mu=1$ residual connections result in networks that are critical across the entire parameter space of initialization variances. This is shown for ResNet and MLP-Mixer architectures.
  • Improved Trainability: Figures and experiments show that these critical architectures lead to significantly improved trainability, especially for deep networks, and are less sensitive to initialization choices. For example, Figure 3 shows that with LayerNorm and $\mu=1$, networks are "everywhere-trainable."

Limitations and Future Work

  • Transformer Architectures: While empirical results for Vision Transformers (ViTs) are presented (Figure 7 & 8), a robust theoretical foundation for initializing them is still lacking. The authors aim to extend their theory to the attention mechanism.
  • Graph Neural Networks: Generalizing these methods to graph neural networks is an open challenge.
  • Scaling Up: The authors plan to scale their experiments to larger image datasets and language tasks.
  • Non-Universal Critical Exponents: For certain activation functions (like erf with $\mu=1$), the critical exponent is non-universal, meaning it depends on the input, which can complicate analysis.

Summary updated

BibTeX
@inproceedings{doshi2023critical,
  author = {Darshil Doshi and Tianyu He and Andrey Gromov},
  title = {{Critical initialization of wide and deep neural networks through partial Jacobians: general theory and applications to LayerNorm}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=xb333aboIu},
}
Figure