Abstract
While momentum is widely used to accelerate the training of deep learning models, its impact on generalization remains theoretically under-explored. This paper investigates the stability of Stochastic Gradient Descent with Momentum (SGDM) and reveals that standard momentum can lead to unbounded stability gaps in certain convex settings. To address this, we propose SGD with Early Momentum (SGDEM), a strategy that utilizes momentum only during the initial phase of training. We provide theoretical guarantees for the convergence and stability of SGDEM and demonstrate its empirical effectiveness on standard benchmarks, showing that it preserves optimization speed while improving generalization.
Introduction
Stochastic Gradient Descent (SGD) is the foundational optimizer for deep learning, often enhanced with momentum (Heavy-Ball method) to navigate complex loss landscapes and accelerate convergence. Despite its empirical success, a theoretical gap exists regarding the generalization properties of momentum-based variants. While vanilla SGD is known to be "stable"—meaning small changes in the training set do not significantly alter the final model—similar guarantees for SGDM have been elusive. This work explores whether momentum compromises generalization and proposes a principled modification to mitigate potential instability.
Stability and the Generalization Gap
The authors employ the framework of Uniform Stability to analyze generalization. An algorithm is stable if its output is insensitive to the removal or replacement of a single training example. Stability is a strong indicator of generalization: high stability implies a small gap between training and test performance.
The theoretical analysis reveals a critical trade-off:
- Instability in SGDM: For certain convex loss functions, the stability gap of standard SGDM can grow unbounded if momentum is applied indefinitely. The "velocity" gained from momentum makes the final model parameters highly sensitive to the specific optimization path.
- The Role of Convexity: Interestingly, the unbounded stability issue primarily affects general convex and non-convex landscapes. In strongly convex scenarios, standard SGDM maintains stability.
SGD with Early Momentum (SGDEM)
To reconcile the speed of momentum with the stability of vanilla SGD, the authors introduce SGD with Early Momentum (SGDEM). In this approach, the momentum parameter $\mu$ is active for a fixed number of initial steps $t_d$ and then set to zero for the remainder of the training process.
This strategy is based on the insight that momentum is most beneficial during the early stages of training for escaping local minima and navigating ravines. By disabling momentum in the later stages, the algorithm is allowed to "settle" into a more stable region of the loss landscape, effectively bounding the generalization error.
Experimental Results
The proposed SGDEM was evaluated on several benchmarks, including CIFAR-10, ImageNet, and MNIST.
Generalization Performance
On CIFAR-10 using ResNet-20, SGDEM achieved a test error of 0.2892, outperforming both vanilla SGD (0.3596) and standard SGDM (0.3194). This confirms that limiting the duration of momentum can lead to better generalization than using it throughout the entire training process.
ImageNet and the Optimal $t_d$
Experiments on ImageNet with ResNet-18 in a distributed setting further validated the "Early Momentum" hypothesis. The researchers observed that the generalization gap (the difference between validation and training loss) varies significantly with the choice of $t_d$.
As shown in the figure above, while the validation loss remains relatively stable, the generalization gap $|validation - train|$ exhibits a clear minimum when momentum is disabled at epoch 50 (out of 90 total epochs). This empirical evidence supports the theoretical claim that there is an optimal window for momentum application to ensure stability.
Conclusion
This work highlights a potential hidden cost of momentum in deep learning: instability that can harm generalization. By introducing SGD with Early Momentum (SGDEM), the authors provide a simple yet effective strategy to balance optimization speed and model stability. The theoretical bounds and empirical results suggest that "Early Momentum" is a robust approach for training high-performance models that generalize well to unseen data.
Summary updated