Accelerating Stratified Sampling SGD by Reconstructing Strata

Weijie Liu, Hui Qian, Chao Zhang, Zebang Shen, Jiahao Xie, Nenggan Zheng

Introduction

Stochastic Gradient Descent (SGD) is the cornerstone of modern machine learning optimization. However, its reliance on small random mini-batches introduces significant "noise" or variance in gradient estimates, which can lead to slow convergence and instability. To mitigate this, researchers typically employ variance reduction techniques like importance sampling or stratified sampling.

Importance sampling prioritizes "important" data points but is computationally expensive as importance weights must be updated frequently. Stratified sampling (e.g., SGD-ss) divides data into fixed groups (strata) based on initial features. However, as a model evolves during training, these static partitions often fail to capture the shifting distribution of gradients, limiting their effectiveness.

The SGD-RS Method

Presented at IJCAI-20, SGD-RS (Accelerated Stratified Sampling SGD by Reconstructing Strata) addresses these limitations by adaptively re-grouping data during training. The approach relies on three core innovations:

  1. Dynamic Surrogate Bound: The authors derived a tighter mathematical upper bound for stochastic variance that serves as a proxy for the actual variance, which is otherwise too costly to compute directly.
  2. Stochastic Stratifying: An efficient, k-means-style algorithm partitions data into strata that minimize the proposed surrogate bound.
  3. Adaptive Reconstruction: To minimize overhead, SGD-RS uses a "trigger" condition. Strata are only reconstructed when the gradients within existing groups become sufficiently non-homogeneous, ensuring computational resources are used only when necessary.
Comparison of gradient estimation strategies. SGD-RS (bottom right) yields an estimate (cyan x) closest to the true full-batch gradient (black +) compared to uniform, importance, and static stratified sampling (SGD-ss).

Experimental Evaluation

The authors evaluated SGD-RS across various benchmarks, including:

  • Convex Optimization: Logistic regression on rcv1, ijcnn1, and w8a datasets.
  • Non-Convex Optimization: Deep learning tasks including MNIST (MLP), CIFAR-10 (VGG-11), and CIFAR-100 (ResNet-18).

Key Results

  • Efficiency: SGD-RS achieved at least a 3.48x speedup over standard mini-batch SGD and outperformed previous stratified methods by up to 4x.
  • Variance Reduction: Gradient variance was reduced to as little as 8.2% of the levels seen in static stratified sampling (SGD-ss).
  • Minimal Overhead: Due to the adaptive trigger, reconstruction occurred in only 0.61% of training iterations on average.
  • Stability: The method maintained higher stability compared to importance sampling, which can suffer from extreme weighting.

Discussion and Insights

The success of SGD-RS highlights that gradients are dynamic; static clustering based on input features is insufficient for long-term variance reduction. By sporadically updating partitions only when homogeneity fails, the algorithm maintains high-quality estimates without the heavy cost of constant re-calculation.

The authors proved that SGD-RS offers a tighter variance bound and faster convergence rates for both convex and non-convex problems compared to existing state-of-the-art stratified sampling methods.

Conclusion

SGD-RS provides a robust and efficient framework for accelerating SGD through adaptive data partitioning. While highly effective as a standalone sampling strategy, it is also complementary to other variance reduction techniques like SVRG. Future work may involve automating the reconstruction threshold and scaling the method for large-scale distributed systems where data movement costs are a primary concern.

Summary updated

BibTeX
@inproceedings{liu2020accelerating,
  author = {Weijie Liu and Hui Qian and Chao Zhang and Zebang Shen and Jiahao Xie and Nenggan Zheng},
  title = {{Accelerating Stratified Sampling SGD by Reconstructing Strata}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2020},
  doi = {10.24963/ijcai.2020/378},
}
Figure