Introduction
In the realm of machine learning optimization, the order in which data is presented to a model during training is often treated as a secondary detail, usually handled by simple random shuffling. However, recent research suggests that the sequence of data points—the "data ordering"—plays a critical role in the convergence speed and final performance of stochastic gradient methods. This paper challenges the conventional wisdom that "random shuffling is enough" by providing a formal characterization of what makes a data ordering "good" and proposing a practical algorithm to find such sequences.
The Problem of Data Ordering
Most modern machine learning models are trained using variants of Stochastic Gradient Descent (SGD). While pure SGD samples data points with replacement, practitioners almost universally prefer Random Reshuffling (RR), where the entire dataset is shuffled once per epoch and processed without replacement. Theoretically, RR is known to converge faster than SGD because it ensures every data point is seen exactly once per cycle, reducing variance.
However, there exists a deterministic counterpart called Incremental Gradient (IG) descent, where the data order is fixed across all epochs. While IG is often viewed as a "worst-case" scenario in theoretical analyses, empirical evidence shows that certain fixed orders can actually outperform random ones. The research community lacked two things: a mathematical metric to distinguish these "good" orders from "bad" ones, and a scalable method to identify them during the training process.
The Epoch-Based Framework
To address these gaps, the authors introduce a generalized framework called Epoch-Based Gradient Descent. This framework encapsulates various common optimization strategies by varying how the update sequence is determined at the start of each epoch.
As shown in the figure above, the framework iterates through $T$ epochs. In each epoch $t$, an update sequence $r_t$ is determined. This sequence can represent standard methods:
- Random Reshuffling: $n=N$ and the sequence is a random permutation of the dataset.
- Incremental GD: $n=N$ and the sequence is fixed (e.g., $1, 2, \dots, N$).
- SGD: $n=1$ and a single index is picked randomly.
Characterizing "Good" Orderings: The $\sigma_*$ Metric
The core theoretical contribution of this work is the definition of Bounded Sequence Heterogeneity, denoted by the metric $\sigma_*$. This metric quantifies how much the cumulative gradient of a partial sequence of data deviates from the true gradient of the entire dataset.
Mathematically, a sequence is considered "balanced" if its partial sums of gradients stay close to the average gradient. A lower $\sigma_*$ value indicates a more balanced sequence. The authors provide a unified convergence proof for non-convex functions that directly incorporates this metric. This single formula is powerful because it recovers known convergence rates for both RR and IG, proving that the quality of the sequence (as measured by $\sigma_*$) is the primary driver of convergence speed.
Finding Optimal Orderings: The Greedy Algorithm
Building on the $\sigma_*$ metric, the authors propose a Greedy Order Chooser. The intuition is simple: if the gradients from the first few data points in an epoch push the model's weights in a certain direction (introducing a "bias"), the next data point should be chosen to push the weights back toward the global optimum.
This "error compensation" strategy greedily selects the next batch that best cancels out the accumulated bias. While calculating the exact gradient for every data point at the start of every epoch is computationally expensive, the authors suggest a "Slow Update" heuristic. By updating the sequence order only once every 10 epochs, they significantly reduce overhead while still maintaining superior performance over random shuffling.
Experimental Results and Insights
The researchers tested their theories on the CIFAR-10 dataset using a ResNet-18 architecture. To isolate the effects of data ordering, they removed Batch Normalization, which can introduce its own batch-dependent dynamics.
One of the most striking results came from a "same-class batching" experiment. By forcing each mini-batch to contain only one class of images (e.g., only "dogs" or only "planes"), the variance between batches was artificially increased. In this high-variance scenario:
- Random Reshuffling achieved 73.46% accuracy.
- The Greedy Algorithm achieved 88.43% accuracy.
This 14.97% improvement demonstrates that when data is heterogeneous, the choice of sequence order becomes a critical factor in model performance. Furthermore, the paper explores Two-Level Shuffling for hierarchical data, such as in Federated Learning. They show that shuffling first at the group level and then within groups can optimize communication costs without sacrificing the convergence benefits of shuffling.
Conclusion and Future Directions
This research moves the conversation beyond simple randomization. By providing the $\sigma_*$ metric, the authors give researchers a tool to analyze and design better training sequences. While the current Greedy Order Chooser is a proof-of-concept with some computational overhead, it paves the way for more efficient heuristics. Future work will likely focus on integrating these ordering strategies with modern techniques like Batch Normalization and finding ways to approximate optimal sequences without full gradient passes, making "smart ordering" a standard part of the deep learning toolkit.
Summary updated