Abstract
We develop unbiased implicit variational inference (UIVI), a method that expands the applicability of variational inference by defining an expressive variational family. UIVI considers an implicit variational distribution obtained in a hierarchical manner using a simple reparameterizable distribution whose variational parameters are defined by arbitrarily flexible deep neural networks. Unlike previous works, UIVI directly optimizes the evidence lower bound (ELBO) rather than an approximation to the ELBO. We demonstrate UIVI on several models, including Bayesian multinomial logistic regression and variational autoencoders, and show that UIVI achieves both tighter ELBO and better predictive performance than existing approaches at a similar computational cost.
Introduction
Variational Inference (VI) has become a cornerstone of modern Bayesian machine learning by transforming the difficult task of posterior estimation into a more manageable optimization problem. Traditionally, researchers have relied on simple, tractable distributions (like Gaussians) for the variational family to keep the math manageable. However, these simple families often fail to capture the complex, multi-modal, or non-linear structures of true posterior distributions.
"Implicit" distributions offer a solution. These are distributions from which we can easily sample—for instance, by passing noise through a deep neural network—but whose density functions are intractable. While flexible, implicit distributions are notoriously difficult to optimize because calculating the Evidence Lower Bound (ELBO) requires the log-density of the approximation. Previous attempts to bridge this gap, such as Semi-Implicit Variational Inference (SIVI), often optimize a surrogate bound rather than the ELBO itself. UIVI addresses this by providing a method for direct, unbiased optimization of the ELBO.
Methodology
The Implicit Variational Family
UIVI defines the variational distribution $q_\theta(z)$ as a hierarchical mixture. First, a "mixing" parameter $\epsilon$ is sampled from a simple distribution $q(\epsilon)$. Then, $z$ is sampled from a reparameterizable conditional distribution $q_\theta(z|\epsilon)$, where the parameters of this conditional are determined by a flexible neural network. This structure allows the model to represent highly complex shapes while maintaining a degree of formal structure.
Unbiased Gradient Estimation
The core innovation of UIVI is a mathematical identity for the gradient of the entropy term. The authors prove that the gradient of the intractable log-density can be expressed as an expectation over a "reverse conditional" distribution: $$\nabla_z \log q_\theta(z) = \mathbb{E}_{q_\theta(\epsilon|z)}[\nabla_z \log q_\theta(z|\epsilon)]$$ This identity transforms an intractable density problem into a sampling problem. To estimate this expectation, UIVI employs Hamiltonian Monte Carlo (HMC) to draw samples from the reverse conditional $q_\theta(\epsilon|z)$.
MCMC from Stationarity
A common drawback of MCMC-based methods is the computational overhead of "burn-in" time. UIVI bypasses this by initializing the MCMC chain at the specific $\epsilon$ that was used to generate $z$ in the first place. Because this $(\epsilon, z)$ pair is already a sample from the joint distribution, the chain starts at stationarity, allowing for very short chains (e.g., 10 iterations) to produce high-quality, unbiased estimates.
Experiments and Results
Expressive Variational Families
The flexibility of UIVI was first tested on 2D toy distributions. As shown in Figure 1, the implicit family successfully captures complex geometries—including banana-shaped, multimodal, and x-shaped distributions—that would be impossible for standard Gaussian approximations to represent accurately.
Performance and Scalability
The method was further evaluated on Bayesian multinomial logistic regression using the MNIST and HAPT datasets. In these benchmarks, UIVI consistently outperformed SIVI, achieving higher ELBO values and better predictive performance (test log-likelihood) over time.
In Variational Autoencoder (VAE) experiments on Fashion-MNIST, UIVI achieved an average test log-likelihood of -110.72, a significant improvement over SIVI (-121.53) and standard VAEs (-126.73). Crucially, this performance boost comes with minimal computational overhead; for example, on MNIST, UIVI's iteration time (0.11s) was actually slightly faster than SIVI's (0.14s) in the authors' implementation.
Conclusion
Unbiased Implicit Variational Inference (UIVI) represents a significant step forward in making flexible variational families practical for large-scale Bayesian inference. By deriving a clever gradient identity and utilizing stationary MCMC initialization, UIVI allows for the direct optimization of the ELBO without the biases or high-dimensional failures of previous methods. The result is a robust, efficient algorithm that provides tighter posterior approximations and superior predictive performance across a variety of generative and discriminative models.
Summary updated