Introduction
Stochastic Gradient Descent (SGD) and Batch Normalization (BN) are fundamental components of modern deep learning optimization. While their individual properties are well-studied, their interaction—specifically how data shuffling protocols affect BN—has remained largely unexplored. Standard practice involves "without-replacement" sampling, typically implemented as either Random Reshuffling (RR), where data is reshuffled every epoch, or Single Shuffle (SS), where a single permutation is fixed throughout training. This paper investigates a surprising friction between SS and BN, demonstrating that the combination can lead to distorted training objectives, slower convergence, and even total training divergence.
Shuffling Strategies and Batch Normalization
In theoretical analysis, SGD is often modeled as "with-replacement" sampling. However, practitioners favor without-replacement shuffling for its superior convergence properties. The two primary variants are:
- Random Reshuffling (RR): A new random permutation $\pi$ is selected at the start of every epoch.
- Single Shuffle (SS): A single random permutation $\pi$ is selected at the beginning of training and reused for all subsequent epochs.
Batch Normalization introduces a unique challenge because it normalizes a data point based on the statistics of other points within its mini-batch. Consequently, the features processed by the network are not fixed; they depend on the specific composition of the mini-batch. This implies that BN is not permutation-invariant. When the shuffle is fixed (as in SS), the network optimizes a "distorted" version of the true loss function, potentially leading to unintended consequences.
The Phenomenon of Distorted Risks
The authors formalize this instability through the framework of "Distorted Risks." They define $L_\pi$ as the risk under a specific fixed permutation $\pi$, and $L_{RR}$ as the average risk over all possible permutations. In SS + BN, the optimization process effectively targets $L_\pi$, which can deviate significantly from the standard Gradient Descent (GD) risk. Conversely, RR acts as a smoothing mechanism, where reshuffling every epoch averages out these distortions, keeping $L_{RR}$ closer to the true GD risk.
Regression and Classification Analysis
The research provides rigorous mathematical proofs for both regression and classification settings:
- Regression: For linear networks with BN, the authors prove that SS and RR converge to distinct global optima. A delicate analysis of gradient evolution reveals that SS is "pulled" away from the true GD optimum toward a distorted minimum.
- Classification: Using a "separability decomposition" to categorize datasets, the authors show that SS can make a dataset appear linearly separable in a way that causes weights to grow infinitely. This leads to training divergence, whereas RR maintains stability by averaging these effects.
Empirical Results
The theoretical findings were validated across several architectures (Linear + BN, 3-layer MLPs, and ResNet18) and benchmarks (CIFAR10, CIFAR100, MNIST).
Training Divergence
In experiments with 2-layer and 3-layer linear networks on CIFAR10, models trained with SS + BN consistently diverged. In contrast, those using RR remained stable. This divergence was found to be magnified by network depth, suggesting that the distortion compounds as it propagates through multiple normalizing layers.
Convergence Delays in Nonlinear Models
Even in scenarios where the model did not completely diverge, such as ResNet18 on CIFAR10/100, SS + BN exhibited significantly slower convergence compared to RR + BN. The fixed permutation creates an "overfitting" effect to specific mini-batch compositions, which misaligns the training trajectory with the true gradient of the full dataset.
Limitations and Future Work
While the paper establishes a strong theoretical and empirical foundation, some areas remain open for further study. The rigorous proofs primarily focus on BN applied to input features or within linear networks. The mathematical analysis of BN in deep, non-linear internal layers where features evolve remains a complex challenge. Additionally, the authors suggest that other mini-batch-dependent techniques, such as Mixup or Sharpness-Aware Minimization (SAM), might exhibit similar instabilities when paired with fixed shuffling.
Conclusion
The interaction between Single Shuffle SGD and Batch Normalization creates a fundamental instability in deep learning training. Because BN's affine transformations are dependent on mini-batch composition, a fixed shuffle forces the network to optimize a distorted objective. For practitioners, the takeaway is clear: Random Reshuffling is not merely a preference but a necessity for maintaining training stability and ensuring optimal convergence when using Batch Normalization.
Summary updated