[Paper Review] On the Generalization of Stochastic Gradient Descent with Momentum
This paper introduces SGD with early momentum (SGDEM), a modified stochastic gradient descent variant that applies momentum only during initial training epochs to improve generalization. It proves that standard SGDM can have unbounded stability gaps for convex losses, but SGDEM ensures generalization for smooth Lipschitz and strongly convex functions, with theoretical bounds on expected true risk and empirical validation on ResNet-18 and logistic regression models.
While momentum-based accelerated variants of stochastic gradient descent (SGD) are widely used when training machine learning models, there is little theoretical understanding on the generalization error of such methods. In this work, we first show that there exists a convex loss function for which the stability gap for multiple epochs of SGD with standard heavy-ball momentum (SGDM) becomes unbounded. Then, for smooth Lipschitz loss functions, we analyze a modified momentum-based update rule, i.e., SGD with early momentum (SGDEM) under a broad range of step-sizes, and show that it can train machine learning models for multiple epochs with a guarantee for generalization. Finally, for the special case of strongly convex loss functions, we find a range of momentum such that multiple epochs of standard SGDM, as a special form of SGDEM, also generalizes. Extending our results on generalization, we also develop an upper bound on the expected true risk, in terms of the number of training steps, sample size, and momentum. Our experimental evaluations verify the consistency between the numerical results and our theoretical bounds. SGDEM improves the generalization error of SGDM when training ResNet-18 on ImageNet in practical distributed settings.
Motivation & Objective
- To address the lack of theoretical understanding of generalization in momentum-based SGD variants like SGDM.
- To show that standard SGDM can suffer from unbounded stability gaps even for convex loss functions over multiple epochs.
- To propose SGDEM—a modified momentum update rule that applies momentum only for an early phase of training—to ensure generalization guarantees.
- To derive upper bounds on expected true risk in terms of training steps, sample size, and momentum parameters.
- To validate the theoretical findings experimentally on ResNet-18 (ImageNet) and logistic regression (notMNIST/MNIST), showing improved generalization with tuned momentum duration.
Proposed method
- Introduce SGDEM, a variant of SGDM where momentum is applied only for the first $ t_d $ epochs and then disabled, to control generalization behavior.
- Use the framework of uniform stability to analyze the generalization error of SGDEM under smooth Lipschitz and strongly convex loss functions.
- Derive an upper bound on the expected true risk using stability analysis, incorporating step-size, momentum, training steps, and sample size.
- Prove that for smooth Lipschitz functions, SGDEM generalizes regardless of momentum value, under broad step-size conditions.
- Establish that for strongly convex functions, standard SGDM (as a special case of SGDEM) generalizes when momentum is within a specific range.
- Validate theoretical bounds via experiments on ResNet-18 (ImageNet) and logistic regression (notMNIST/MNIST), comparing generalization error and test accuracy across different momentum schedules.
Experimental results
Research questions
- RQ1Does standard SGDM with heavy-ball momentum exhibit unbounded stability gaps for convex loss functions over multiple epochs?
- RQ2Can a modified momentum update rule—SGDEM—guarantee generalization for smooth Lipschitz loss functions under broad step-size conditions?
- RQ3What is the range of momentum values for which standard SGDM generalizes in the case of strongly convex losses?
- RQ4How does the duration of momentum application ($ t_d $) affect generalization error in practical training scenarios?
- RQ5Can theoretical upper bounds on expected true risk be derived and validated empirically for SGDEM?
Key findings
- For a specific convex loss function, the stability gap of standard SGDM becomes unbounded over multiple epochs, demonstrating its potential to harm generalization.
- SGDEM ensures generalization for smooth Lipschitz loss functions under broad step-size conditions, regardless of the momentum value.
- For strongly convex functions, standard SGDM generalizes when the momentum parameter lies within a specific range, which is a novel theoretical contribution.
- Theoretical upper bounds on expected true risk are derived and shown to be consistent with numerical results, with optimal $ \tilde{t}^* $ determined via numerical solution of a non-analytic equation.
- On ResNet-18 trained on ImageNet in a distributed setting, SGDEM achieves lower generalization error than SGDM when momentum is applied for only 50 out of 90 epochs.
- In logistic regression experiments on notMNIST and MNIST, test accuracy peaks when momentum is applied for a limited number of epochs, confirming that prolonged momentum can degrade 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.