Stabilize deep ResNet with a sharp scaling factor τ

Huishuai Zhang, Da Yu, Mingyang Yi, Wei Chen, Tie-Yan Liu

Abstract

We study the stability and convergence of training deep ResNets with gradient descent. Specifically, we show that the parametric branch in the residual block should be scaled down by a factor $\tau = O(1/\sqrt{L})$ to guarantee a stable forward/backward process, where $L$ is the number of residual blocks. Moreover, we establish a converse result that the forward process is unbounded when $\tau > L^{-1/2+c}$ for any positive constant $c$. These results together establish a sharp value of the scaling factor in determining the stability of deep ResNet. Based on this, we show that gradient descent finds global minima if the ResNet is properly over-parameterized. Empirically, this factor allows training deep ResNets without normalization layers and provides significant performance gains even when normalization is used.

Introduction: The Exploding Signal Problem

In the quest for higher performance, neural networks have become increasingly deep. While Residual Networks (ResNets) revolutionized this by using "shortcut" connections to help gradients flow, they aren't immune to the "exploding signal" problem. Standard initialization schemes, like Kaiming or Glorot, are designed to keep variance constant across a single layer. However, in a ResNet, the output of a block is the sum of the identity mapping and a residual branch. As you stack hundreds or thousands of these blocks, the magnitude of the hidden states can grow uncontrollably.

Previous heuristics suggested scaling the residual branch by $1/L$, but this was often too conservative. This research seeks the "sharp" scaling factor—the precise mathematical boundary between a stable network and one that blows up.

Methodology: Finding the Sharp Threshold

The authors analyze a simplified ResNet architecture where each residual block follows the form: $$h_l = \phi(h_{l-1} + \tau F_l(h_{l-1}))$$ where $\tau$ is the scaling factor and $F_l$ is the parametric branch. Through non-asymptotic analysis and spectral norm bounding, the paper establishes that $\tau = 1/\sqrt{L}$ is the exact tipping point. If $\tau$ is slightly larger (e.g., $L^{-1/2+c}$), the output norm grows polynomially with depth, leading to instability. Interestingly, the randomness of the weights actually helps concentrate the signal, maintaining stability where naive bounds might predict failure.

Empirical Results: Training the "Untrainable"

The theoretical findings were validated across standard benchmarks including MNIST, CIFAR-10/100, and ImageNet. A key highlight was the successful training of a ResNet-1202 (1,202 layers) on CIFAR-10 without any normalization layers, achieving high accuracy where standard models would fail to converge.

Stability of ResNet-1202 with and without scaling factor τ at initialization (Epoch 0) and during training (Epoch 50).

As shown in the figure above, without the $\tau$ factor, the output norm of a ResNet-1202 explodes immediately at initialization. While Batch Normalization (BN) mitigates this, it still allows the norm to grow. Incorporating the $\tau = 1/\sqrt{L}$ factor keeps the norm ratio stable near 1.0 throughout the training process, even without normalization layers.

Key Insights and Performance Gains

  • Depth-Independent Convergence: With $\tau = 1/\sqrt{L}$, the convergence rate of gradient descent becomes independent of the network's depth. This theoretically justifies why ResNets are easier to train than vanilla feedforward networks as they get deeper.
  • Stability vs. Normalization: The proposed $\tau$ factor is actually more stable than Batch Normalization at the start of training and eliminates the need for "learning rate warm-up" phases.
  • Boosting Standard Models: Even when Batch Normalization is used, adding the $\tau$ factor improves performance. On ImageNet, a ResNet-152 saw its top-1 error drop from 21.7% to 20.9% simply by incorporating the scaling factor.

Limitations and Future Work

While these results are robust, the convergence proofs rely on the "over-parameterized" regime (very wide networks), which may not perfectly reflect smaller practical models. Furthermore, the current analysis focuses on standard ResNets. Exploring how this scaling factor applies to Transformers, which also rely heavily on residual connections and layer normalization, is a vital next step. Additionally, in complex architectures like those used for ImageNet, a more granular, per-stage scaling might be even more effective than a single global $\tau$.

Summary updated

BibTeX
@article{zhang2022stabilize,
  author = {Huishuai Zhang and Da Yu and Mingyang Yi and Wei Chen and Tie-Yan Liu},
  title = {{Stabilize deep ResNet with a sharp scaling factor τ}},
  journal = {Machine Learning},
  year = {2022},
  url = {https://openreview.net/forum?id=7oKxtiP7Zw},
}
Figure