Variational Inference for Uncertainty Quantification: an Analysis of Trade-offs

Charles C. Margossian, Loucas Pillaud‐Vivien, Lawrence K. Saul · DOI

Abstract

Given an intractable distribution $p$, the problem of variational inference (VI) is to find the best approximation from some more tractable family $Q$. Commonly, one chooses $Q$ to be a family of factorized distributions (i.e., the mean-field assumption), even though $p$ itself does not factorize. We show that this mismatch can lead to an impossibility theorem: if $p$ does not factorize and furthermore has a non-diagonal covariance matrix, then any factorized approximation $q \in Q$ can correctly estimate at most one of the following three measures of uncertainty: (i) the marginal variances, (ii) the marginal precisions, or (iii) the generalized variance (which for elliptical distributions is closely related to the entropy). In practice, the best variational approximation in $Q$ is found by minimizing some divergence $D(q,p)$ between distributions, and so we ask: how does the choice of divergence determine which measure of uncertainty, if any, is correctly estimated by VI? We consider the classic Kullback-Leibler divergences, the more general $\alpha$-divergences, and a score-based divergence which compares $\nabla \log p$ and $\nabla \log q$. We thoroughly analyze the case where $p$ is a Gaussian and $q$ is a (factorized) Gaussian. In this setting, we show that all the considered divergences can be ordered based on the estimates of uncertainty they yield as objective functions for VI. Finally, we empirically evaluate the validity of this ordering when the target distribution $p$ is not Gaussian.

Introduction

Variational Inference (VI) is a cornerstone of modern Bayesian computation, enabling the approximation of complex posterior distributions $p$ with a tractable family $Q$. A ubiquitous choice is the "mean-field" assumption, where $Q$ consists of factorized distributions. While computationally efficient, this assumption introduces a structural mismatch when the target distribution $p$ contains correlations. This paper investigates the fundamental trade-offs in uncertainty quantification (UQ) that arise from this mismatch, proving that no factorized approximation can simultaneously capture all aspects of a correlated target's uncertainty.

Methodology: Divergences and Notation

The core of the analysis focuses on Factorized Gaussian Variational Inference (FG-VI). In this setting, a correlated multivariate Gaussian target $p$ is approximated by a diagonal Gaussian $q$. The choice of the "best" approximation is determined by the specific divergence $D(q,p)$ minimized during optimization.

Table 1: Definitions of the divergences analyzed in this work, including Kullback-Leibler, $\alpha$-family, and score-based divergences.

The study evaluates several divergence families, as defined in Table 1:

  1. Kullback-Leibler (KL) Divergences: Both the "Reverse" KL ($KL(q||p)$), which is standard in VI software, and the "Forward" KL ($KL(p||q)$).
  2. $\alpha$-divergences: A parametric family $D_\alpha(p||q)$ that interpolates between the two KL directions.
  3. Score-based Divergences: Methods such as $S(q||p)$ and $S(p||q)$ that compare the gradients (scores) of the log-densities rather than the densities themselves.
Table 2: Notation and definitions used for the theoretical analysis of uncertainty trade-offs.

The mathematical notation used throughout the analysis is summarized in Table 2, including the dominance relation $D_a \succ D_b$, which indicates that divergence $D_a$ yields larger variance estimates than $D_b$.

The Impossibility Theorem

A central contribution of this work is an "impossibility theorem" for factorized approximations. If the target distribution $p$ is non-factorized (i.e., has a non-diagonal covariance matrix $\mathbf{\Sigma}$), any factorized approximation $q \in Q$ can correctly estimate at most one of three key uncertainty measures:

  1. Marginal variances: The diagonal elements of $\mathbf{\Sigma}$.
  2. Marginal precisions: The diagonal elements of the precision matrix $\mathbf{\Sigma}^{-1}$.
  3. Generalized variance: The determinant of the covariance matrix, which is closely related to the entropy for elliptical distributions.

This implies that selecting a divergence is essentially choosing which specific uncertainty error to accept.

The Uncertainty Ordering

For Gaussian targets, the authors prove a strict hierarchy of uncertainty estimates. By ordering divergences based on the magnitude of the variances they estimate, they establish the following ordering: $$S(q||p) \prec KL(q||p) \prec D_\alpha(p||q) \prec KL(p||q) \prec S(p||q)$$ This ordering reveals critical behaviors for practitioners:

  • Reverse KL ($KL(q||p)$): Correctly estimates marginal precisions but notoriously underestimates marginal variances and entropy.
  • Forward KL ($KL(p||q)$): Correctly estimates marginal variances but overestimates entropy and underestimates marginal precisions.
  • Score-matching ($S(q||p)$): Is the most conservative, potentially leading to "variational collapse" where variance estimates vanish if correlations are high.

Empirical Validation

The theoretical ordering was tested against non-Gaussian targets using synthetic distributions (Student-t, Skew-Normal) and benchmarks from the Inference Gym, such as the "Eight Schools" hierarchical model and "Stochastic Volatility" time-series. Results demonstrate that while the variance ordering can shift in highly non-Gaussian cases (e.g., the "funnel" geometry of Eight Schools), the entropy ordering remains remarkably consistent across diverse models.

Conclusion

This analysis provides a rigorous framework for understanding UQ trade-offs in VI. It highlights that standard tools like Reverse KL inherently underestimate variance in the presence of correlations. Future research directions include extending these guarantees to more complex approximation families and developing automated methods for selecting divergences that match specific UQ requirements, such as entropy matching.

Summary updated

BibTeX
@misc{margossian2024variational,
  author = {Charles C. Margossian and Loucas Pillaud‐Vivien and Lawrence K. Saul},
  title = {{Variational Inference for Uncertainty Quantification: an Analysis of Trade-offs}},
  year = {2024},
  eprint = {2403.13748},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2403.13748},
}
Figure