AdaBatch: Adaptive Batch Sizes for Training Deep Neural Networks

Aditya Devarakonda, Maxim Naumov, Michael GarlandarXiv 2017

Introduction

Training deep neural networks (DNNs) often involves a fundamental trade-off between convergence quality and computational efficiency, known as the "Batch Size Dilemma." Small batch sizes are typically preferred for their superior convergence properties; the inherent noise in their gradient estimates helps models escape sharp local minima and find more generalizable solutions. Conversely, large batch sizes are favored for hardware efficiency, as they better utilize GPU memory bandwidth and reduce communication overhead in distributed settings.

AdaBatch addresses this dilemma by introducing a training strategy that adaptively increases batch sizes. By starting with small batches and progressively scaling up, AdaBatch captures the optimization benefits of small-batch training while leveraging the parallel processing power of modern hardware for significantly faster execution.

Methodology

The core of AdaBatch is the dynamic adjustment of batch size at specific intervals during training. To ensure stability and maintain the optimization trajectory, the authors employ several key techniques:

  • Linear Scaling Rule: To keep the training dynamics consistent, the ratio of the learning rate ($\alpha$) to the batch size ($r$) is kept constant ($\alpha/r$). When the batch size is increased, the learning rate is adjusted proportionally.
  • Mimicking Learning Rate Decay: The paper demonstrates that increasing the batch size is mathematically analogous to decaying the learning rate. Both methods reduce the variance of weight updates as the model converges toward a solution.
  • Hardware Optimization: By increasing batch sizes in later stages, AdaBatch exposes greater data-parallelism when the model's requirement for stochastic "noise" is lower, allowing for better utilization of multi-GPU systems.

Experimental Evaluation

The authors validated AdaBatch across multiple standard benchmarks, including CIFAR-10, CIFAR-100, and large-scale testing on ImageNet with ResNet-50.

Key Results

AdaBatch achieved significant performance gains without compromising model accuracy. On a system with four NVIDIA Tesla P100 GPUs, the method delivered speedups of up to 6.25x for ResNet-20 and 3.54x for VGG19 compared to fixed-batch baselines.

Test error comparison on CIFAR-10 for VGG19, ResNet-20, and AlexNet. AdaBatch (red) closely tracks the small-batch baseline (green) while significantly outperforming the large-batch baseline (blue).

Critically, accuracy preservation was excellent; across all CIFAR and ImageNet tests, AdaBatch remained within 1% of the best-performing fixed small-batch models. On ImageNet, it successfully matched the accuracy of a fixed 4,096 batch size while scaling to a final batch size of 32,768, demonstrating its effectiveness for massive-scale distributed training.

Discussion and Insights

The success of AdaBatch reinforces the view of batch size as a critical regularizer rather than just a hardware parameter. By treating it as a dynamic hyperparameter, practitioners can maintain "constant work per epoch" in terms of FLOPs while increasing the efficiency of that work on parallel hardware. Furthermore, AdaBatch is complementary to other large-batch training techniques like Learning Rate Warmup or Layer-wise Adaptive Rate Scaling (LARS).

Conclusion and Future Work

While AdaBatch offers a powerful tool for accelerating DNN training, it does introduce new hyperparameters, such as the initial batch size and the scaling schedule. Additionally, the maximum batch size is ultimately constrained by available GPU memory. Future research may explore automated criteria, such as gradient variance estimates, to trigger batch size increases dynamically rather than relying on fixed epoch schedules.

Summary updated

BibTeX
@misc{devarakonda2017adabatch,
  author = {Aditya Devarakonda and Maxim Naumov and Michael Garland},
  title = {{AdaBatch: Adaptive Batch Sizes for Training Deep Neural Networks}},
  year = {2017},
  eprint = {1712.02029},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1712.02029},
}
Figure