SMG: A Shuffling Gradient-Based Method with Momentum

Trang H. Tran, Lam M. Nguyen, Quoc Tran-Dinh

TL;DR

The Shuffling Momentum Gradient (SMG) algorithm combines the practical efficiency of "sampling without replacement" (shuffling) with the speed of momentum techniques. It achieves state-of-the-art convergence rates for non-convex optimization problems while requiring less restrictive theoretical assumptions than previous shuffling methods.

What Problem Does This Paper Address?

In machine learning, we typically solve "finite-sum" optimization problems—minimizing a loss function averaged over a large but fixed set of training samples. The standard workhorse is Stochastic Gradient Descent (SGD), which samples data with replacement. However, practitioners almost always use shuffling (sampling without replacement) because it is easier to implement and usually converges faster.

Despite its popularity, shuffling is notoriously difficult to analyze theoretically because the samples in an epoch are no longer independent. Furthermore, while momentum is a staple for accelerating deep learning, its integration with shuffling strategies in non-convex settings has lacked rigorous convergence guarantees. The authors set out to bridge this gap: Can we combine shuffling and momentum into a single, provably efficient framework for non-convex problems?

Methods

The authors introduce two primary algorithms:

  1. SMG (Algorithm 1): This is the core contribution. Unlike traditional momentum (which updates the velocity at every single step), SMG uses a unique "epoch-wise" update. The momentum term is fixed at the start of each epoch. During the epoch, the algorithm tracks the average gradient, which is then used to update the momentum for the next epoch. This subtle shift makes the mathematical analysis tractable while maintaining high performance.
  2. Single Shuffling Variant (Algorithm 2): This version uses a more traditional momentum update at every iteration but is analyzed specifically for "single shuffling" (where the data is shuffled only once at the very beginning).

The paper also explores various Learning Rate (LR) schedules, proving that SMG maintains its convergence properties whether using constant, diminishing, exponential, or cosine annealing rates.

Key Insights and Ideas

  • Relaxed Assumptions: Most previous analyses of shuffling methods required a "bounded gradient" assumption (assuming gradients never explode). SMG works under the more standard and realistic "bounded variance" assumption, making the theory much more applicable to real-world deep learning.
  • The Power of Randomized Reshuffling (RR): While SMG works with any shuffling strategy (even deterministic ones), the authors show that Randomized Reshuffling—shuffling the data anew at the start of every epoch—provides a significant theoretical boost. It improves the convergence rate by a factor of $n^{1/3}$ (where $n$ is the number of samples).
  • Momentum Stability: By fixing the momentum term at the start of the epoch, the algorithm avoids the "drift" that can occur when an estimator deviates too far from the true gradient during a sequence of dependent shuffling steps.

Key Results

  • Convergence Rates: SMG achieves a state-of-the-art convergence rate of $O(1/T^{2/3})$ for general shuffling and $O(1/(n^{1/3}T^{2/3}))$ for randomized reshuffling, where $T$ is the number of epochs.
  • Performance vs. Baselines: In neural network training on datasets like Fashion-MNIST and CIFAR-10, SMG quickly catches up to and matches the performance of heavyweights like Adam and SGD with Momentum (SGD-M).
Train loss for Fashion-MNIST and CIFAR-10
  • Superiority in Logistic Regression: For non-convex logistic regression on datasets like w8a and ijcnn1, SMG significantly outperforms both standard SGD and Adam.
Train loss for w8a and ijcnn1 datasets
  • Hyper-parameter Robustness: The algorithm is remarkably robust to the choice of the momentum weight $\beta$. Experiments showed that values in the range of $[0.1, 0.5]$ all performed well, with $0.5$ often being the "sweet spot".

Limitations and Future Work

While the paper provides a strong theoretical foundation, there are a few areas left for exploration:

  • Optimal $\beta$: While the algorithm is robust, the authors acknowledge that finding the optimal momentum weight $\beta$ remains an open question.
  • Adaptive Methods: The current analysis focuses on gradient-based momentum. Extending this framework to adaptive methods like Adam or AdaGrad under shuffling strategies is a logical next step.
  • Complex Settings: The authors suggest that their analysis framework could be extended to more complex scenarios like minimax problems (common in GANs) and federated learning.

Summary updated

BibTeX
@inproceedings{tran2021smg,
  author = {Trang H. Tran and Lam M. Nguyen and Quoc Tran-Dinh},
  title = {{SMG: A Shuffling Gradient-Based Method with Momentum}},
  booktitle = {International Conference on Machine Learning},
  year = {2021},
  url = {https://openreview.net/forum?id=G3b_3RyTubT},
}
Figure