[Paper Review] Understanding Generalization and Stochastic Gradient Descent
This paper explains why stochastic gradient descent (SGD) generalizes well in deep learning by linking generalization to Bayesian evidence, which favors broad minima over sharp ones. It identifies an optimal batch size proportional to the product of learning rate and training set size, showing that small mini-batches introduce noise that drives optimization toward high-evidence minima, verified empirically.
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 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 = \epsilon (\frac{N}{B} - 1) \approx \epsilon N/B$, where $\epsilon$ is the learning rate, $N$ the training set size and $B$ the batch size. Consequently the optimum batch size is proportional to both the learning rate and the size of the training set, $B_{opt} \propto \epsilon N$. We verify these predictions empirically.
Motivation & Objective
- To understand why stochastic gradient descent finds minima that generalize well on test data.
- To explain the generalization behavior of neural networks, especially in light of Zhang et al. (2016), who showed models can memorize random labels.
- To investigate the role of batch size and learning rate in determining generalization performance.
- To connect SGD dynamics to Bayesian evidence, which penalizes sharp minima regardless of parameterization.
- To derive and validate a theoretical optimum batch size that maximizes test accuracy.
Proposed method
- Uses Bayesian evidence as a measure of model generalization, which favors broad minima and is invariant to model parameterization.
- Models SGD as a stochastic differential equation, deriving the noise scale $ g = \epsilon (\frac{N}{B} - 1) \approx \epsilon N/B $, where $ \epsilon $ is the learning rate, $ N $ the training set size, and $ B $ the batch size.
- Proposes that small mini-batches introduce noise that drives parameters toward minima with high Bayesian evidence.
- Derives the optimal batch size as $ B_{\text{opt}} \propto \epsilon N $, showing it scales linearly with both learning rate and training set size.
- Empirically validates the theoretical predictions using small linear models and deep neural networks on both real and randomly labeled data.
Experimental results
Research questions
- RQ1Why do models trained with SGD generalize well despite being able to memorize random labels?
- RQ2How does the choice of batch size affect generalization performance in SGD?
- RQ3What is the relationship between the noise introduced by stochasticity and the Bayesian evidence of a minimum?
- RQ4Can the optimal batch size be predicted analytically based on learning rate and training set size?
- RQ5Does the phenomenon of memorization on random labels extend beyond deep networks to smaller models?
Key findings
- The Bayesian evidence penalizes sharp minima and is invariant to model parameterization, providing a theoretical explanation for generalization.
- Small linear models also exhibit the ability to memorize randomly labeled data, confirming that memorization is not exclusive to deep networks.
- When the learning rate is fixed, there exists an optimal batch size that maximizes test set accuracy.
- The optimal batch size scales proportionally with both the learning rate and the size of the training set, $ B_{\text{opt}} \propto \epsilon N $.
- Empirical results confirm that the noise introduced by small mini-batches drives optimization toward high-evidence minima, improving generalization.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.