Provable Gradient Variance Guarantees for Black-Box Variational Inference

Justin Domke

Abstract

Recent variational inference methods use stochastic gradient estimators whose variance is not well understood. Theoretical guarantees for these estimators are important to understand when these methods will or will not work. This paper gives bounds for the common "reparameterization" estimators when the target is smooth and the variational family is a location-scale distribution. These bounds are unimprovable and thus provide the best possible guarantees under the stated assumptions.

Introduction

Black-Box Variational Inference (BBVI) has become a cornerstone of modern Bayesian machine learning, enabling the approximation of complex posterior distributions without requiring analytical derivations. By relying on stochastic gradient descent, BBVI allows practitioners to optimize the Evidence Lower Bound (ELBO) using only evaluations of the target function and its gradients. However, the performance of BBVI is heavily dependent on the variance of these stochastic gradient estimates. High variance leads to instability and slow convergence. This research provides a rigorous theoretical foundation by deriving the first "unimprovable" (tight) bounds on the variance of reparameterization gradient estimators.

Theoretical Framework

The study focuses on the reparameterization (RP) estimator within the context of location-scale variational families (e.g., Gaussian or Student’s t). These families are represented by an affine mapping $T_w(u) = Cu + m$. The core of the theoretical contribution lies in assuming the target log-posterior is $M$-smooth. To improve the utility of these bounds, the author introduces a "matrix smoothness" approach, using a matrix $M$ to capture directional sensitivities in the target function, which often varies more rapidly in some dimensions than others. This analysis is further extended to account for data subsampling, a common practice in large-scale machine learning.

Empirical Validation

The theoretical bounds were tested across eight standard datasets, including both regression (Boston, Fires, Cpusmall) and classification (a1a, Ionosphere, Australian, Sonar, Mushrooms) tasks. The experiments demonstrate that the matrix-based bounds are remarkably tight, tracking the actual observed gradient variance closely across diverse dimensions and sample sizes.

ELBO and gradient variance (||g||²) across eight datasets. The matrix bound (dotted) closely tracks the true variance (solid), while the scalar bound (dashed) is more pessimistic.

Key Insights

  • Tightness: The derived bounds are proven to be "unimprovable," meaning they represent the worst-case noise level under the given assumptions.
  • Matrix vs. Scalar Smoothness: Scalar smoothness constants often lead to overly pessimistic bounds. Incorporating directional information via matrix smoothness significantly improves the predictive power of the theory.
  • Variance Dynamics: Gradient variance is shown to be a quadratic function of the distance from the stationary point and the scale of the variational distribution.

Practical Implications: Variance Reduction

Beyond theoretical understanding, these bounds offer a path toward more efficient optimization. By leveraging the derived variance guarantees, one can design non-uniform data sampling strategies. These "optimal" strategies prioritize data points that contribute most to the gradient noise, leading to substantial variance reduction.

Comparison of gradient variance for different estimators. Optimizing the sampling distribution based on the derived bounds significantly reduces variance compared to uniform sampling.

Results show that numerically optimizing the sampling distribution can reduce gradient variance by 1.5x to 10x compared to standard uniform sampling, directly improving the stability and speed of BBVI.

Conclusion

This work provides the first rigorous guarantees for the variance of reparameterization gradients in BBVI. By establishing tight bounds for location-scale families under smoothness assumptions, it explains the empirical success of these methods and provides tools for further optimization. Future work may extend these results to non-location-scale families and address the challenges of estimating smoothness constants in fully black-box settings.

Summary updated

BibTeX
@inproceedings{domke2019provable,
  author = {Justin Domke},
  title = {{Provable Gradient Variance Guarantees for Black-Box Variational Inference}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2019},
}
Figure