Regularization in ResNet with Stochastic Depth

Soufiane Hayou, Fadhel Ayed

This NeurIPS 2021 paper provides a long-overdue theoretical foundation for Stochastic Depth (SD), a popular regularization technique for Residual Networks (ResNets). While SD is widely used to improve generalization and speed up training by randomly dropping layers, its success has been largely empirical—until now.

TL;DR

The authors provide the first analytical study of Stochastic Depth, proving that it acts as an explicit regularizer that enforces "flatness" in the loss landscape and mimics Gaussian noise injection in deep networks. They introduce SenseMode, a principled way to choose layer survival rates based on a "budget hypothesis" that outperforms standard methods in low-capacity training regimes.

What Problem Does This Paper Address?

Deep ResNets are notoriously difficult to train due to exploding or vanishing gradients. Stochastic Depth (SD) mitigates this by randomly bypassing residual blocks during training, effectively training a collection of shallower networks.

Training time comparison between Stochastic Depth and Dropout across different survival rates.

However, practitioners have lacked a theoretical framework to understand why this works better than standard weight decay or Dropout, and why it yields such significant improvements in training time. Furthermore, choosing the "survival probability" for each layer (whether to use a uniform rate or a linear decay) has historically been based on heuristics rather than mathematical principles. This paper aims to bridge the gap between the empirical success of SD and our theoretical understanding of its regularization effects.

Methods

The authors employ a "hybrid analysis" combining two powerful theoretical tools:

  1. Perturbation Analysis: They use a second-order Taylor expansion of the loss function to isolate the explicit regularization term induced by SD. This reveals how SD affects the Hessian of the loss.
  2. Signal Propagation Theory: By looking at the infinite-width limit, they analyze how gradients behave at initialization.

From this foundation, they derive SenseMode, an algorithm that assigns survival probabilities based on a layer's "Information Discrepancy"—a measure of how sensitive the network's output is to the removal of that specific layer.

Datasets

The theoretical results are validated using:

  • Toy Regression: A synthetic task estimating a high-dimensional sinusoidal function.
  • CIFAR-10 & CIFAR-100: Standard image classification benchmarks used to test ResNet-56 and ResNet-110 architectures.

Key Insights and Ideas

  • SD Enforces Flatness: The math shows that SD penalizes the Hessian of the loss function with respect to hidden activations. In deep learning, "flatter" minima (areas where the loss doesn't change drastically with small perturbations) are strongly correlated with better generalization.
  • The Gaussian Connection: In the limit of large depth, the authors prove that SD behaves like Gaussian Noise Injection (GNI). Specifically, it implicitly adds data-adaptive Gaussian noise to the pre-activations, making the model more robust to input variations.
  • Information Discrepancy: The paper defines a metric for how much "information" a layer contributes. SD naturally penalizes layers that create large discrepancies when removed, forcing the network to distribute features more redundantly across layers.
  • The Budget Hypothesis: The authors identify two regimes:
  • Large Budget (High average depth): The Uniform mode (constant survival probability) is optimal because it maximizes regularization variability.
  • Small Budget (Low average depth): The SenseMode (sensitivity-based) is superior because it ensures that the few layers that do survive are the most critical ones for the task.

Key Results

  • Gradient Stability: The authors show that for a ResNet-50, SD can reduce gradient explosion by six orders of magnitude at initialization compared to a standard ResNet.
Growth rate of gradient magnitude showing SD reduces gradient explosion by orders of magnitude compared to standard ResNet.
  • SenseMode Superiority: In "small budget" scenarios (e.g., training a model to run on low-power devices), SenseMode consistently outperformed both Uniform and Linear survival schedules. For example, on CIFAR-100 with a 10% depth budget, SenseMode achieved significantly lower error rates than the uniform baseline.
  • Normality Verification: Using Shapiro-Wilk tests, the authors empirically confirmed their "Gaussian Noise" theory, showing that as networks get deeper (beyond ~20 layers), the distribution of activations under SD becomes increasingly Gaussian.

Limitations and Future Work

The primary limitation is the reliance on a second-order Taylor approximation. While the authors argue that the second-order term dominates the regularization effect, higher-order terms might contribute to other unexplained behaviors of SD.

Additionally, SenseMode is currently implemented as a static choice at initialization. The authors suggest that a dynamic SenseMode, where survival probabilities evolve during training as layer sensitivities change, is a promising direction for future research. This could lead to even more efficient training schedules for ultra-deep architectures.

Summary updated

BibTeX
@inproceedings{hayou2021regularization,
  author = {Soufiane Hayou and Fadhel Ayed},
  title = {{Regularization in ResNet with Stochastic Depth}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=HVBCJDVNEF},
}
Figure