Differential Equation Scaling Limits of Shaped and Unshaped Neural Networks

Mufan Bill Li, Mihai Nica · DOI

Deep neural networks are often analyzed through their "scaling limits"—mathematical descriptions of their behavior as they become infinitely wide and deep. This paper, published in Transactions on Machine Learning Research, bridges the gap between "shaped" networks (where activation functions are modified for stability) and standard "unshaped" networks.

The Challenge of Signal Degeneration

In standard deep networks, signals tend to degenerate. For instance, in a deep ReLU network, inputs become perfectly correlated (the correlation $\rho \to 1$) as they pass through layers. This makes it impossible for the network to distinguish between different data points, a phenomenon often referred to as the "correlation problem."

To mitigate this, researchers have previously proposed "shaping" activation functions to keep them nearly linear as the network grows. While this allowed for stable descriptions using Stochastic Differential Equations (SDEs), the behavior of standard, unshaped networks remained mathematically elusive. This research identifies the differential equations governing both regimes.

Methodology: Markov Chains and Magnifying Glasses

The authors employ Markov Chain analysis to track how the covariance and correlation of neurons change from one layer to the next.

  1. Shaped Networks: By analyzing a regime where depth $d$ and width $n$ both approach infinity, the authors show that the randomness of weights averages out. The network's behavior converges to an Ordinary Differential Equation (ODE).
  2. Unshaped Networks: This is the paper's primary contribution. Because correlation in standard networks approaches 1 rapidly, the authors use a "magnifying glass" technique, rescaling the correlation as $q_\ell = \ell^2(1 - \rho_\ell)$. This reveals a hidden SDE with a "singularity" at the first layer ($t=0$), explaining the violent signal changes seen at the start of deep networks.

Key Insights

  • ResNet-MLP Equivalence: The paper demonstrates that at initialization, a shaped MLP is mathematically identical to a ResNet with a $d^{-1/2}$ scaling factor on its residual branch.
  • The "Singular" Nature of Standard Networks: The discovery of the SDE for unshaped networks explains why they are so hard to initialize; the singularity at $t=0$ means the correlation changes violently in the first few layers before settling into a predictable path.
  • Commuting Limits: In ResNets, the order of taking limits (width vs. depth) does not change the result. However, in shaped MLPs, the order matters, providing critical insights into architectural stability.

Empirical Validation

The theoretical SDE derived for unshaped networks is not just a mathematical curiosity; it accurately predicts the behavior of real-world, finite networks.

The theoretical SDE density (red line) perfectly matches the empirical distribution of transformed correlation in a simulated ReLU MLP (grey bars).

As shown in Figure 1, the authors simulated networks with widths and depths of 150. The empirical distribution of the transformed correlation $r_t$ aligns almost perfectly with the density predicted by their SDE, validating that the "infinite" math holds for practical architectures.

Limitations and Future Directions

While this work provides a unified framework for signal stability, it focuses exclusively on networks at initialization. Future research is needed to determine how these differential equations evolve during the training process. Additionally, the "singularity" at $t=0$ in unshaped networks presents challenges for defining initial conditions, requiring specific mathematical "time-shifting" tricks to resolve. The authors suggest this framework could eventually provide a formal explanation for the success of normalization techniques like Batch Normalization or Layer Normalization.

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