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

Doubly Semi-Implicit Variational Inference

Dmitry Molchanov, Valery Kharitonov, Artem Sobolev, Dmitry P. Vetrov

TL;DR

This paper introduces Doubly Semi-Implicit Variational Inference (DSIVI), a new framework for Bayesian inference that can handle both the approximate posterior and the prior distributions being "semi-implicit" (intractable but representable as a mixture). DSIVI provides a theoretically sound lower bound on the evidence lower bound (ELBO) that is asymptotically exact, enabling more flexible and powerful Bayesian modeling, especially for complex generative models.

What Problem Does This Paper Address?

Variational inference (VI) is a powerful technique for approximating intractable posterior distributions in Bayesian models. However, traditional VI methods often rely on simple, analytically tractable distributions for both the approximate posterior and the prior. This can lead to overly simplistic models that underfit or over-regularize complex data. While methods exist to handle implicit posteriors (where the density is unknown but samples can be drawn), handling semi-implicit distributions (mixtures of tractable and implicit components) for both the posterior and prior simultaneously has been a significant challenge. This paper addresses this gap by proposing DSIVI, a unified framework that can effectively perform inference and learning even when both the approximate posterior and the prior are semi-implicit.

Methods

The core contribution of DSIVI is a novel way to derive and optimize a lower bound on the Evidence Lower Bound (ELBO) when both the approximate posterior $q_\phi(z)$ and the prior $p_\theta(z)$ are semi-implicit. A semi-implicit distribution is defined as an implicit mixture of some analytically tractable density with a flexible mixing distribution (which itself can be explicit or implicit).

The paper extends the existing Semi-Implicit Variational Inference (SIVI) framework. For the approximate posterior, DSIVI uses a finite mixture approximation of the semi-implicit posterior, leading to a surrogate objective that is a lower bound on the ELBO and asymptotically exact. For the prior, DSIVI leverages the variational representation of the KL-divergence to derive an upper bound on the KL term, which in turn provides an upper bound on the ELBO. By combining these, DSIVI offers a sandwich bound that can be made arbitrarily tight.

A key aspect is that DSIVI optimizes a proper lower bound on the ELBO, which is asymptotically exact, unlike some prior methods that optimize biased surrogate objectives. This allows for direct optimization of both the variational parameters ($\phi$) and the prior parameters ($\theta$), enabling variational learning for the prior.

Datasets

The paper evaluates DSIVI on several standard machine learning tasks, including:

  • MNIST dataset: Used for experiments with Bayesian neural networks and variational autoencoders (VAEs).
  • Toy problems: Used to demonstrate the sequential approximation capabilities of DSIVI and to compare it with other implicit VI methods.

No new datasets were introduced.

Key Insights and Ideas

  • Unified framework for semi-implicit distributions: DSIVI provides a principled way to handle semi-implicit distributions for both the approximate posterior and the prior, a significant advancement over prior work that often focused on only one.
  • Asymptotically exact lower bound: The derived lower bound on the ELBO is theoretically sound and converges to the true ELBO, ensuring that optimizing it leads to a correct inference procedure.
  • Variational learning for priors: DSIVI naturally enables learning the parameters of the prior distribution, which is crucial for complex models where a fixed prior might be suboptimal.
  • Improved performance on VAEs: DSIVI offers a simple yet effective modification to existing methods like VampPrior for VAEs, leading to improved performance.
  • Flexibility in model design: The ability to use semi-implicit priors and posteriors opens up possibilities for designing more expressive and powerful generative models.

Key Results

  • Hierarchical Priors: In Bayesian neural networks with hierarchical priors, DSIVI matched the performance of true marginal variational inference, significantly outperforming joint inference methods.
  • VAEs: DSIVI-based modifications of VampPrior (DSIVI-agg and DSIVI-prior) showed improved test log-likelihoods on the MNIST dataset compared to standard VampPrior, with DSIVI-prior outperforming VampPrior even without warm-up.
  • Sequential Approximation: Experiments on toy problems demonstrated that DSIVI can accurately learn target distributions even when both the "prior" and "posterior" are semi-implicit, showing convergence over iterations.
  • Comparison to Alternatives: DSIVI was shown to converge faster and be more stable than other implicit VI methods like AVB and KIVI on a KL-divergence estimation task.

Limitations and Future Work

  • Computational Cost: While DSIVI provides a theoretically sound bound, the use of finite mixtures (K samples) introduces a computational trade-off. The paper notes that the number of samples K is the primary hyperparameter.
  • Hyperparameter Tuning: Like most VI methods, DSIVI still requires careful hyperparameter tuning, although the paper suggests it has fewer hyperparameters than some alternatives.
  • Future Work: The paper suggests exploring more complex semi-implicit distributions and applying DSIVI to a wider range of challenging probabilistic modeling tasks. The authors also mention the potential for further improvements by exploring different forms of the KL-divergence upper bound.

Summary updated

BibTeX
@inproceedings{molchanov2019doubly,
  author = {Dmitry Molchanov and Valery Kharitonov and Artem Sobolev and Dmitry P. Vetrov},
  title = {{Doubly Semi-Implicit Variational Inference}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2019},
  url = {https://openreview.net/forum?id=4r1soMSBaUn},
}
Figure