Skip to main content
QUICK REVIEW

[Paper Review] Large-Batch Training for LSTM and Beyond

Yang You, Jonathan Hseu|arXiv (Cornell University)|Jan 24, 2019
Advanced Neural Network ApplicationsComputer Science27 references12 citations
TL;DR

This paper introduces Linear-Epoch Gradual-Warmup (LEGW), an automated hyperparameter tuning method that enables effective large-batch training for both LSTM and CNN models using the theoretically sound Sqrt Scaling learning rate scheme. LEGW achieves 5.3× average speedup on LSTM tasks and maintains accuracy when scaling batch sizes up to 32K without manual tuning, outperforming prior linear scaling methods.

ABSTRACT

Large-batch training approaches have enabled researchers to utilize large-scale distributed processing and greatly accelerate deep-neural net (DNN) training. For example, by scaling the batch size from 256 to 32K, researchers have been able to reduce the training time of ResNet50 on ImageNet from 29 hours to 2.2 minutes (Ying et al., 2018). In this paper, we propose a new approach called linear-epoch gradual-warmup (LEGW) for better large-batch training. With LEGW, we are able to conduct large-batch training for both CNNs and RNNs with the Sqrt Scaling scheme. LEGW enables Sqrt Scaling scheme to be useful in practice and as a result we achieve much better results than the Linear Scaling learning rate scheme. For LSTM applications, we are able to scale the batch size by a factor of 64 without losing accuracy and without tuning the hyper-parameters. For CNN applications, LEGW is able to achieve the same accuracy even as we scale the batch size to 32K. LEGW works better than previous large-batch auto-tuning techniques. LEGW achieves a 5.3X average speedup over the baselines for four LSTM-based applications on the same hardware. We also provide some theoretical explanations for LEGW.

Motivation & Objective

  • Address the lack of effective large-batch training techniques for RNNs like LSTM, despite their widespread use.
  • Overcome the need for extensive hyperparameter tuning when scaling batch sizes beyond 8K in CNNs.
  • Bridge the gap between theoretical Sqrt Scaling and practical large-batch training, which has seen limited success.
  • Develop an automated, robust method that maintains model accuracy while maximizing training speed across diverse architectures.
  • Demonstrate the effectiveness of LEGW across both RNN and CNN workloads with consistent performance improvements.

Proposed method

  • Propose Linear-Epoch Gradual-Warmup (LEGW), a learning rate warmup strategy that scales the learning rate with the square root of the batch size.
  • Apply Sqrt Scaling to maintain gradient variance stability, as theoretically supported by prior work.
  • Use a linearly increasing warmup schedule over a fixed number of epochs, with warmup duration proportional to the inverse of the batch size.
  • Integrate LEGW with existing optimizers like LARS for CNNs and standard SGD for RNNs to ensure compatibility and performance.
  • Automatically determine learning rate and warmup duration based on batch size, eliminating manual tuning.
  • Validate the method across multiple benchmarks: GNMT (LSTM), PTB (LSTM), and ImageNet with ResNet50 (CNN).

Experimental results

Research questions

  • RQ1Can Sqrt Scaling be effectively applied in practice for large-batch training of both RNNs and CNNs?
  • RQ2Does LEGW eliminate the need for manual hyperparameter tuning when scaling batch sizes beyond 8K?
  • RQ3How does LEGW compare to linear scaling and other auto-tuning methods in terms of accuracy and speed?
  • RQ4Can LEGW maintain model accuracy when scaling batch sizes to 32K for both LSTM and CNN models?
  • RQ5What is the theoretical basis for LEGW’s effectiveness in stabilizing training at large batch sizes?

Key findings

  • For GNMT (LSTM), LEGW maintains a BLEU score of 22.2 when scaling the batch size from 256 to 4096, without any hyperparameter tuning.
  • For PTB (LSTM), LEGW sustains performance at a batch size of 8192 (32× increase) with no accuracy drop and no tuning.
  • On ImageNet with ResNet50, LEGW achieves 93.18% top-5 accuracy at a batch size of 32,768, matching the benchmark standard without tuning.
  • LEGW achieves a 5.3× average speedup over baselines across four LSTM-based applications on the same TPU-v2 hardware.
  • LEGW outperforms previous auto-tuning techniques and linear scaling schemes, maintaining higher accuracy even at extreme batch sizes.
  • The method enables consistent performance across diverse models, demonstrating robustness in both RNN and CNN settings.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.