f-Divergence Variational Inference

Neng Wan, Dapeng Li, Naira HovakimyanNeurIPS 2020

Introduction

In Bayesian machine learning, computing the posterior distribution $p(z|x)$ is a central but often computationally intractable problem. Variational Inference (VI) addresses this by reframing inference as an optimization task: finding a tractable distribution $q(z)$ that is "closest" to the true posterior.

Traditionally, this "closeness" is measured using the Kullback–Leibler (KL) divergence, which leads to the optimization of the well-known Evidence Lower Bound (ELBO). While KL-VI is the dominant paradigm, it has notable limitations, such as sensitivity to outliers and a tendency to underestimate posterior variance. Although recent research has explored alternative measures like Rényi’s $\alpha$-divergence or $\chi$-divergence, these have largely been treated as isolated cases.

This paper introduces $f$-VI, a generalized framework that extends Variational Inference to the entire family of $f$-divergences. By deriving a universal variational bound, the authors provide a standardized toolkit for both stochastic optimization and mean-field approximation across diverse statistical divergences.

The $f$-VI Methodology

The authors propose a unified framework that enables the use of arbitrary $f$-divergences in VI. Their approach is built on three core pillars:

  1. Surrogate $f$-Divergence: To ensure mathematical tractability, the authors introduce a surrogate divergence. This surrogate shares statistical consistency with the original $f$-divergence but allows for the straightforward derivation of variational bounds.
  2. The $f$-Variational Bound: They derive a general bound ($\mathcal{L}_f$) that unifies existing bounds like the ELBO (from KL divergence), CUBO (from $\chi$-divergence), and RVB (from Rényi divergence). Crucially, by selecting different $f$-functions, practitioners can create a "sandwich" estimate—providing both upper and lower bounds on the true evidence (marginal likelihood).
  3. Optimization Schemes:
  4. Stochastic Optimization: The framework adapts the reparameterization trick and importance weighting to work with any $f$-divergence, making it fully compatible with modern deep learning architectures like Variational Autoencoders (VAEs).
  5. Mean-Field Approximation: The authors generalize the Coordinate Ascent Variational Inference (CAVI) algorithm. By identifying a property called "shifted homogeneity" in certain $f$-functions, they derive coordinate-wise update rules that do not require gradients.
Illustration of the "sandwich" bounds around the true evidence.

Key Insights

  • The "Sandwich" Bound: One of the most powerful aspects of $f$-VI is its ability to bound the marginal likelihood from both above and below. This allows for significantly more accurate estimates of the model evidence than traditional KL-VI, which only provides a lower bound.
  • Algorithmic Unification: The paper proves that KL-VI, $\alpha$-VI, and $\chi$-VI are merely specific points within a much larger design space. Consequently, a single software implementation can support all of them.
  • Custom Divergences: Because the framework is highly general, it allows for the design of "custom" $f$-divergences (e.g., $f_{c1}$ and $f_{c2}$) tailored to specific tasks, often outperforming standard KL or Rényi divergences.
  • Shifted Homogeneity: The discovery that many common divergences share a specific structural advantage allows for the decomposition of complex $f$-functions, making mean-field updates possible for non-KL divergences.

Experimental Results

The authors evaluated $f$-VI across several domains, including synthetic data, Bayesian Neural Networks (BNNs), and Variational Autoencoders (VAEs).

BNN Regression: The framework was tested on twelve regression datasets from the UCI Machine Learning Repository. Custom $f$-VI instances achieved lower Root Mean Squared Error (RMSE) and better negative log-likelihoods on several datasets compared to standard KL-VI. Notably, on the "Concrete" dataset, $\chi$-VI significantly outperformed KL-VI.

Test RMSE and negative log-likelihood for BNN regression across UCI datasets.

Variational Autoencoders: In image reconstruction and generation tasks (using Caltech 101 Silhouettes, Frey Face, MNIST, and Omniglot), the $f$-VI framework proved highly competitive. On the Omniglot dataset, a custom $f$-divergence ($f_{c1}$) achieved a test reconstruction error of 107.13, outperforming the standard KL-VI baseline of 109.62.

Theoretical Validation: Synthetic experiments using a vanilla latent variable model successfully demonstrated that the importance-weighted $f$-bounds converge toward the true evidence as the number of samples increases, empirically confirming the "sandwich" theory.

Limitations and Future Work

While $f$-VI offers a robust generalization of Variational Inference, the authors note a few limitations. First, while their estimators are unbiased, composing them with certain inverse dual functions (required for some bounds) can occasionally lead to numerical instability. Second, while the framework allows for any $f$-divergence, it does not prescribe a definitive rule for selecting the optimal $f$ for a specific dataset; this remains a matter of empirical tuning or model selection.

Future research directions include exploring more efficient optimization methods tailored specifically for $f$-VI and searching for new $f$-divergence instances with even more favorable statistical properties, such as improved tail-adaptivity.

Summary updated

BibTeX
@inproceedings{wan2020f,
  author = {Neng Wan and Dapeng Li and Naira Hovakimyan},
  title = {{f-Divergence Variational Inference}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2020},
}
Figure