HackerPapers

arXiv:1609.04836cs.LG

On Large-Batch Training for Deep Learning: Generalization Gap and Sharp Minima

Nitish Shirish Keskar, Dheevatsa Mudigere, Jorge Nocedal, Mikhail Smelyanskiy, Ping Tak Peter Tang

Abstract

The stochastic gradient descent (SGD) method and its variants are algorithms of choice for many Deep Learning tasks. These methods operate in a small-batch regime wherein a fraction of the training data, say $32$-$512$ data points, is sampled to compute an approximation to the gradient. It has been observed in practice that when using a larger batch there is a degradation in the quality of the model, as measured by its ability to generalize. We investigate the cause for this generalization drop in the large-batch regime and present numerical evidence that supports the view that large-batch methods tend to converge to sharp minimizers of the training and testing functions - and as is well known, sharp minima lead to poorer generalization. In contrast, small-batch methods consistently converge to flat minimizers, and our experiments support a commonly held view that this is due to the inherent noise in the gradient estimation. We discuss several strategies to attempt to help large-batch methods eliminate this generalization gap.

arXiv comments
Accepted as a conference paper at ICLR 2017
Journal reference
DOI
Subjects
cs.LGMachine Learning math.OCOptimization and Control

On Hacker News

Linked by 5 identifiable commenters in 6 comments across 6 threads, from Nov 2016 to Nov 2025.

Comments linking this paper, per year.

Discussed in comments6 threads

    • Two thoughts: > how important is computing the exact gradient using calculus Normally the gradient is computed with a small "minibatch" of examples, meaning that on average over many steps the true gradient is followed, but each step individually never moves exacty along the…

      blackbear_View on HNParent context

    • Sorry, my last sentence > Otherwise, models can achieve very good generalization. was probably unclear. When we talk about generalization, we typically have to assume a lack of distributional shift. Otherwise, if the "truly unseen data" really is drawn from a different…

      chilleeView on HNParent context

    • Really don't think that's the best paper to say "sheds quite a bit of light on this". That paper has been somewhat controversial since it came out. I think https://arxiv.org/abs/1609.04836 is seminal in showing unsharp minima = generalization, the parent's paper is good for…

      chilleeView on HNParent context

    • > shouldn't a larger batch_size inherently provide more information about the optimal direction of the update? Not necessarily, since a batch gradient output (as I understand it, and at least used to code it) all gets averaged together. Consider standing in a valley with two…

      IanCalView on HNParent context

    • My understanding from this article is that for a greater GPU ram size you will need to increase the minibatch size which has a negative impact on the models ability to generalize[0]. [0] https://arxiv.org/abs/1609.04836

      mijoharasView on HNParent context

    • Then the total batch size is growing with the number of GPUs and the convergence might be impacted both in terms of speed and solution quality (e.g. https://arxiv.org/abs/1609.04836 ). I could believe you if tell you me that the validation loss and test accuracy of the large…

      ogriselView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.