A Large Batch Optimizer Reality Check: Traditional, Generic Optimizers Suffice Across Batch Sizes

Zachary Nado, Justin Gilmer, Christopher J Shallue, Rohan Anil, George Edward Dahl

Abstract

Recently the LARS and LAMB optimizers have been proposed for training neural networks faster using large batch sizes. LARS and LAMB add layer-wise normalization to the update rules of Heavy-ball momentum and Adam, respectively, and have become popular in prominent benchmarks and deep learning libraries. However, without fair comparisons to standard optimizers, it remains an open question whether LARS and LAMB have any benefit over traditional, generic algorithms. In this work we demonstrate that standard optimization algorithms such as Nesterov momentum and Adam can match or exceed the results of LARS and LAMB at large batch sizes. Our results establish new, stronger baselines for future comparisons at these batch sizes and shed light on the difficulties of comparing optimizers for neural network training more generally.

Introduction

Modern hardware accelerators thrive on data parallelism, processing data faster with large batch sizes. However, simply increasing the batch size often degrades model performance or requires disproportionately more training steps. Specialized optimizers like LARS and LAMB, which incorporate layer-wise normalization, were introduced to address this and have become the de facto standards for large-batch training. This work investigates whether these specialized tools are truly necessary or if the perceived superiority stems from inadequate tuning of standard baselines like Nesterov Momentum and Adam.

Methods

The authors benchmarked standard Nesterov Momentum and Adam against the large-batch results originally used to justify LARS (ResNet-50) and LAMB (BERT-Large). They maintained identical model architectures and datasets, focusing solely on optimizer performance. Key to this fair comparison was an extensive quasi-random search to tune hyperparameters, including learning rate, momentum, weight decay, and warmup schedules. Furthermore, the authors identified and applied "hidden tricks" from state-of-the-art pipelines—such as excluding specific parameters from weight decay—to the standard optimizers to ensure an apples-to-apples evaluation.

Key Insights

A central finding is that the perceived advantage of novel optimizers often results from unequal tuning effort. Standard optimizers, when tuned with the same rigor and regularization tricks, remain highly competitive.

Crucially, learning rate schedules are optimizer-specific. A schedule optimized for LARS cannot be directly applied to Nesterov Momentum; the optimal shape of the warmup phase is tightly coupled to the optimizer's internal dynamics.

Optimal learning rate schedules for Nesterov and LARS differ significantly in their warmup phase, illustrating that schedules must be tuned specifically for each optimizer.

Results

The study demonstrates that standard optimizers can match or exceed specialized ones in large-batch regimes:

  • ResNet-50: Nesterov Momentum matched the state-of-the-art LARS validation accuracy of 75.9% at a batch size of 32,768.
  • BERT-Large: Adam outperformed LAMB at massive batch sizes, achieving higher SQuAD F1 scores. A new speed record for BERT pretraining was established using Adam at a batch size of 65,536, reaching a 90.46 F1 score in just 7,818 steps.
Adam matches or exceeds LAMB performance (SQuAD F1 score) across various large batch sizes for BERT-Large pretraining.

Conclusion

This work proves that traditional, generic optimizers are sufficient for large-batch training when properly tuned. While matching specialized benchmarks requires significant effort, it highlights the need for more rigorous evaluation protocols in optimization research. Future benchmarks should ideally use hidden workloads to prevent overfitting optimizer designs and tuning strategies to specific datasets.

Summary updated

BibTeX
@inproceedings{nado2021large,
  author = {Zachary Nado and Justin Gilmer and Christopher J Shallue and Rohan Anil and George Edward Dahl},
  title = {{A Large Batch Optimizer Reality Check: Traditional, Generic Optimizers Suffice Across Batch Sizes}},
  booktitle = {International Conference on Learning Representations},
  year = {2021},
  url = {https://openreview.net/forum?id=CnzIdrjjnBO},
}
Figure