Scaling Limits of Wide Neural Networks with Weight Sharing: Gaussian Process Behavior, Gradient Independence, and Neural Tangent Kernel Derivation

Greg YangarXiv 2019

Abstract

Recent advances in machine learning theory have leveraged the properties of wide random neural networks to understand Gaussian Process (GP) behavior and Neural Tangent Kernel (NTK) dynamics. However, these analyses were often restricted to simple architectures. This work introduces Tensor Programs, a unified framework that characterizes the scaling limits of complex architectures including RNNs, CNNs, ResNets, and Transformers. We prove that these networks converge to Gaussian Processes in the infinite-width limit and provide a rigorous derivation of their NTK. Furthermore, we validate the "gradient independence assumption" and demonstrate that our framework can re-derive classical results in random matrix theory.

The Challenge of Complexity

In deep learning theory, "wide" neural networks (where the number of neurons per layer tends toward infinity) are significantly more tractable than finite ones. Previous research established that wide Multi-Layer Perceptrons (MLPs) converge to Gaussian Processes at initialization and follow linear dynamics described by the NTK during training.

However, these proofs were often "bespoke"—tailored specifically to simple MLPs. Real-world deep learning relies on complex structures like weight sharing (CNNs, RNNs), skip connections (ResNets), and attention mechanisms (Transformers). There was a significant gap in rigorously extending these properties to the architectures used in practice. Additionally, researchers often relied on the "Gradient Independence Assumption"—the heuristic that weights in the backward pass can be treated as independent of those in the forward pass—without a formal proof of when this holds true.

Methods: The Language of Tensor Programs

The core contribution of this work is the creation of a "master language" for neural network computations called Tensor Programs.

A Tensor Program is a sequence of instructions describing how vectors and matrices are combined via linear combinations, matrix multiplications, and coordinate-wise nonlinearities. By expressing a neural network's forward and backward passes as a Tensor Program, we can apply a single "Master Theorem" to characterize the scaling limit.

The structure of a Tensor Program (a) and its extended version (b) used to analyze gradients.

The technique involves a Gaussian conditioning trick that tracks how the distribution of hidden activations evolves as network width grows, even when weights are shared across different parts of the computation (like kernels in a CNN or hidden states in an RNN).

Key Insights and Ideas

  • Universality of Gaussian Processes: The paper shows that GP behavior is not a fluke of MLPs. If any standard architecture is made wide enough, its output distribution becomes Gaussian. This allows for the design of "stronger" Gaussian Processes by mimicking state-of-the-art DNN architectures.
  • Weight Sharing Handling: Intuitively, reusing weights (as in an RNN) creates complex dependencies. The Tensor Program framework proves that in the infinite limit, these dependencies simplify into a deterministic scaling limit.
  • Validating Gradient Independence: The paper rigorously defines the conditions under which forward and backward weights can be treated as independent, providing "corrections" for cases where this assumption fails (e.g., when using global mean pooling).
  • Automated Theory: Because the framework is based on a "program," it suggests that the derivation of scaling limits and kernels could eventually be automated by a compiler rather than requiring manual mathematical proof for every new architecture.

Key Results

The framework successfully proves the DNN-GP correspondence and NTK convergence for RNNs, CNNs, ResNets, and Attention mechanisms (without batch normalization). Beyond neural networks, the framework is general enough to re-derive fundamental results in random matrix theory, such as the Wigner Semicircle Law.

Empirical vs. theoretical gradient norms in an LSTM with 1,000 neurons, showing near-perfect alignment.

Simulations demonstrate that for an LSTM, the theoretical limit is highly accurate even at a relatively modest width of 1,000 neurons, as shown in the alignment between empirical and theoretical gradient norms.

Limitations and Future Work

While powerful, the current framework has limitations. The gradients of Batch Normalization contain singularities that are not yet fully handled. Additionally, Layer Normalization changes its signature with width, requiring further extensions to the Tensor Program logic. Finally, while the results apply to a fixed number of layers as width goes to infinity, future work is needed to address the "joint limit" where both width and depth grow simultaneously.

Summary updated

BibTeX
@misc{yang2019scaling,
  author = {Greg Yang},
  title = {{Scaling Limits of Wide Neural Networks with Weight Sharing: Gaussian Process Behavior, Gradient Independence, and Neural Tangent Kernel Derivation}},
  year = {2019},
  eprint = {1902.04760},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1902.04760},
}
Figure