A Unified Analysis of Stochastic Gradient Descent with Arbitrary Data Permutations and Beyond

Yipeng Li, Xinchen Lyu, Zhenyu Liu

Introduction

Standard Stochastic Gradient Descent (SGD) theory is often built on a convenient fiction: that data points are sampled with replacement. In practice, however, almost all deep learning implementations use permutation-based sampling, where the dataset is shuffled and processed once per epoch. While specific strategies like Random Reshuffling (RR) or Shuffle Once (SO) have been analyzed individually, a significant theoretical gap remained regarding "Dependent Permutations."

Algorithms such as GraB (Gradient Balancing) use information from previous epochs to optimize the data sequence in the current epoch. Because these strategies break the assumption of independent randomness between epochs, existing unified frameworks could not account for their convergence. This paper introduces a novel mathematical umbrella that covers everything from arbitrary shuffling to sophisticated, history-dependent herding algorithms, extending these insights from centralized SGD to Federated Learning (FL).

The Unified Framework: Order Error and Dependency

The core innovation of this research is a mathematical framework centered on two components that allow for a single, robust convergence analysis across diverse sampling strategies.

1. The Order Error ($\bar{\phi}_q$)

The researchers define a metric called the "Order Error," which quantifies the quality of a specific data permutation. It measures the extent to which the sum of local gradients along a chosen sequence deviates from the true global gradient. This metric provides a tangible way to compare different shuffling strategies; a lower order error generally correlates with faster convergence.

2. The Unified Assumption

Unlike previous theories that treated each epoch's error in isolation, the authors propose a "Unified Assumption." This models the error of the current epoch as a function of the errors and gradients observed in previous epochs. By proving that various algorithms—including arbitrary, independent, one-time, and dependent permutations—all satisfy this general assumption, the authors derive a "Main Theorem" that provides convergence bounds for all of them simultaneously.

From Centralized SGD to Federated Learning

The paper successfully bridges the gap between single-machine SGD and Federated Learning. In FL, the "order error" must be redefined to account for parallel client updates. The authors successfully adapted their logic to handle "rounds" within an "epoch," leading to the creation of FL-GraB, a new client-ordering algorithm designed specifically for federated environments. FL-GraB uses the history of client updates to balance the global gradient, effectively "suppressing" the error vector more efficiently than random client participation.

Empirical Validation

The researchers validated their theoretical findings using synthetic one-dimensional quadratic functions and standard image classification benchmarks, including CIFAR-10, CIFAR-100, and CINIC-10, using CNN and ResNet-10 architectures.

Key findings from these experiments include:

  • Theoretical Robustness: The unified bound for Random Reshuffling matches the best-known prior results ($O(1/Q + 1/(NQ)^{2/3})$), confirming the framework's accuracy.
  • GraB Superiority: GraB-style algorithms achieve the same convergence rate as Random Reshuffling but with significantly better constants, leading to faster practical training.
  • FL-GraB Performance: In federated settings, FL-GraB consistently demonstrated the fastest convergence, particularly in the early stages of training.
  • Metric Validation: The experiments confirmed a strong correlation between the theoretical "order error" and the actual distance to the optimum, validating the metric as a useful tool for practitioners.

Discussion and Limitations

The analysis reveals that dependency is a feature, not a bug. By explicitly modeling inter-epoch dependencies, the paper proves that "herding" (carefully balancing gradients) leads to superior convergence. Furthermore, the research highlights the potential of "Nice Permutations"—meticulously designed initial data orders that can outperform Random Reshuffling, provided the model parameters remain relatively stable (as seen in fine-tuning scenarios).

However, some limitations remain. The tighter bounds for certain strategies rely on the assumption that model parameters do not change too drastically between epochs. Additionally, the Federated Learning analysis currently uses standard Gradient Descent as the local solver; analyzing permutation-based SGD within the local updates of an FL system remains a complex challenge for future work.

Conclusion

By providing a unified analysis for arbitrary data permutations, this paper moves SGD theory closer to the realities of modern machine learning practice. The introduction of the Order Error and the Unified Assumption provides a powerful toolkit for analyzing existing algorithms and designing new, more efficient data-ordering strategies for both centralized and decentralized optimization.

Summary updated

BibTeX
@inproceedings{li2025unified,
  author = {Yipeng Li and Xinchen Lyu and Zhenyu Liu},
  title = {{A Unified Analysis of Stochastic Gradient Descent with Arbitrary Data Permutations and Beyond}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=mmAVwmJgCP},
}
Figure