On Large-Batch Training for Deep Learning: Generalization Gap and Sharp Minima
Nitish Shirish KeskarDheevatsa MudigereJorge NocedalMikhail SmelyanskiyPing Tak Peter Tang
Demonstrates that the generalization drop in large-batch deep learning training stems from convergence to sharp minimizers, contrasting this with small-batch methods that inherently reach flat minima through gradient noise.
Large-batch training of deep neural networks produces models that generalize noticeably worse than those trained with conventional small batches, even when both reach comparable training accuracy. This gap limits the use of large batches to accelerate parallel training on many processors, an increasingly attractive option as data sets and models grow. The work set out to identify the underlying cause through controlled numerical experiments rather than theory alone.
Researchers trained six representative networks—two fully connected and four convolutional—on MNIST, TIMIT, CIFAR-10, and CIFAR-100. They compared the ADAM optimizer run with a fixed small batch of 256 examples against a large batch equal to 10 percent of the training set. Solutions were characterized with one-dimensional parametric slices between small-batch and large-batch minima and with a computationally feasible sensitivity metric that quantifies how rapidly the loss rises in a small neighborhood of each solution.
The experiments show that large-batch runs consistently converge to sharp minimizers whose loss surfaces rise steeply along a modest number of directions, whereas small-batch runs reach flat minimizers. The sharpness metric differs by one to two orders of magnitude between the two regimes, and the testing-accuracy gap reaches several percentage points. The difference is not explained by overfitting; early-stopping does not close it. Noise inherent in small-batch gradient estimates appears to eject iterates from basins of sharp minima, an effect that disappears once the batch exceeds a network-specific threshold.
These results imply that any attempt to scale deep-learning training by simply enlarging the batch will encounter a generalization penalty unless the optimizer is modified to avoid sharp regions. Because training time can drop dramatically with larger batches when parallelism is high, closing the gap would materially shorten development cycles for large models.
Simple remedies such as data augmentation, conservative (proximal) updates, and adversarial training narrow the accuracy difference modestly but still produce relatively sharp solutions. Dynamic batch-size schedules that begin small and grow, or warm-starting a large-batch run from a short small-batch phase, appear more promising and warrant further study. The main limitations are that the sharpness measure is a practical proxy rather than an exact eigenvalue computation and that the networks and data sets, while representative, do not exhaust modern architectures.
- Paper: Optimization Methods for Large-Scale Machine Learning, Léon Bottou et al. (2016). Reading this foundational survey on stochastic gradient methods and large-scale optimization clarifies the computational and theoretical trade-offs that motivate the generalization gap in large-batch training.
- Paper: An overview of gradient descent optimization algorithms, Sebastian Ruder (2016). Understanding the mechanics and mini-batch dynamics of gradient descent optimization algorithms provides necessary context for analyzing how batch size influences convergence behavior.
- Paper: Accurate, Large Minibatch SGD: Training ImageNet in 1 Hour, Priya Goyal et al. (2017). This follow-up work extends the source study by demonstrating that large-minibatch SGD can successfully scale to massive batch sizes of 8,192 images without a generalization drop when paired with learning rate warmups and linear scaling.
