Abstract
Bayesian inference provides a robust framework for uncertainty quantification, yet its computational demands often necessitate approximations. Automatic Differentiation Variational Inference (ADVI) has emerged as a popular "black box" solution, but it is frequently hampered by the instabilities of stochastic gradient optimization and the inaccuracies of mean-field approximations. We introduce Deterministic ADVI (DADVI), a method that replaces stochasticity with a fixed Sample Average Approximation (SAA). By transforming the variational objective into a deterministic function, DADVI enables the use of efficient second-order optimizers and Linear Response (LR) covariance corrections. Our results demonstrate that DADVI is faster, more reliable, and provides significantly more accurate posterior uncertainties than standard ADVI across a wide range of high-dimensional models.
Introduction
Quantifying uncertainty is a cornerstone of modern statistical modeling, particularly in fields like development economics, ecology, and political forecasting. While Markov Chain Monte Carlo (MCMC) methods are the gold standard for Bayesian inference, their high computational cost often makes them impractical for large-scale or high-dimensional problems. Automatic Differentiation Variational Inference (ADVI) was developed to provide a faster, automated alternative by approximating complex posterior distributions with simpler families, typically Gaussians.
Despite its popularity, standard ADVI relies on Stochastic Gradient (SG) optimization. This dependency introduces several practical challenges: the need for careful tuning of learning rates, the difficulty of assessing convergence in the presence of noise, and the tendency of mean-field approximations to severely underestimate variance. DADVI addresses these issues by shifting the paradigm from stochastic to deterministic optimization.
The DADVI Algorithm
The core innovation of DADVI is the use of the Sample Average Approximation (SAA). In standard ADVI, new random samples are drawn at every iteration to estimate the gradient of the Evidence Lower Bound (ELBO). In contrast, DADVI draws a single, fixed set of $N$ samples (with a recommended default of $N=30$) at the beginning of the process. This transforms the intractable expectation into a fixed, deterministic objective function.
As shown in the comparison above, this shift allows DADVI to utilize powerful off-the-shelf second-order optimizers, such as Newton-style trust-region methods (trust-ncg). These optimizers converge much faster than stochastic gradients and provide clear, reliable stopping criteria based on the gradient norm. Furthermore, DADVI includes a postprocessing step to assess Monte Carlo (MC) error using a "sandwich covariance" estimator, allowing users to determine if the initial sample size $N$ was sufficient.
Linear Response and Uncertainty Accuracy
A major criticism of standard ADVI is its reliance on the "mean-field" assumption, which ignores correlations between parameters and leads to overconfident (too narrow) uncertainty estimates. DADVI solves this through Linear Response (LR) covariances.
Once the deterministic objective is optimized, DADVI uses the Hessian (curvature) of the objective function to apply a correction to the mean-field variance estimates. This "secret sauce" allows the model to recover correlations and provide "full-rank" quality uncertainty estimates at the speed of a mean-field model. This makes DADVI not just faster, but significantly more accurate in its representation of the posterior distribution.
Theoretical Insights: The Power of Inexpressivity
The authors provide a surprising theoretical justification for why DADVI works so well in high dimensions. Classical SAA theory suggests that the number of samples $N$ should grow linearly with the number of dimensions $D$. However, the authors prove that for common statistical structures (like "global-local" models), $N$ only needs to grow logarithmically with $D$.
Interestingly, this success depends on the "inexpressivity" of the mean-field family. If one attempts to use DADVI with a highly flexible approximation (like a full-rank Gaussian or Normalizing Flows) in high dimensions, the model tends to "overfit" the fixed $N$ samples. The simplicity of the mean-field assumption acts as a necessary regularizer, allowing $N=30$ to effectively solve problems with over 15,000 dimensions.
Empirical Performance
The authors evaluated DADVI against standard ADVI and ground-truth MCMC (NUTS) across several benchmarks, including:
- ARM: 53 models from a classic hierarchical modeling textbook.
- POTUS: A 15,000-dimensional time-series model for US election forecasting.
- Microcredit & Occupancy: High-dimensional models from economics and ecology.
Key results include:
- Speed: DADVI is typically an order of magnitude faster than standard ADVI in terms of model evaluations required to reach a solution.
- Reliability: DADVI consistently found high-quality solutions with default settings across all 53 ARM models, whereas standard ADVI often required manual tuning or failed to signal convergence correctly.
- Accuracy: When paired with LR covariances, DADVI's standard deviation estimates were significantly closer to MCMC results than any version of standard ADVI.
Conclusion
DADVI represents a significant step toward a truly "set it and forget it" black-box variational inference tool. By leveraging deterministic optimization and Linear Response theory, it overcomes the primary hurdles of tuning, convergence, and uncertainty underestimation that have long plagued stochastic VI methods. While it is currently optimized for mean-field families, its speed and accuracy make it a formidable alternative for modern Bayesian data analysis.
Summary updated