NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Semi-Implicit Variational Inference

Mingzhang Yin, Mingyuan Zhou

Introduction

Variational Inference (VI) is a cornerstone of modern Bayesian computation, transforming the challenge of posterior estimation into an optimization problem. By selecting a family of simple distributions and minimizing their divergence from the true posterior, VI offers a scalable alternative to Markov Chain Monte Carlo (MCMC). However, traditional VI—particularly Mean-Field VI (MFVI)—suffers from limited expressiveness, often failing to capture multimodality, skewness, or complex dependencies, and notoriously underestimating uncertainty.

The SIVI Framework

Semi-Implicit Variational Inference (SIVI) bridges the gap between the efficiency of explicit variational methods and the flexibility of implicit models. The core of SIVI is a hierarchical construction:

  1. Conditional Layer: A distribution $q(z|\psi)$ with an analytic density (e.g., Gaussian).
  2. Mixing Layer: A parameter $\psi$ drawn from a mixing distribution $q_\phi(\psi)$. Crucially, $q_\phi(\psi)$ can be an implicit distribution, such as the output of a deep neural network transformed from random noise.
  3. Marginal Distribution: The resulting variational distribution is the mixture $h_\phi(z) = \int q(z|\psi)q_\phi(\psi)d\psi$.

By only requiring the conditional layer to be explicit, SIVI avoids the unstable "density ratio trick" common in fully implicit models while maintaining high flexibility.

Optimization via Surrogate ELBO

Since the marginal density $h_\phi(z)$ is typically intractable, SIVI employs a surrogate Evidence Lower Bound (ELBO), denoted as $\mathcal{L}_K$. The authors prove that $\mathcal{L}_K$ provides a lower bound to the true ELBO and becomes asymptotically exact as the number of samples $K$ increases. This allows for stable optimization using standard stochastic gradient ascent.

Figure 3: Comparison of SIVI, MCMC, and Mean-Field VI across marginal and joint distributions. SIVI closely matches the MCMC ground truth, while Mean-Field VI fails to capture the full posterior spread and correlation.

Empirical Results

The effectiveness of SIVI was evaluated across synthetic toy distributions, real-world count data (Negative Binomial modeling), and high-dimensional image modeling (MNIST).

Posterior Accuracy and Uncertainty

In experiments involving Negative Binomial and Poisson-logarithmic models, SIVI demonstrated remarkable accuracy. As shown in Figure 3, SIVI's posterior approximations for parameters $r$ and $p$ almost perfectly overlap with MCMC results. In contrast, MFVI produces narrow, misplaced ellipses that significantly underestimate variance.

Convergence and Statistical Significance

A key theoretical advantage of SIVI is its asymptotic exactness. Figure 2 illustrates the relationship between the number of samples $K$ used in the surrogate ELBO and the resulting posterior quality. As $K$ increases, the Kolmogorov-Smirnov (KS) distance between SIVI and the MCMC posterior decreases, while the $p$-values increase, eventually indicating that the distributions are statistically indistinguishable.

Figure 2: Convergence of SIVI to the MCMC posterior as a function of $K$. As $K$ increases, the KS distance drops and the p-value rises, signifying statistical parity with MCMC.

Performance in Deep Generative Models

When applied to the MNIST dataset, the Semi-Implicit Variational Autoencoder (SIVAE) achieved a negative log evidence of 83.25, outperforming several sophisticated VAE variants, including those using Inverse Autoregressive Flows (IAF).

Conclusion

SIVI represents a significant advancement in variational inference, offering a principled way to incorporate implicit distributions without sacrificing optimization stability. By restoring dependencies and capturing complex posterior features, SIVI provides MCMC-level accuracy at a fraction of the computational cost, though the choice of $K$ and the mixing network architecture remain important practical considerations for future research.

Summary updated

BibTeX
@inproceedings{yin2018semi,
  author = {Mingzhang Yin and Mingyuan Zhou},
  title = {{Semi-Implicit Variational Inference}},
  booktitle = {International Conference on Machine Learning},
  year = {2018},
  url = {https://openreview.net/forum?id=ByZwfoWObr},
}
Figure