Parallelizing Stochastic Approximation Through Mini-Batching and Tail-Averaging

Prateek Jain, Sham M. Kakade, Rahul Kidambi, Praneeth Netrapalli, Aaron SidfordarXiv 2016

Abstract

This work characterizes the benefits of averaging schemes widely used in conjunction with stochastic gradient descent (SGD). In particular, this work provides a sharp analysis of: (1) mini-batching, a method of averaging many samples of a stochastic gradient to both reduce the variance of the stochastic gradient estimate and for parallelizing SGD and (2) tail-averaging, a method involving averaging the final few iterates of SGD to decrease the variance in SGD's final iterate. This work presents non-asymptotic excess risk bounds for these schemes for the stochastic approximation problem of least squares regression. Furthermore, this work establishes a precise problem-dependent extent to which mini-batch SGD yields provable near-linear parallelization speedups over SGD with batch size one. This allows for understanding learning rate versus batch size tradeoffs for the final iterate of an SGD method. These results are then utilized in providing a highly parallelizable SGD method that obtains the minimax risk with nearly the same number of serial updates as batch gradient descent, improving significantly over existing SGD methods. A non-asymptotic analysis of communication efficient parallelization schemes such as model-averaging/parameter mixing methods is then provided. Finally, this work sheds light on some fundamental differences in SGD's behavior when dealing with agnostic noise in the (non-realizable) least squares regression problem. In particular, the work shows that the stepsizes that ensure minimax risk for the agnostic case must be a function of the noise properties. This paper builds on the operator view of analyzing SGD methods, introduced by Defossez and Bach (2015), followed by developing a novel analysis in bounding these operators to characterize the excess risk. These techniques are of broader interest in analyzing computational aspects of stochastic approximation.

Introduction

Stochastic Gradient Descent (SGD) is the fundamental optimization algorithm for modern machine learning due to its computational efficiency and suitability for streaming data. However, vanilla SGD is inherently serial, as each update depends on the previous iterate. To leverage modern parallel hardware like GPUs and multi-core CPUs, researchers typically employ mini-batching (averaging gradients over multiple samples) or model averaging.

The central challenge in parallelizing SGD is the potential loss of "statistical efficiency." Increasing the batch size to gain parallelism often requires more total data to reach the same accuracy. Furthermore, most theoretical frameworks assume well-specified models with uniform noise. In reality, data is often misspecified (heteroscedastic), where noise levels depend on input features. This paper identifies the precise "speed limit" for parallelization in these complex, real-world scenarios.

Methodology: The Operator View

The authors focus on the Stochastic Least Squares Regression (LSR) problem. Their analysis utilizes a sophisticated "operator view" of SGD, which tracks the evolution of the error covariance over time. This allows for a fine-grained bias-variance decomposition, separating the error caused by the initial starting point from the error introduced by data noise.

Key algorithmic components analyzed include:

  • Mini-batching: Processing $b$ samples simultaneously to compute a single gradient update.
  • Tail-averaging: Averaging only the final fraction of iterates to achieve geometric decay of initial error while maintaining optimal final variance.
  • Algorithm 2 (Minibatch-Doubling): A novel epoch-based scheme where the mini-batch size is doubled every epoch. This allows the algorithm to start with small, frequent updates to reduce bias quickly and transition to large, parallel updates to suppress variance.

To validate these theoretical bounds, the paper utilizes synthetic datasets with 50-dimensional Gaussian covariates, varying condition numbers ($\kappa$), and heteroscedastic noise instances to test robustness against model misspecification.

Key Insights and Theoretical Results

The Mini-batching Threshold ($b_{thresh}$)

The authors prove the existence of a specific batch size threshold beyond which linear speedups cease. This threshold is determined by the geometry of the data (the Hessian) and the degree of model misspecification. In misspecified (agnostic) models, the maximum "safe" learning rate can be significantly lower—sometimes by a factor of the dimension $d$—compared to well-specified models.

Comparative Efficiency

Algorithm 2 (Minibatch-Doubling) represents a significant advancement in streaming optimization. It achieves the minimax optimal risk with a serial depth of roughly $O(\kappa \log \kappa)$, matching the serial update efficiency of offline batch gradient descent while remaining a streaming method.

Comparison of Algorithm 2 with existing optimization methods across error, work, depth, and agnostic properties.

As shown in the table above, Algorithm 2 is uniquely positioned as both a streaming and agnostic method that significantly reduces the required Depth (serial updates) compared to standard Averaged SGD, which requires $O(n)$ depth. This theoretical framework precisely predicts the range of batch sizes where doubling hardware results in halving wall-clock time without increasing total data requirements.

Conclusion and Future Directions

This work provides a sharp characterization of the trade-offs between batch size, learning rate, and statistical efficiency. While the analysis is currently limited to Least Squares Regression, the "operator-based" techniques developed here offer a path forward for analyzing more complex objectives like Logistic Regression or Streaming PCA. Future work will explore extending these insights to asynchronous optimization settings and automated learning rate discovery in black-box environments.

Summary updated

BibTeX
@misc{jain2016parallelizing,
  author = {Prateek Jain and Sham M. Kakade and Rahul Kidambi and Praneeth Netrapalli and Aaron Sidford},
  title = {{Parallelizing Stochastic Approximation Through Mini-Batching and Tail-Averaging}},
  year = {2016},
  eprint = {1610.03774},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1610.03774},
}
Figure