Manuscript Offprint

arXiv:2610.24509

Denoising Implicit Variational Inference

Zitong Wang, Zekun Wu, Longlin Yu, Cheng Zhang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Semi-implicit variational inference (SIVI) expands the representational capacity of variational families, but optimizing the Evidence Lower Bound (ELBO) remains challenging because the marginal score of the semi-implicit distribution is generally intractable. Unbiased Implicit Variational Inference (UIVI) and related methods address this difficulty through reparameterized ELBO gradients, but existing approaches estimate the required score indirectly through reverse-conditional sampling or approximation, which can be computationally costly and unstable. We propose Denoising Implicit Variational Inference (DIVI), which learns the marginal score directly via denoising score matching. The learned score is used as a plug-in estimator in the pathwise ELBO gradient, replacing inner reverse-conditional sampling with a score-network evaluation. We analyze DIVI as inexact stochastic gradient ascent and show, under stated assumptions, that the averaged stationarity measure is controlled by the usual optimization term and the average score-matching error. Empirically, we evaluate DIVI on both synthetic distributions and a variety of real-data Bayesian inference tasks. The results show that DIVI improves over the current UIVI baselines while reducing the cost of ELBO-gradient estimation. Code is available at https://github.com/VincentWangzt/DIVI.

1 Introduction

Bayesian inference provides a principled framework for uncertainty quantification, but exact posterior inference is often intractable in modern probabilistic models. Variational Inference (VI) addresses this difficulty by casting posterior approximation as an optimization problem: given a variational family Q, VI seeks a tractable approximation q∈Qq \in \mathcal{Q} by maximizing the Evidence Lower Bound (ELBO), equivalently minimizing a KL divergence up to an additive constant [Jordan et al., 1999, Zhang et al., 2018]. The choice of Q determines the tradeoff between computational tractability and approximation quality. Classical mean-field VI is computationally convenient due to its factorized structure, but is often too restrictive to capture posterior dependencies and complex geometry [Peterson and Anderson, 1987, Saul et al., 1996, Turner et al., 2011, Blei et al., 2017].

Subsequent work has relaxed these restrictions through black-box gradient estimators and richer variational families, including auxiliary-variable models, structured approximations, and normalizing flows, substantially improving the expressiveness of VI [Ranganath et al., 2014, Mnih and Gregor, 2014, Paisley et al., 2012, Giordano et al., 2015, Kingma et al., 2016, Dinh et al., 2016]. However, many such methods still require evaluating and differentiating the variational density, which restricts the admissible variational family.

Implicit VI relaxes this restriction by defining variational distributions through sampling procedures, such as neural generators, without requiring tractable densities [Tran et al., 2017, Huszár, 2017, Shi et al., 2018]. The central obstacle then shifts to ELBO optimization, since marginal log-density

∗^{*}Equal contribution.

†^{\dagger}Correspondence to Cheng Zhang chengzhang@math.pku.edu.cn.

40th Conference on Neural Information Processing Systems (NeurIPS 2026).

and marginal score are no longer directly available. Semi-implicit variational inference (SIVI) [Yin and Zhou, 2018, Moens et al., 2021] offers a compromise by combining an explicit conditional distribution with an implicit mixing distribution. The resulting variational family is easy to sample from and highly expressive, but exact ELBO gradients require the marginal score ∇zlog⁡qϕ(z)\nabla_z \log q_\phi(z), which is intractable because it involves integrating over the mixing variable.

Existing ELBO-based SIVI methods address this marginal-score bottleneck indirectly. Classical SIVI optimizes biased surrogate ELBOs, whereas unbiased implicit variational inference (UIVI) [Titsias and Ruiz, 2019] derives an unbiased gradient estimator of the exact ELBO assuming access to samples from the reverse conditional distribution over the mixing variable. In practice, this reverse conditional is approximated by inner-loop Markov chain Monte Carlo (MCMC) sampling, which can be expensive and unstable when the reverse conditional is high-dimensional or multimodal. Importance-weighted variants reduce the reliance on MCMC by using importance sampling from proposal distributions [Sobolev and Vetrov, 2019], and recent AISIVI-style methods improve the proposal through conditional normalizing flows (CNFs) [Pielok et al., 2025]. However, these approaches still depend on an inner approximation to the reverse conditional, resulting in difficulties to control the variance of the gradient estimator in practice. The sampling-based approximation techniques also add computational overhead to the optimization procedure.

In this paper, we propose Denoising Implicit Variational Inference (DIVI), which estimates the marginal score of a semi-implicit variational distribution directly through denoising score matching (DSM) [Vincent, 2011]. The key observation is that samples from the semi-implicit hierarchy provide pairs (z,ϵ)(z, \epsilon) for which the conditional score ∇zlog⁡qϕ(z∣ϵ)\nabla_z \log q_\phi(z|\epsilon) is tractable. Instead of sampling from an approximate reverse conditional, DIVI trains a score network to regress the marginal score from these conditional-score targets. The learned score is then used as a plug-in estimator in the pathwise ELBO gradient, replacing inner proposal-based approximation with a single score-network evaluation.

This formulation yields both an efficient algorithm and a tractable optimization analysis. Our main contributions are summarized as follows:

• Direct marginal-score learning for semi-implicit VI. We propose DIVI, which learns the marginal score of a semi-implicit variational distribution via denoising score matching and uses the learned score as a plug-in estimator in the pathwise ELBO gradient, replacing inner reverse-conditional sampling with a single score-network evaluation.

• Convergence analysis with inexact score estimates. We analyze DIVI through the lens of inexact stochastic gradient ascent and show, under standard smoothness and boundedness assumptions, that the averaged stationarity measure is controlled by the usual optimization error and the average score-matching error.

• Empirical validation on synthetic distribution and real-data Bayesian inference tasks. Across these settings, DIVI recovers challenging posterior structure, matches or improves upon current baselines, and achieves favorable wall-clock efficiency in high-dimensional diffusion and Bayesian neural-network experiments.

References (55)

  • Analysis of SGD with biased gradient estimators (opens arXiv in a new tab)
  • Variational inference: A review for statisticians
  • Kernel semi-implicit variational inference
  • A guide through the zoo of biased sgd
  • Density estimation using Real NVP
  • Provable convergence guarantees for black-box variational inference
  • Mini-batch stochastic approximation methods for nonconvex stochastic composite optimization
  • Linear response methods for accurate covariance estimates from mean field variational bayes
  • An introduction to variational methods for graphical models
  • On the convergence of black-box variational inference, 2024 (opens arXiv in a new tab)
  • Improved variational inference with inverse autoregressive flow
  • Sampling with mollified interaction energy descent, 2023 (opens arXiv in a new tab)
  • Particle semi-implicit variational inference, 2025 (opens arXiv in a new tab)
  • A kernelized stein discrepancy for goodness-of-fit tests
  • Neural variational inference and learning in belief networks
  • Efficient semi-implicit variational inference (opens arXiv in a new tab)
  • Variational bayesian inference with stochastic search (opens arXiv in a new tab)
  • A mean field theory learning algorithm for neural networks
  • Revisiting unbiased implicit variational inference
  • Black box variational inference
  • Operator variational inference
  • Mean field theory for sigmoid belief networks
  • Kernel implicit variational inference
  • Importance weighted hierarchical variational inference
  • Unbiased implicit variational inference
  • Hierarchical implicit models and likelihood-free variational inference
  • Two problems with variational expectation maximisation for time-series models
  • Pascal Vincent. A connection between score matching and denoising autoencoders. Neural Computation, 23(7):1661–1674, 2011. doi: 10.1162/NECO_a_00142. (opens the publisher in a new tab)
  • Semi-implicit variational inference
  • Semi-implicit variational inference via score matching
  • Hierarchical semi-implicit variational inference with application to diffusion model acceleration
  • Advances in variational inference
  • Equivalently, expectations of functions depending only on $z$ are taken with respect to $z \sim q_{\phi}$
  • However, the semi-implicit score function $s_{\phi}(z) = \nabla_{z}\log q_{\phi}(z)$ is intractable
  • Then $\mathbb{E}\xi(z; \phi, \psi) = 0$
  • For the conditioned diffusion task, $\epsilon \in [0, 1]^{100}$ uses a uniform prior, $\mu_{\phi}$ is a two-hidden-layer ReLU MLP with hidden width 128, and the conditional covariance is a learned global diagonal variance initialized near 0.01725
  • For each $z_i$, $\log q_{\phi}(z_i)$ is approximated with 20 batches of 2,048 auxiliary $\epsilon$ samples, plus the generating $\epsilon$ sample
  • For heavy-tailed distributions, we report a truncated variant following Li et al. [2023]: both variational and reference samples are retained only if every coordinate has absolute value less than a threshold, the edge length, and sliced Wasserstein-2 is then computed on the accepted samples
  • We follow Pielok et al. [2025] in using this metric
  • Visual panels use 2,000 samples per method and overlay the samples on target-density contours
  • The well-separated modes (inter-mode distance $\approx 3.1$, versus component standard deviation 0.5) make this a challenging multi-modal target: the variational family must discover and cover all eight modes without spurious bridging density between them
  • The proxy is warm-started for 500 epochs with learning rate $10^{-3}$ and batch size 8,192
  • KSIVI is trained for 100,000 iterations
  • The proxy is warm-started for 2,000 epochs with learning rate $10^{-3}$ and batch size 8,192
  • The proxy is warm-started for 5,000 epochs with learning rate $2 \times 10^{-3}$ and batch size 2,048
  • For each model, we generate $N = 1,024$ evaluation pairs by sampling $\epsilon_i^{(0)} \sim \mathcal{N}(0, I)$ and then $z_i \sim q_\phi(z \mid \epsilon_i^{(0)})$
  • At each checkpoint, we use the variational model obtained by that method and evaluate
  • Table 7 reports the mean and standard error across five seeds
  • DIVI warm-starts $\psi$ from the preceding iteration, so each inner loop tracks the score of the current variational distribution
  • The first varies $L_{\psi}$ with $B_{\psi} = 2,048$; the second varies $B_{\psi}$ with $L_{\psi} = 5$
  • Semi-implicit VI represents complex multimodal structure through an implicit mixture
  • Bold indicates the lowest mean quality metric
  • Table 10 reports ELBO, Wasserstein-2 distance, and parameter count
  • Bold indicates the best mean or lowest parameter count
  • This supports Assumption 3 that the VI model gradients are bounded