In standard machine learning theory, we often analyze Stochastic Gradient Descent (SGD) under the assumption of "with-replacement" sampling. We imagine the algorithm picking a data point at random, updating the model, and then putting that point back into the pool. In practice, almost no one does this. Instead, engineers use "without-replacement" sampling: they shuffle the dataset and process it in a fixed order.
Recent research has revealed a surprising theoretical truth that matches this practical intuition: not only is shuffling better than random sampling, but shuffling the data exactly once at the start of training is often sufficient to achieve optimal convergence.
The Intuition of Without-Replacement Sampling
The core advantage of shuffling over i.i.d. (independent and identically distributed) sampling is "data coverage." When sampling with replacement, there is a high probability that some data points will be picked multiple times while others are completely ignored within a single epoch. This introduces unnecessary noise.
By sampling without replacement—a method known as Random Reshuffling (RR)—the algorithm guarantees that it sees every single data point exactly once per epoch. This structural constraint acts as a natural variance reduction mechanism. As Kwangjun Ahn and Chulhee Yun demonstrate in SGD with shuffling: optimal rates without component convexity and large epoch requirements, this approach allows the optimizer to converge faster than standard SGD, particularly as the model approaches the optimum.
Why Shuffling Once is Enough
While Random Reshuffling requires a new permutation every epoch, Single Shuffle (SS)—also called Incremental Gradient—takes this a step further. In SS, the dataset is permuted once at the very beginning of training, and that same order is reused for every subsequent epoch.
From a systems perspective, this is a massive win. It eliminates the computational overhead of repeated shuffling and allows for better cache locality and data prefetching. Theoretically, however, it was long feared that reusing the same order would introduce harmful correlations that stall progress.
Recent work has debunked this fear. Ohad Shamir showed in Without-Replacement Sampling for Stochastic Gradient Methods that for variance-reduced methods in least-squares problems, a single initial shuffle is enough to maintain linear convergence. This suggests that the primary benefit of shuffling comes from the initial randomization of the "path" through the data, rather than the continuous re-randomization between epochs.
Closing the Gap in Non-Convex Optimization
The most significant recent breakthroughs involve non-convex functions—the landscape of modern deep learning. For years, theoretical bounds for Single Shuffle were pessimistic, suggesting it was much slower than reshuffling every epoch.
Anastasia Koloskova, Nikita Doikov, Martin Jaggi, and Sebastian U. Stich resolved this in On Convergence of Incremental Gradient for Non-Convex Smooth Functions. They introduced the concept of effective correlation time, a technique that accounts for how dependencies between iterations decay. Their analysis improved the theoretical convergence rate for Single Shuffle by a factor of $n$ (the dataset size), finally aligning theory with the empirical reality that Single Shuffle is nearly identical in performance to per-epoch reshuffling.
Beyond Simple Gradients: Momentum and Hierarchies
The efficiency of single-shuffling extends to more complex optimizers. Trang H. Tran, Lam M. Nguyen, and Quoc Tran-Dinh developed Shuffling Momentum Gradient (SMG), proving in SMG: A Shuffling Gradient-Based Method with Momentum that you can combine the benefits of momentum with a fixed shuffle order without losing convergence guarantees.
In fact, under certain well-conditioned regimes, Single Shuffle might actually be the superior choice. Chulhee Yun, Suvrit Sra, and Ali Jadbabaie argue in Can Single-Shuffle SGD be Better than Reshuffling SGD and GD? that a hierarchy exists:
- Single Shuffle (Best: Fixed path avoids re-introduction of noise)
- Random Reshuffling (Better: Guaranteed coverage)
- Standard GD (Good: Deterministic but slow)
This research direction confirms that the "lazy" approach to data loading—shuffling once and streaming—is not just a practical shortcut, but a theoretically sound strategy for efficient stochastic optimization.