Scaling Properties of Deep Residual Network

Alain-Sam Cohen, rama cont, alain rossier, Renyuan XuOpenReview 2021

TL;DR

This paper investigates the theoretical link between deep Residual Networks (ResNets) and Neural Ordinary Differential Equations (Neural ODEs) by analyzing how network weights scale with depth. The authors discover that the assumed smooth scaling of weights in the Neural ODE framework doesn't hold for many practical ResNet architectures, revealing at least three distinct scaling regimes and suggesting alternative differential equation models for deep networks.

What Problem Does This Paper Address?

Deep Residual Networks (ResNets) have achieved remarkable success in various machine learning tasks. Theoretically, there's a growing interest in understanding ResNets through the lens of Neural Ordinary Differential Equations (Neural ODEs). This connection hinges on the assumption that as a ResNet gets deeper (more layers), its weights converge to a smooth function. This paper questions this assumption by empirically and theoretically examining the scaling behavior of trained ResNet weights with increasing depth. The core problem is to understand if the Neural ODE framework accurately describes the asymptotic behavior of deep ResNets, especially when weights are learned via stochastic gradient descent.

Methods

The authors employ a combination of detailed numerical experiments and theoretical analysis. They train ResNets with varying depths on synthetic and real-world datasets and analyze the scaling of their trained weights. To characterize this scaling, they introduce several quantities to measure weight smoothness and convergence. They then propose two hypotheses for weight scaling: Hypothesis 1, where weights converge to a smooth function, and Hypothesis 2, where weights exhibit a non-zero "noise" component. They develop a systematic procedure to test these hypotheses, involving logarithmic regression to identify scaling exponents and decomposition of weights into trend and noise components. The theoretical analysis then derives the limiting behavior of the hidden state dynamics under different scaling regimes, leading to ODE or Stochastic Differential Equation (SDE) limits.

Datasets

  • Synthetic Dataset: A custom-generated dataset with $d=10$ dimensions, sampled from a uniform distribution in $[-1,1]^d$. The optimal input-output map is designed to be representable by the network.
  • MNIST: A low-dimensional embedding of the MNIST handwritten digits dataset. The original 28x28 images are projected to a $d=25$ dimensional vector using untrained convolutional layers.

Key Insights and Ideas

  • Challenging the Smoothness Assumption: The paper's central finding is that the assumed smooth convergence of weights in the Neural ODE framework is not universally true for trained ResNets. This casts doubt on the direct applicability of the standard Neural ODE model.
  • Multiple Scaling Regimes: Instead of a single smooth scaling, the authors identify at least three distinct scaling regimes for ResNet weights, depending on architectural choices like the activation function.
  • The Role of Activation Functions: The smoothness of the activation function (e.g., tanh vs. ReLU) plays a crucial role in determining the scaling behavior and the resulting limiting differential equation. ReLU networks, in particular, exhibit behaviors that suggest a more complex scaling.
  • Noise Term Significance: For certain architectures (like ReLU), a "noise" component in the weight scaling (Hypothesis 2) is not negligible and significantly impacts the network's accuracy, contrary to what a simple smooth limit would suggest.
  • Alternative Limits: The paper demonstrates that deep ResNets can converge to ODEs that differ from the standard Neural ODE formulation, or even to Stochastic Differential Equations (SDEs), depending on the weight scaling.

Key Results

  • Tanh Networks: For fully-connected networks with a tanh activation and a common scaling factor for weights, the results are consistent with Hypothesis 1, suggesting a smooth ODE limit.
  • ReLU Networks: For fully-connected networks with ReLU activation, the scaling behavior is more complex, aligning better with Hypothesis 2, which includes a non-zero noise component. This noise term is shown to be crucial for network accuracy.
  • Convolutional Networks: Convolutional ResNets exhibit a "sparse structure" where weights do not necessarily decrease with depth, indicating a third scaling regime that doesn't fit either Hypothesis 1 or 2, and suggesting no continuous ODE or SDE limit.
  • Theoretical Limits: The paper provides theoretical characterizations of the limiting behavior of the hidden state dynamics, showing convergence to ODEs (under specific scaling conditions) or SDEs, depending on the weight scaling and activation function properties.

Limitations and Future Work

  • Activation Function Smoothness: The theoretical analysis primarily focuses on smooth activation functions. The paper notes that if the activation function is not differentiable at 0 (like ReLU), a different limit might be expected, and the ReLU case's limit is described as "nontrivial."
  • Generalization of ReLU Limit: While the paper shows that ReLU networks align with Hypothesis 2, the precise nature of the limit as the "noise" term's influence is fully realized (especially for the discrete ReLU case) remains an open question.
  • Sparse CNNs: The observed sparse scaling in convolutional networks suggests a departure from continuous ODE/SDE limits, opening avenues for understanding these sparse representations.
  • Practical Implications: The findings suggest that the choice of activation function and architecture significantly impacts the theoretical underpinnings of deep networks, potentially guiding future architectural design and theoretical modeling. The authors point to interesting questions regarding the asymptotic behavior in the case of non-smooth activation functions and more complex architectures.

Summary updated

BibTeX
@misc{cohen2021scaling,
  author = {Alain-Sam Cohen and rama cont and alain rossier and Renyuan Xu},
  title = {{Scaling Properties of Deep Residual Network}},
  year = {2021},
  url = {https://openreview.net/forum?id=P8HKKyDBUQ},
  howpublished = {OpenReview},
}
Figure