TL;DR
This paper reveals a surprising instability when using single-shuffle (SS) Stochastic Gradient Descent (SGD) with Batch Normalization (BN), leading to training divergence and distorted optima. In contrast, random reshuffle (RR) SGD with BN remains stable and avoids these issues, offering a more reliable training dynamic.
What Problem Does This Paper Address?
In deep learning, Stochastic Gradient Descent (SGD) is the workhorse optimizer. However, practitioners often use variants like single-shuffle (SS) and random-reshuffle (RR) for efficiency. Batch Normalization (BN) is another ubiquitous technique for stabilizing and accelerating training. While both are widely used, their interaction, particularly how different shuffling strategies affect training dynamics in the presence of BN, has not been fully understood. This paper investigates this interaction, uncovering that SS combined with BN can lead to undesirable training behaviors like divergence and convergence to suboptimal solutions, while RR remains stable.
Methods
The authors employ a theoretical and experimental approach. They analyze the "distorted risk" induced by the interaction of shuffling and BN, showing how SS and RR lead to different optimization landscapes. They provide theoretical guarantees for convergence to these distorted optima for SS and RR in regression settings. For classification, they characterize conditions under which divergence occurs for SS+BN but is avoided by RR+BN. Explicit constructions and empirical validation on synthetic and real-world datasets are used to support their theoretical findings.
Datasets
The paper uses synthetic datasets for regression and classification to illustrate theoretical concepts. For empirical validation, they mention using:
- CIFAR10
- CIFAR100
- MNIST
- ResNet18 (finetuned)
Key Insights and Ideas
- Shuffling Matters with BN: The choice of shuffling strategy (SS vs. RR) has a surprisingly significant impact on training stability when BN is present.
- BN's Permutation Sensitivity: BN is not permutation-invariant across epochs. This property, when combined with SS, can lead to training dynamics that deviate from standard gradient descent.
- Distorted Risks: SS and RR with BN implicitly optimize "distorted" risk functions, which can lead to different optima than standard gradient descent. RR tends to average out these distortions, aligning better with GD.
- Divergence in Classification: SS+BN can lead to training divergence in classification tasks under specific conditions, a phenomenon that RR+BN provably avoids.
- Practical Implications: The theoretical findings have direct practical implications, suggesting that RR is a safer choice than SS when using BN.
Key Results
- Regression: SS+BN converges to distorted optima, while RR+BN converges to optima that are closer to the standard gradient descent optimum.
- Classification: Theoretical conditions are identified where SS+BN can diverge, while RR+BN provably avoids divergence.
- Empirical Validation: Experiments on linear and nonlinear networks (MLPs, ResNet18) across datasets like CIFAR10, CIFAR100, and MNIST show that SS+BN often converges slower and can exhibit divergence, while RR+BN is more stable and often faster.
Limitations and Future Work
- Generalization: The paper primarily focuses on training risk and does not deeply investigate generalization performance, although they note preliminary experiments suggest similar separations.
- Deeper Networks: While they extend their analysis to deeper networks, the theoretical framework is most rigorously established for linear+BN networks.
- Future Directions: The authors suggest exploring implicit bias of shuffling SGD and BN with dynamically evolving layers, combining their techniques with others (e.g., Cao et al., 2023), and investigating other design choices like mixup and SAM. They also propose establishing directional convergence for homogeneous classifiers trained with shuffling SGD and theoretically understanding conditions under which deeper networks diverge faster.
Summary updated