Abstract
We propose denoising diffusion variational inference (DDVI), a black-box variational inference algorithm for latent variable models which relies on diffusion models as flexible approximate posteriors. Specifically, our method introduces an expressive class of diffusion-based variational posteriors that perform iterative refinement in latent space; we train these posteriors with a novel regularized evidence lower bound (ELBO) on the marginal likelihood inspired by the wake-sleep algorithm. Our method is easy to implement (it fits a regularized extension of the ELBO), is compatible with black-box variational inference, and outperforms alternative classes of approximate posteriors based on normalizing flows or adversarial networks. We find that DDVI improves inference and learning in deep latent variable models across common benchmarks as well as on a motivating task in biology—inferring latent ancestry from human genomes—where it outperforms strong baselines on the Thousand Genomes dataset.
Introduction
Variational Inference (VI) is a cornerstone of modern probabilistic modeling, aiming to approximate complex, intractable posterior distributions $p(z|x)$ with a simpler, parameterized distribution $q(z|x)$. Traditionally, researchers have relied on simple families like Gaussians for $q(z|x)$. However, these rigid approximations often fail to capture the multi-modal and intricate structures inherent in real-world data, leading to poor model performance and biased latent representations.
While Normalizing Flows and Generative Adversarial Networks (GANs) have been proposed to increase posterior flexibility, they introduce significant trade-offs: flows require restrictive invertible architectures, and GANs are often unstable to train. Denoising Diffusion Variational Inference (DDVI) addresses these challenges by leveraging the expressive power of diffusion models—the current gold standard in generative modeling—to serve as highly flexible approximate posteriors. DDVI achieves superior performance without the computational burden of backpropagating through long iterative sampling chains, a common pitfall in previous diffusion-based inference attempts.
Methodology
DDVI treats the approximate posterior as a denoising diffusion process within the latent space. Instead of a direct, single-step mapping from data to latent variables, the model learns to iteratively refine a simple Gaussian noise vector into a complex latent representation $z$.
The Markovian ELBO and Wake-Sleep Optimization
The authors derive a Markovian Evidence Lower Bound (ELBO) that explicitly accounts for the auxiliary variables introduced by the diffusion process. To optimize this objective efficiently, DDVI employs a two-phase training strategy inspired by the "wake-sleep" algorithm:
- Wake Phase: The model updates the generative parameters and the posterior using the standard ELBO, focusing on how well the model explains the observed data.
- Sleep Phase: The posterior is trained to "denoise" samples generated by the model itself. This "off-policy" training allows the model to learn the reverse diffusion process using a simple regression-like loss (denoising score matching). This avoids the need to differentiate through the entire sampling chain, significantly improving training stability and speed.
This framework allows diffusion models to act as a "free" flow, providing the benefits of continuous-time normalizing flows without requiring strict architectural constraints like invertibility or tractable Jacobian determinants.
Experiments and Results
The efficacy of DDVI was evaluated across synthetic benchmarks, standard image datasets, and a real-world biological application.
Synthetic Latent Priors
To test the ability to capture non-Gaussian shapes, the authors used "Pinwheel," "Swiss Roll," and "Square" distributions. As shown in the visualizations below, DDVI was the only method capable of perfectly recovering these complex priors. Baselines like standard VAEs (AEVB) or Inverse Autoregressive Flows (IAF) often "smeared" the distributions or failed to capture distinct branches entirely.
Image Benchmarks and Biological Discovery
On MNIST and CIFAR-10, DDVI consistently achieved higher ELBO values than standard VAEs and Adversarial Autoencoders (AAEB). Beyond standard benchmarks, DDVI demonstrated its utility in high-stakes scientific analysis using the Thousand Genomes dataset. In the task of ancestry inference—clustering individuals based on genetic markers—DDVI outperformed strong baselines in Cluster Purity and Normalized Mutual Information (NMI), successfully separating distinct ethnic groups in a low-dimensional latent space.
Discussion and Conclusion
DDVI represents a significant step forward in making variational inference more expressive and robust. By utilizing the sleep phase for training, the algorithm mitigates common issues like posterior collapse, where the model ignores the latent space.
However, some limitations remain. While training is efficient, inference still requires multiple iterations to sample from the posterior, making it slower at test-time than simple Gaussian VAEs. Additionally, while the method is "black-box," the choice of the denoising network architecture remains a critical factor for performance. Future work may extend DDVI to tasks such as density estimation, reinforcement learning, and causal effect estimation, further broadening the impact of diffusion-based inference.
Summary updated