Differential Equation Scaling Limits of Shaped and Unshaped Neural Networks

Mufan Bill Li, Mihai Nica

Abstract

This work establishes a unified mathematical framework for the infinite-depth-and-width limits of neural networks. We demonstrate that "shaped" networks—those with activations that linearize as depth increases—converge to the same deterministic limits as certain ResNets. Furthermore, we derive a novel stochastic differential equation (SDE) that characterizes the layer-wise correlation in standard "unshaped" networks, resolving the degeneracy typically observed in deep sequential architectures.

Introduction

Training very deep neural networks is notoriously difficult due to vanishing or exploding gradients. To combat this, researchers often use "shaped" activations—modifying the activation function to be more linear as the network size increases—or architectures like ResNets.

While recent work has described the infinite-depth-and-width limits of these shaped networks using Stochastic Differential Equations (SDEs), two significant gaps remained: the precise relationship between shaped MLPs and ResNets, and the asymptotic behavior of standard, "unshaped" networks. In standard networks, the correlation between different inputs usually collapses to 1 very quickly as depth increases, making them appear "degenerate" in traditional limit analysis. This paper aims to find a non-degenerate asymptotic characterization for both types of networks to better understand stability and normalization.

Methods: Infinite-Depth-and-Width Limit Analysis

The authors employ infinite-depth-and-width limit analysis, treating the propagation of signals through the network layers as a Markov chain. They then derive the continuous-time limit (as depth $d \to \infty$ and width $n \to \infty$) that this chain converges to.

Key technical tools include:

  • Scaling Limits: Analyzing different regimes of the ratio between depth and width.
  • Taylor Expansions: Expanding around the identity map for shaped networks and around the fixed point (correlation $\rho = 1$) for unshaped networks.
  • SDE/ODE Derivation: Using the Martingale problem approach to prove that discrete layer-wise updates converge to specific Ordinary Differential Equations (ODEs) or Stochastic Differential Equations (SDEs).

Key Insights

Shaped MLPs as "Hidden" ResNets

The paper shows that a shaped MLP (where the activation is a small perturbation of the identity) converges to the same ODE limit as a ResNet with a $d^{-1/2}$ scaling on its residual branch. This suggests that "shaping" is essentially a way of introducing skip-connection-like stability into a sequential architecture. However, a key difference remains: in ResNets, the order of width and depth limits is commutative, whereas in shaped MLPs, it is not. This explains why MLPs can exhibit "feature learning" at initialization in ways that ResNets might not.

Unshaped Networks and the Zoomed-In Limit

The most striking insight is that standard networks are not truly degenerate; they are simply "zoomed out." By applying a transformation $q_\ell = \ell^2(1 - \rho_\ell)$ to the correlation $\rho_\ell$, the authors reveal an SDE that describes how inputs stay distinct or merge. This SDE features a singularity at $t=0$, mathematically capturing why the first few layers of a standard network are critical and distinct from the "steady state" deeper layers.

Key Results and Empirical Validation

The authors provide rigorous proofs for these scaling limits, notably:

  • Theorem 3.4: Proves that for a specific scaling regime, the covariance of a shaped MLP converges to a deterministic ODE.
  • Theorem 4.1: Derives the first-order asymptotic correction for the correlation in unshaped ReLU MLPs, showing the rescaled correlation $q_t$ converges to a specific SDE.

To verify these theoretical findings, the authors conducted numerical simulations of networks with specific widths and depths (e.g., $n=150, d=150$). As shown in Figure 1, the theoretical SDE perfectly predicts the distribution of transformed correlations in simulated unshaped ReLU MLPs.

Comparison of the theoretical SDE prediction (red line) against empirical neural network simulations (grey histogram) for transformed correlation.

Conclusion

This framework provides a necessary foundation for understanding deep networks at initialization. While the current analysis is restricted to initialization, the authors suggest this approach could eventually be used to study Batch Normalization and Layer Normalization, which currently lack a unified continuous-time theoretical description. Future work will likely explore how these dynamics evolve during training via gradient descent.

Summary updated

BibTeX
@article{li2024differential,
  author = {Mufan Bill Li and Mihai Nica},
  title = {{Differential Equation Scaling Limits of Shaped and Unshaped Neural Networks}},
  journal = {Trans. Mach. Learn. Res.},
  year = {2024},
}
Figure