Large Batch Optimization for Deep Learning Using New Complete Layer-Wise Adaptive Rate Scaling

Zhouyuan Huo, Bin Gu, Heng Huang

Introduction

Training deep neural networks with massive batch sizes is a "double-edged sword": while it significantly speeds up training through parallelism, it often leads to optimization instability and poor generalization. To combat this, practitioners typically rely on empirical "hacks" such as linear learning rate scaling and gradual warmup. While effective, these methods lack a rigorous mathematical foundation. This paper introduces CLARS (Complete Layer-wise Adaptive Rate Scaling), an optimization algorithm that replaces heuristic warmup with a theoretically grounded approach.

The CLARS Algorithm

CLARS builds upon the existing LARS (Layer-wise Adaptive Rate Scaling) optimizer. While standard LARS adjusts learning rates based on the ratio of weight norms to gradient norms, CLARS introduces a critical component: gradient variance.

By incorporating the average of squared norms of individual gradients, CLARS automatically dampens the learning rate when gradient variance is high—a common occurrence at the start of training—and increases it as gradients stabilize. This approach is supported by a fine-grained theoretical analysis that considers layer-by-layer smoothness constants (Lipschitz constants) rather than a single global assumption.

Understanding Layer-Wise Volatility

A key insight of the paper is that gradient variance is not uniform across a network. Visualization of a 5-layer fully connected network (FCN) reveals that "top" layers (closer to the output) exhibit significantly higher gradient variance than "bottom" layers during the initial stages of training.

Figure 6: Heatmap showing that gradient variance is significantly higher in the top layers (e.g., fc5.bias) during early epochs.

This observation explains why empirical tricks like freezing fully connected layers or using warmup are effective: they act as proxies for variance control. CLARS formalizes this by automating the stabilization process mathematically.

Experimental Evaluation

The authors validated CLARS across standard benchmarks, including CIFAR-10, CIFAR-100, and ImageNet. A comparison of different stabilization strategies on CIFAR-100 demonstrates that layer-wise approaches consistently outperform standard warmup or no-warmup baselines.

Figure 5: Testing accuracy on CIFAR-100 for ResNet32 and VGG11, showing that Layer-Wise Warmup significantly improves convergence over standard methods.

On the ImageNet "gold standard," CLARS demonstrated superior robustness:

  • DenseNet121: Achieved 73.6% Top-1 accuracy, outperforming LARS (70.4%).
  • MobileNetv2: Reached 70.9% accuracy, compared to 69.6% for LARS.
  • ResNet50: Matched LARS's high performance (75.1%) while exhibiting faster initial convergence.

Crucially, CLARS stabilized training from the first iteration even with batch sizes as large as 16,384, where standard methods often diverge.

Conclusion

CLARS provides a principled alternative to empirical warmup for large-batch training. By accounting for layer-wise gradient variance, it offers a more robust and theoretically grounded path to scaling deep learning models. While calculating exact gradient variance introduces some computational overhead, the resulting gains in stability and accuracy make it a compelling choice for large-scale optimization.

Summary updated

BibTeX
@inproceedings{huo2021large,
  author = {Zhouyuan Huo and Bin Gu and Heng Huang},
  title = {{Large Batch Optimization for Deep Learning Using New Complete Layer-Wise Adaptive Rate Scaling}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.1609/aaai.v35i9.16962},
}
Figure