NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Tuning Stochastic Gradient Algorithms for Statistical Inference via Large-Sample Asymptotics

Jeffrey Negrea, Jun Yang, Haoyue Feng, Daniel M. Roy, Jonathan H. Huggins

TL;DR

This paper bridges the long-standing gap between the theoretical analysis and practical implementation of stochastic gradient algorithms (SGAs). By analyzing SGAs through the lens of large-sample asymptotics, the authors provide a rigorous framework for tuning parameters like step size and batch size, demonstrating that iterate averaging with a fixed step size can achieve optimal statistical performance even under model misspecification.

What Problem Does This Paper Address?

Stochastic gradient algorithms, such as Stochastic Gradient Descent (SGD) for optimization and Stochastic Gradient Langevin Dynamics (SGLD) for sampling, are the workhorses of modern machine learning. However, there is a disconnect between theory and practice:

  • Theory often suggests using decreasing step sizes to ensure convergence, which can lead to painfully slow mixing in practice.
  • Practitioners typically use large, fixed step sizes and small batch sizes because they are faster and more robust, but this behavior lacks a generalizable theoretical foundation.

Furthermore, existing theories often rely on restrictive assumptions like log-concavity (convexity of the loss function), which rarely hold in complex models. This paper aims to explain why these practical tunings work and how to choose them systematically to achieve specific statistical goals, such as matching the properties of a Bayesian posterior or a Maximum Likelihood Estimator (MLE).

Methods

The authors develop a stochastic gradient meta-algorithm that encompasses both optimization (SGD) and sampling (SGLD) variants. Their key innovation is analyzing the joint scaling limit—how the algorithm behaves as the sample size ($n$) goes to infinity while the step size ($h$) and batch size ($b$) are adjusted accordingly.

Key technical components include:

  • Functional Central Limit Theorem: They prove that the sample paths of these algorithms converge to an Ornstein–Uhlenbeck (OU) process. This allows them to characterize the algorithm's behavior using a continuous-time diffusion model.
  • Bernstein–von Mises (BvM) Theorems: They derive BvM-like results for both the marginal iterates (useful for sampling) and iterate averages (useful for optimization). This links the algorithm's stationary distribution directly to classical statistical targets like the MLE sampling distribution.
  • Preconditioning and Anisotropy: The framework accounts for preconditioning matrices ($\Gamma$) and diffusion anisotropy ($\Lambda$), showing how these choices affect mixing times and asymptotic covariance.

Datasets

The authors validate their theory using three distinct experimental setups:

  1. Gaussian Simulation Study: A controlled 10-dimensional Gaussian location model specifically designed to be misspecified, allowing for a clear look at how tuning affects the resulting distribution.
  2. Airline Delay Data (Logistic Regression): A real-world dataset with 1 million observations used to compare their recommended settings against previous suboptimal benchmarks in the literature.
  3. Airline Delay Data (Poisson Regression): A more complex, misspecified model with 25 parameters and 150,000 observations, used to test the robustness of their tuning recommendations in challenging, non-ideal scenarios.

Key Insights and Ideas

  • Fixed Step Sizes are Feature, Not a Bug: The paper shows that using a fixed step size leads to constant mixing times (the time it takes to get an independent sample), whereas decreasing step sizes cause mixing times to grow indefinitely.
  • Iterate Averaging is Robust: A major "aha" moment is that iterate averaging with a large fixed step size is remarkably robust to tuning. It can produce an estimator whose covariance is proportional to the MLE's sampling distribution, effectively providing "automatic" uncertainty quantification.
  • Noise as a Tool for Robustness: The authors show that stochastic gradient noise can be leveraged to sample from "Bagged Posteriors" or "Local Fiducial" distributions. These are modifications of the standard posterior that are more robust to model misspecification—a benefit that was previously viewed as a trade-off for computational efficiency.
  • Tuning Recipes: The paper provides a "cheat sheet" (Table 1) that maps specific statistical targets (e.g., the true posterior vs. a robust frequentist sandwich covariance) to specific choices of step size, batch size, and preconditioning.

Key Results

  • Predictive Accuracy: The theoretical formulas for mixing times (Equation 10) and asymptotic covariance (Equation 13) closely match empirical results across all experiments.
  • Efficiency Gains: In the airline dataset experiments, the authors show that a properly tuned (preconditioned) SGA can mix significantly faster than the standard versions used in prior studies, sometimes reducing the required number of epochs by orders of magnitude.
  • Correction of Prior Heuristics: The rigorous analysis identifies errors in previous heuristic-based claims. For example, they show that iterate averaging requires more than a single pass over the data to accurately reflect the posterior—contrary to some earlier conjectures.

Limitations and Future Work

  • Asymptotic Nature: The results are based on large-sample limits ($n \to \infty$). While the experiments show these hold well for $n=150,000$, the theory doesn't yet quantify exactly how large $n$ needs to be for the approximations to be reliable in every case.
  • Fixed Parameter Dimension: The current work assumes the number of parameters ($d$) is fixed. Future work could extend this to high-dimensional regimes where $d$ grows with $n$.
  • Non-parametric Models: The authors suggest that extending this analysis to hierarchical and non-parametric models is a promising next step to better understand when these methods are most effective.

Summary updated

BibTeX
@inproceedings{negrea2023tuning,
  author = {Jeffrey Negrea and Jun Yang and Haoyue Feng and Daniel M. Roy and Jonathan H. Huggins},
  title = {{Tuning Stochastic Gradient Algorithms for Statistical Inference via Large-Sample Asymptotics}},
  booktitle = {Research},
  year = {2023},
}
Figure