Stochastic Learning Under Random Reshuffling With Constant Step-Sizes

Bicheng Ying, Kun Yuan, Stefan Vlaski, Ali H. Sayed

In the field of machine learning, a significant gap exists between theoretical Stochastic Gradient Descent (SGD) and its practical implementation. While textbook SGD assumes data points are sampled uniformly with replacement, practitioners almost exclusively use Random Reshuffling (RR)—shuffling the dataset once per epoch and iterating through it sequentially. This paper provides a rigorous analytical justification for why this heuristic is a mathematical powerhouse, particularly when using constant step-sizes.

The $O(\mu^2)$ Scaling Advantage

The most striking finding of this research is the difference in steady-state error floors. In standard SGD, the Mean-Square Deviation (MSD) scales linearly with the step-size ($O(\mu)$). However, the authors prove that under Random Reshuffling, the MSD scales with the square of the step-size ($O(\mu^2)$).

Regression analysis showing the Mean-Square Deviation (MSD) scales with the square of the step-size ($O(\mu^2)$) for Random Reshuffling.

This means that if a practitioner halves the step-size, the error floor for standard SGD drops by half, while for RR, it drops by a factor of four. This advantage stems from the "zero-sum" property of RR: over a single epoch, every data point is visited exactly once, causing the sum of the gradient noise to cancel out more effectively than the random averaging seen in standard SGD.

Explaining the "Wavy" Learning Curves

Practitioners have long observed that RR learning curves exhibit periodic oscillations or "waves." This paper provides the first precise formula for these dynamics. The authors demonstrate that gradient noise variance is not constant throughout an epoch; rather, it follows a "bell-shaped" function. Noise is at its lowest at the beginning and end of an epoch—where the zero-sum property has the most influence—and peaks in the middle.

Comparison of Standard SGD and SGD with Random Reshuffling (RR) showing the characteristic oscillations and lower error floor of RR.

Methodology and Theoretical Framework

To analyze the complex dependencies introduced by shuffling, the authors utilized several key mathematical tools:

  1. Stability Proofs: Establishing that iterates remain within a bounded neighborhood of the optimal solution.
  2. Long-Term Modeling: Developing an auxiliary model to approximate error dynamics over multiple epochs, allowing for the derivation of closed-form MSD expressions.
  3. Hyperbolic Representation: Using functions like $\tanh$ to simplify complex summations into intuitive performance formulas for quadratic risks.

The theoretical results were verified using regularized logistic regression and quadratic least-squares problems. These simulations (as seen in the figures above) perfectly match the derived theory, confirming the $20$dB to $30$dB per decade drop in error as step-size is reduced.

Conclusion and Implications

While the benefits of RR diminish as the dataset size $N$ approaches infinity, it remains a superior strategy for finite datasets iterated over multiple times. This work solidifies the mathematical foundation for a common industry practice, proving that the "shuffling heuristic" is not just a convenience, but a mathematically superior approach to stochastic optimization in the constant step-size regime.

Summary updated

BibTeX
@article{ying2019stochastic,
  author = {Bicheng Ying and Kun Yuan and Stefan Vlaski and Ali H. Sayed},
  title = {{Stochastic Learning Under Random Reshuffling With Constant Step-Sizes}},
  journal = {IEEE Trans. Signal Process.},
  year = {2019},
  doi = {10.1109/tsp.2018.2878551},
}
Figure