Don't Decay the Learning Rate, Increase the Batch Size

Samuel L. Smith, Pieter-Jan Kindermans, Chris Ying, Quoc V. Le

Introduction

Instead of following the standard practice of decaying the learning rate during training, this paper demonstrates that you can achieve the same accuracy by increasing the batch size. This shift allows for massive parallelism, significantly reducing the number of parameter updates and cutting training times for models like ResNet-50 on ImageNet to under 30 minutes.

The Core Problem: Sequential Bottlenecks in SGD

Stochastic Gradient Descent (SGD) is the backbone of deep learning, but it is inherently sequential. To train a model, we typically perform hundreds of thousands of small parameter updates. While we can speed this up using large batches across multiple GPUs, simply increasing the batch size often leads to a "generalization gap"—a mysterious drop in test accuracy.

To combat this, researchers usually "decay" (reduce) the learning rate at specific intervals to help the model settle into a high-quality minimum. However, decaying the learning rate doesn't reduce the number of steps required; it just makes the steps smaller. The authors ask: Can we achieve the same "cooling" effect of learning rate decay by increasing the batch size instead?

Proposed Method: Scaling Batch Size

The authors base their approach on the "noise scale" ($g$) of SGD dynamics. Mathematically, the noise in the system is proportional to the learning rate ($\epsilon$) and inversely proportional to the batch size ($B$): $$g \approx \epsilon \frac{N}{B}$$ (where $N$ is the dataset size).

To reduce the noise (simulated annealing), you have two levers:

  1. Decrease $\epsilon$: The traditional approach (Learning Rate Decay).
  2. Increase $B$: The proposed approach.
Learning rate and batch size schedules

The authors propose a "Hybrid" schedule: start with a standard batch size and learning rate, but every time you would normally drop the learning rate by a factor of $\alpha$, you instead multiply the batch size by $\alpha$.

They also explore Effective Learning Rate scaling. By increasing the initial learning rate and scaling the batch size proportionally ($B \propto \epsilon$), they can further reduce the total number of parameter updates needed to reach the same level of accuracy.

Key Insights and Empirical Evidence

  • Mathematical Equivalence: The paper provides strong empirical evidence that decaying the learning rate and increasing the batch size follow nearly identical training curves with respect to epochs. They are two sides of the same coin.
  • The "Update" Bottleneck: The primary benefit of increasing batch size is the reduction in the number of parameter updates. Fewer updates mean less communication between GPUs/TPUs and better utilization of hardware.
Training cross-entropy vs epochs and parameter updates
  • The $N/10$ Limit: The authors found that you can continue increasing the batch size until it reaches roughly 10% of the total training set size. Beyond this point, the "noise scale" approximation breaks down, and you must revert to decaying the learning rate.
  • Momentum Scaling: You can also scale the momentum coefficient ($m$) alongside the batch size ($B \propto 1/(1-m)$) to further reduce updates, though this can slightly decrease final test accuracy.

Experimental Results

The researchers evaluated their methods on CIFAR-10 (using a "16-4" Wide ResNet) and ImageNet (using ResNet-50 and Inception-ResNet-V2). They utilized Ghost Batch Normalization to ensure that the statistics used for normalization remained independent of the total batch size, which is crucial when scaling to tens of thousands of images per step.

  • ResNet-50 on ImageNet: The authors reached 76.1% validation accuracy in under 30 minutes using a TPU pod.
  • Inception-ResNet-V2: They achieved 77% accuracy on ImageNet in fewer than 2,500 parameter updates by using a massive batch size of 65,536. For context, standard training often requires tens of thousands of updates.
  • Seamless Integration: The authors showed that you can "repurpose" existing, well-tuned learning rate schedules from literature and convert them into batch size schedules with zero hyper-parameter tuning.
  • Optimizer Agnostic: The strategy was successful across SGD, SGD with Momentum, Nesterov Momentum, and Adam.

Limitations and Future Work

  • Hardware Memory: The most obvious limitation is memory. Increasing batch size requires significant VRAM or a large cluster of distributed machines.
  • Momentum Lag: When using very high momentum coefficients to reduce updates, the "accumulation" variable (which tracks gradients) can struggle to adapt to rapid changes in the loss landscape, leading to a slight drop in accuracy.
  • Initial Instability: Very large initial learning rates can cause instabilities in the first few epochs. The authors suggest using a "warm-up" period (gradually increasing the learning rate) to mitigate this, as recommended in prior large-batch research.

Summary updated

BibTeX
@inproceedings{smith2018don,
  author = {Samuel L. Smith and Pieter-Jan Kindermans and Chris Ying and Quoc V. Le},
  title = {{Don't Decay the Learning Rate, Increase the Batch Size}},
  booktitle = {International Conference on Learning Representations},
  year = {2018},
  url = {https://openreview.net/forum?id=B1Yy1BxCZ},
}
Figure