Large Batch Training Does Not Need Warmup

Zhouyuan Huo, Bin Gu, Heng HuangarXiv 2020

Abstract

Training deep neural networks with massive batch sizes offers significant speedups but often suffers from optimization instability. To counteract this, practitioners typically employ a hand-tuned "warmup" period. This paper introduces CLARS (Complete Layer-wise Adaptive Rate Scaling), an algorithm that eliminates the need for warmup by automatically adjusting learning rates layer-by-layer based on a fine-grained theoretical analysis of gradient variance and Lipschitz constants.

Introduction

Large-batch training is a cornerstone of modern high-performance deep learning, allowing models to be trained across hundreds of GPUs simultaneously. However, as batch sizes increase, optimization becomes increasingly precarious. To maintain stability, three primary heuristics are commonly used: linear learning rate scaling, Layer-wise Adaptive Rate Scaling (LARS), and gradual warmup.

While effective, warmup is an empirical "tax"—it requires manual tuning of hyperparameters like duration and initial rate, and its theoretical necessity has remained poorly understood. This work bridges the gap between these heuristics and optimization theory, proposing a method to achieve stability without manual intervention.

The CLARS Algorithm

The authors propose CLARS, a refinement of the LARS optimizer. Unlike standard approaches that treat the network as a monolithic function, CLARS utilizes a fine-grained micro-step analysis. By viewing each layer as a distinct block with its own Lipschitz constant (a measure of gradient volatility) and gradient variance, the algorithm can tailor updates more precisely.

CLARS introduces a crucial normalization term to the standard LARS update rule. While LARS scales learning rates by the ratio of weight norms to gradient norms, CLARS incorporates the average gradient norm across all layers. This term acts as an automatic "brake" during periods of high instability, effectively mimicking the stabilization provided by manual warmup.

Key Insights: The "Why" of Warmup

A central contribution of this paper is identifying why warmup is necessary in the first place. Through visualization of gradient variances, the authors demonstrate that layers closer to the output ("top" layers) exhibit significantly higher volatility during the initial stages of training.

Figure 1: Layer-wise divergence thresholds in a 5-layer CNN. Different layers exhibit vastly different "speed limits," necessitating adaptive scaling.

As shown in Figure 1, different layers have distinct divergence thresholds. A learning rate that is optimal for one layer might cause another to explode. CLARS respects these individual limits, suppressing the learning rate in volatile layers and "releasing the brakes" as the model stabilizes.

Experimental Results

The researchers validated CLARS across standard benchmarks including CIFAR-10 and ImageNet (ResNet50, DenseNet121, MobileNetv2).

Figure 4: Training performance on CIFAR-10 and the traditional warmup-plus-decay learning rate schedule.

Key findings include:

  • Elimination of Warmup: CLARS successfully trained ResNet50 on ImageNet with a batch size of 16,384 from the first step, a scenario where standard LARS often fails without precise warmup tuning.
  • Superior Convergence: In most tests, CLARS reached target accuracy faster than LARS, demonstrating lower training loss and higher top-1 accuracy in fewer epochs.
  • Architectural Robustness: The algorithm proved stable even for "thin" models like MobileNetv2, which are notoriously difficult to optimize with large batches.

Conclusion

CLARS provides a theoretically grounded alternative to the empirical warmup heuristic. By automating stability through layer-wise normalization, it simplifies the training pipeline for large-scale deep learning. While some global scaling factors remain, the method significantly reduces the hyperparameter search space. Future work may extend these benefits to Transformer architectures in natural language processing.

Summary updated

BibTeX
@misc{huo2020large,
  author = {Zhouyuan Huo and Bin Gu and Heng Huang},
  title = {{Large Batch Training Does Not Need Warmup}},
  year = {2020},
  eprint = {2002.01576},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2002.01576},
}
Figure