English

A Bayesian Perspective on Generalization and Stochastic Gradient Descent

Machine Learning 2018-02-16 v3 Artificial Intelligence Machine Learning

Abstract

We consider two questions at the heart of machine learning; how can we predict if a minimum will generalize to the test set, and why does stochastic gradient descent find minima that generalize well? Our work responds to Zhang et al. (2016), who showed deep neural networks can easily memorize randomly labeled training data, despite generalizing well on real labels of the same inputs. We show that the same phenomenon occurs in small linear models. These observations are explained by the Bayesian evidence, which penalizes sharp minima but is invariant to model parameterization. We also demonstrate that, when one holds the learning rate fixed, there is an optimum batch size which maximizes the test set accuracy. We propose that the noise introduced by small mini-batches drives the parameters towards minima whose evidence is large. Interpreting stochastic gradient descent as a stochastic differential equation, we identify the "noise scale" g=ϵ(NB1)ϵN/Bg = \epsilon (\frac{N}{B} - 1) \approx \epsilon N/B, where ϵ\epsilon is the learning rate, NN the training set size and BB the batch size. Consequently the optimum batch size is proportional to both the learning rate and the size of the training set, BoptϵNB_{opt} \propto \epsilon N. We verify these predictions empirically.

Keywords

Cite

@article{arxiv.1710.06451,
  title  = {A Bayesian Perspective on Generalization and Stochastic Gradient Descent},
  author = {Samuel L. Smith and Quoc V. Le},
  journal= {arXiv preprint arXiv:1710.06451},
  year   = {2018}
}

Comments

13 pages, 9 figures. Published as a conference paper at ICLR 2018

R2 v1 2026-06-22T22:17:23.458Z