Manuscript Offprint
arXiv:2610.24509Denoising Implicit Variational Inference
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 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.
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 , 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 for which the conditional score 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.
2.1 Semi-implicit Variational Family
SIVI [Yin and Zhou, 2018] posits a flexible family that mixes an explicit tractable conditional layer with a simple mixing distribution :
This construction makes semi-implicit: sampling is straightforward via drawing from followed by , while evaluating the marginal density is generally intractable due to the integral. This intractability of makes optimizing the exact ELBO challenging, and SIVI employs tractable surrogate objectives that become tight asymptotically. We write for the marginal score and for the conditional score.
2.2 Unbiased Implicit Variational Inference
Instead of optimizing surrogate ELBOs for semi-implicit variational families, UIVI targets the exact ELBO and derives an unbiased gradient estimator [Titsias and Ruiz, 2019]. We follow the setup in UIVI, adopting the mild assumption of reparameterizability: there exists a base noise distribution and a deterministic map such that
Denote the dataset as . With the reparameterization , the exact ELBO can be rewritten as
(2)
Pushing inside the expectation yields the following decomposition, where the term vanishes under the usual regularity conditions.
The score of the joint distribution is accessible. The main difficulty lies in the term , which is intractable due to the mixture integral. UIVI resolves this by using the identity
expressing the marginal score as an expectation under the reverse conditional . This setting is also applicable to sampling from an unnormalized distribution: one only needs to replace with the gradient of the log unnormalized density.
In practice, UIVI estimates the expectation in (4) using an inner-loop MCMC sampler targeting , which can be computationally expensive in high-dimensional settings. Titsias and Ruiz [2019] argue that only a few MCMC steps may suffice because chains are initialized at a plausible state. However, the samples may fail to decorrelate when has complex geometry. Importance-sampling variants replace MCMC samples with samples from a proposal distribution [Sobolev and Vetrov, 2019], while AISIVI [Pielok et al., 2025] takes a step further by incorporating CNFs to approximate the reverse conditional. These methods still rely on an inner approximation to , so the resulting score estimator can still suffer from numerical instability and high variance, especially when the reverse distribution has not yet been approximated well.
3 Methodology
In this section, we present Denoising Implicit Variational Inference (DIVI). The standard pathwise ELBO gradient in (3) is available once the marginal score is known. The proposed component of DIVI is to learn a proxy score network for this marginal score, avoiding the reverse-conditional sampling used by UIVI. Training alternates between two steps: a -step that fits using tractable conditional scores, and a -step that updates the semi-implicit variational distribution using a plug-in ELBO gradient.
-step (learning the marginal score) For a fixed variational parameter , the conditional score is tractable, whereas the marginal score is not. By the score identity in (4), averaging the conditional score over the reverse conditional recovers the marginal score. This motivates fitting by regressing against the conditional score on samples generated from the semi-implicit hierarchy. We therefore minimize the denoising score matching objective
This objective is tractable because it only requires samples from and evaluations of the conditional score. Let the population loss for this step be denoted as .
Algorithm 1 DIVI Algorithm
1: Require: Dataset D, Generator , Score Network , Priors , . 2: Require: Learning rates , , Inner steps , Batch sizes N, B. 3: Initialize , . 4: for until convergence do 5: Set and . 6: // -step: fitting the marginal score. 7: for to do 8: Sample , , for . 9: . 10: . 11: end for 12: Set . 13: // -step: optimizing the ELBO. 14: Sample , , for . 15: . 16: . 17: end for
Proposition 3.1. Denote . Then we have
where .
For fixed , the second term in Proposition 3.1 is independent of . Thus, minimizing the tractable denoising score matching objective with respect to is equivalent to minimizing the marginal score error . In particular, the optimal score model satisfies -a.e., yielding . The proof is in Appendix A.1.
-step (ELBO optimization with a plug-in score) Given the learned score network , we approximate the exact ELBO gradient by replacing the intractable marginal score. Using the reparameterization with and , this gives the averaged surrogate gradient:
We then update by stochastic gradient ascent on the ELBO:
At gradient-evaluation time, this approximation replaces reverse-conditional sampling with one evaluation of the learned score network, which, by design, reduces the computational cost of each ELBO-gradient estimate compared to previous sampling-based UIVI variants.
We implement DIVI by alternating between the score-fitting step and the ELBO-gradient step. The complete procedure is presented in Algorithm 1.
To compare the different strategies concerning gradient approximation, we list the key features of related methods in Table 1. The original SIVI provides a surrogate lower bound [Yin and Zhou, 2018], not directly optimizing the ELBO. However, the gradient of the surrogate lower bound also gives an approximation of the ELBO gradient [Pielok et al., 2025], with sampled from the prior distribution.
4 Theoretical Analysis
In this section, we analyze the optimization error introduced by replacing the exact marginal score with the learned score network. The convergence analysis of black-box variational inference (BBVI) has been studied in general settings [Ranganath et al., 2016, Kim et al., 2024, Domke et al., 2023],
Table 1: Comparison of gradient estimation strategies.
| Method | Score Estimator | Estimate Approach | Strategy |
|---|---|---|---|
| SIVI | Surrogate Lower Bound | ||
| UIVI | (approximately) | Hamiltonian Monte Carlo | |
| AISIVI | Importance Sampling | ||
| DIVI | Denoising Score Matching |
We compute of SIVI under the reparameterization framework, which provides an approximation for .
but convergence guarantees for specific semi-implicit approaches remain limited [Moens et al., 2021, Cheng et al., 2024]. For ELBO-based semi-implicit methods such as UIVI and AISIVI, the main difficulty is to control the error of the score estimator used inside the pathwise gradient. DIVI makes this error explicit through the score-matching residual and the corresponding optimization process can be viewed as an inexact stochastic gradient procedure, allowing us to use tools for biased stochastic gradient ascent [Ajalloeian and Stich, 2020, Demidovich et al., 2023].
We use the Gaussian reparameterized form , where and is typically Gaussian or uniform. At iteration , let denote the filtration generated by all randomness before the score estimator is updated. After obtaining , define the enlarged filtration . We use the following assumptions.
Assumption 1. The objective is twice continuously differentiable and -smooth with respect to .
Assumption 2. There exists a constant such that , holds uniformly for .
Assumption 3. There exists a constant such that uniformly holds for , where denotes the operator norm.
The uniform boundedness conditions are understood on the algorithmic domain, where the iteration sequence is assumed to reside almost surely in a deterministic compact domain. In practice, this can be guaranteed by projected updates, which are standard in stochastic optimization analysis [Ghadimi et al., 2016]. The smoothness condition is standard in non-convex stochastic optimization. Assumption 2 controls the fourth moment of the score-error factor in the surrogate gradient through a uniform moment bound in expectation. We provide an additional derivation of this assumption using the linear growth conditions in [Cheng et al., 2024] in Appendix A.3. Assumption 3 is specific to our Gaussian reparameterization and controls the component-wise Jacobians of and . Numerical validations along the optimization path are provided in Appendix C.
Lemma 4.1. The fourth moment of the operator norm of the reparameterization Jacobian is bounded, i.e.,
We next analyze the stochastic optimization dynamics. Since and are -measurable, conditioned on , the samples , where , are independently generated from the current variational distribution. Let be the mini-batch surrogate gradient defined in Algorithm 1. We use the conditional decomposition
where is the conditional bias, and is the martingale difference noise with .
Denote , which is -measurable. We can control the bias and variance as follows:
Proposition 4.2. For constants and we have , .
Using these bounds, we obtain the following modified ascent lemma for DIVI optimization. Compared with the standard stochastic ascent inequality, the bound contains two additional error terms: the Monte Carlo variance term, scaled by , and the score-estimation bias term, scaled by .
Lemma 4.3. If the fixed stepsize , we have
By summing the one-step ascent inequality over , we obtain an averaged stationarity bound:
Theorem 4.4. Let . Under the assumptions above, if , then
In particular, if , then the balancing stepsize is admissible, and the stochastic optimization part is .
See detailed proofs in Appendix A. Theorem 4.4 separates the optimization error into two parts. The first part is the usual stochastic optimization error caused by finite mini-batch sampling; when the balancing stepsize is admissible, it decays as for fixed N. The second part is the averaged score-estimation error, which captures the bias introduced by replacing the intractable score with the learned estimator . By Proposition 3.1, the denoising score-matching objective has the marginal score as its population minimizer, hence this residual can be reduced by sufficiently optimizing the inner score-learning problem, up to the statistical and approximation errors of the score model. We provide empirical evaluations of this quantity during the training process in Section 6.4. Thus, DIVI approaches stationarity to the extent that the learned score tracks the marginal score along the optimization path.
5 Related Work
ELBO-based SIVI. Semi-implicit variational inference (SIVI) defines expressive variational distributions by mixing an explicit conditional distribution with an implicit mixing distribution, enabling efficient sampling while leaving the marginal density and marginal score intractable [Yin and Zhou, 2018, Moens et al., 2021]. The original SIVI objective optimizes tractable surrogate ELBO bounds, whereas UIVI targets the exact ELBO by estimating the marginal score through reverse-conditional sampling over the mixing variable [Titsias and Ruiz, 2019]. Importance-weighted and AISIVI-style methods reduce the reliance on MCMC by using proposal distributions, including expressive conditional normalizing flows [Sobolev and Vetrov, 2019, Pielok et al., 2025]. DIVI is closest to these ELBO-gradient methods, but replaces inner reverse-conditional score estimation with a learned marginal-score proxy trained by denoising score matching.
Alternative SIVI objectives. Other SIVI methods avoid marginal-density evaluation by changing the optimization criterion. Fisher-divergence-based SIVI uses score matching but leads to a minimax problem [Yu and Zhang, 2023], while KSIVI uses kernel Stein discrepancy to obtain a standard minimization objective [Cheng et al., 2024, Liu et al., 2016]. Particle semi-implicit VI uses particles to represent the mixing distribution in a special semi-implicit family construction and approximates Euclidean–Wasserstein gradient flows [Lim and Johansen, 2025]. These approaches are complementary to DIVI: they modify the objective, representation, or gradient-flow geometry, whereas DIVI keeps the ELBO-gradient framework and addresses its marginal-score bottleneck through denoising score matching [Hyvärinen, 2005, Vincent, 2011]. Convergence guarantees for ELBO-based black-box VI and related semi-implicit methods have been studied under stochastic-gradient or surrogate-objective settings [Ranganath et al., 2016, Kim et al., 2024, Moens et al., 2021, Cheng et al., 2024]. Our convergence analysis treats the resulting update as inexact ELBO-gradient optimization, with residual stationarity error controlled by the denoising score-matching error.

Figure 1: Qualitative comparison on two-dimensional targets. Each panel is generated from 2,000 samples from the ground-truth baseline or a learned variational distribution; blue contours show the target density.
6 Experiments
We evaluate DIVI across posterior inference problems that increase in dimension and structure. The experiments investigate whether DIVI can capture visible posterior geometry on two-dimensional synthetic targets, approximate a 100-dimensional conditioned diffusion posterior accurately, and provide predictive posterior distributions for Bayesian neural network (BNN) regression. In line with prior SIVI evaluations, we incorporate annealing techniques where appropriate. Unless stated otherwise, tables report the mean and standard error over 10 independent runs.
Our main comparisons are against UIVI and AISIVI [Titsias and Ruiz, 2019, Pielok et al., 2025]. We also include SIVI [Yin and Zhou, 2018] and KSIVI [Cheng et al., 2024] where their objectives apply. For the instantiation of the DIVI score model , we use a multi-layer perceptron (MLP), which is warm-started before joint training. For each experiment, all methods share the same neural-network architecture for the semi-implicit variational family. The variational family, evaluation metrics, and per-experiment configurations are collected in Appendix B. We also provide additional arguments to support our theoretical Assumption 2 and Assumption 3 in Appendix C.
6.1 Toy two-dimensional targets
We first use low-dimensional unnormalized distribution targets to check whether the learned semi-implicit distribution captures geometric features that are easy to inspect visually.
Following previous works [Yu and Zhang, 2023, Li et al., 2023, Yu et al., 2023], we focus on the three plotted targets in Figure 1: x_shaped, student_uc, and 8_gaussians. These targets probe for intersecting ridges, heavy-tailed dependence, and multi-modal coverage. We train SIVI, AISIVI, UIVI, and DIVI for 10,000 iterations and KSIVI for 50,000 iterations, with learning rate and batch size 128. For DIVI, we train the proxy score MLP for 5 steps using 2048 samples and learning rate after each update to the main VI model. Full per-method configurations and quantitative diagnostics are given in Appendix B.3.
Figure 1 shows that DIVI preserves the main geometry across the plotted targets, with sample clouds that closely follow the target contours in these visual comparisons. The quantitative diagnostics in Appendix B.3 show that DIVI obtains the lowest mean on four of the six KL-style and Wasserstein metrics and the second-lowest on the remaining two. We also provide a comparison of the learned score against the true target distribution score in Appendix B.7, which demonstrates that DIVI achieves the lowest error on example X-shaped target.

Figure 2: Posterior path approximations on the conditioned diffusion benchmark. The magenta curve is the true latent path, red points are observations, blue curves are posterior mean paths, and shaded regions are marginal 95% confidence intervals.
6.2 Conditioned diffusion process
We next evaluate a 100-dimensional conditioned diffusion posterior used in recent SIVI evaluations [Cheng et al., 2024, Pielok et al., 2025]. The latent path follows the double-well Langevin SDE
where is one-dimensional Brownian motion. We discretize the path with Euler-Maruyama step size , giving . The corresponding path prior is
Observations are made every five time steps,
for and . The inference target is therefore , with likelihood
Posterior quality can be assessed through the mean path and the marginal uncertainty band. Following Cheng et al. [2024], we approximate the posterior by running stochastic gradient Langevin dynamics (SGLD) with 1000 particles, 100,000 iterations and a step size of , and use the resulting samples as a high-quality reference for evaluation. In the evaluation, we include SIVI and KSIVI as additional baselines. We train SIVI, UIVI, AISIVI, and DIVI for 10,000 main VI iterations with learning rate and batch size 128; KSIVI is trained for 100,000 iterations with the same learning rate and batch size and a slower learning rate decay schedule. For DIVI, we train the proxy score MLP for 5 steps using 2048 samples and learning rate after each update to the main VI model. Further method configurations are in Appendix B.4.
Figure 2 shows that DIVI tracks the latent trajectory while maintaining a posterior band comparable to the SGLD reference. Following Pielok et al. [2025], Table 2 reports the expected log marginal likelihood of the 1,000 high-quality reference samples obtained from SGLD. For each method, we use 100,000 samples from the final trained variational model to approximate the marginal likelihood, and use the marginal likelihood estimated from 100,000 SGLD samples as the reference value. Larger values indicate better agreement with the reference posterior. We also report the wall-clock end-to-end training time for each method, including any warmup phases. As shown in Table 2, DIVI obtains the
Table 2: Conditioned diffusion results for expected log marginal likelihood and wall-clock time.
| Method | ELM | wall-clock time (s) | iterations |
|---|---|---|---|
| SGLD | 75.316 ± 0.00 | - | - |
| SIVI | 58.309 ± 0.11 | 368 | 10K |
| UIVI | 21.866 ± 0.23 | 756 | 10K |
| AISIVI | 74.687 ± 0.03 | 736 | 10K |
| KSIVI | 74.808 ± 0.04 | 948 | 100K |
| DIVI | 75.162 ± 0.02 | 335 | 10K |
Table 3: BNN test performance and computational cost. RMSE and NLL are reported as mean ± standard error. Lower is better. Bold indicates the best result; underline indicates the second best.
| Dataset | Metric | SIVI | UIVI | AISIVI | KSIVI | DIVI |
|---|---|---|---|---|---|---|
| Boston | RMSE | 2.826 ± 0.06 | 3.266 ± 0.11 | 3.294 ± 0.10 | 2.661 ± 0.02 | 2.677 ± 0.06 |
| NLL | 2.518 ± 0.01 | 2.606 ± 0.02 | 2.615 ± 0.02 | 2.490 ± 0.00 | 2.477 ± 0.01 | |
| Concrete | RMSE | 6.932 ± 0.09 | 7.668 ± 0.16 | 8.243 ± 0.28 | 6.351 ± 0.02 | 6.342 ± 0.08 |
| NLL | 3.373 ± 0.02 | 3.490 ± 0.03 | 3.539 ± 0.04 | 3.262 ± 0.00 | 3.283 ± 0.02 | |
| Power | RMSE | 3.936 ± 0.01 | 3.977 ± 0.01 | 4.007 ± 0.01 | 4.265 ± 0.14 | 3.878 ± 0.01 |
| NLL | 2.802 ± 0.00 | 2.813 ± 0.00 | 2.823 ± 0.00 | 2.931 ± 0.06 | 2.781 ± 0.00 | |
| Protein | RMSE | 4.892 ± 0.03 | 5.021 ± 0.00 | 4.934 ± 0.02 | 4.967 ± 0.00 | 4.493 ± 0.00 |
| NLL | 3.019 ± 0.00 | 3.029 ± 0.00 | 3.028 ± 0.00 | 3.021 ± 0.00 | 2.927 ± 0.00 | |
| Wine Red | RMSE | 0.623 ± 0.01 | 0.627 ± 0.00 | 0.625 ± 0.01 | 0.604 ± 0.00 | 0.613 ± 0.00 |
| NLL | 0.941 ± 0.01 | 0.947 ± 0.01 | 0.943 ± 0.01 | 0.915 ± 0.00 | 0.930 ± 0.01 | |
| Yacht | RMSE | 1.911 ± 0.12 | 2.720 ± 0.10 | 2.539 ± 0.10 | 1.274 ± 0.07 | 1.358 ± 0.04 |
| NLL | 1.862 ± 0.06 | 2.281 ± 0.08 | 2.181 ± 0.07 | 1.595 ± 0.04 | 1.557 ± 0.06 | |
| Avg. wall-clock time | 487 | 842 | 704 | 1100 | 264 | |
highest expected log marginal likelihood among the VI methods and is closest to the SGLD reference, while also using the lowest wall-clock training time among the reported variational methods. Further metric and configuration details can be found in Appendix B.4.
6.3 Bayesian neural-network regression
We finally evaluate posterior inference for Bayesian neural networks (BNN) on six UCI regression targets: Boston Housing, Concrete, Power Plant, Protein, Wine Red, and Yacht. Following the BNN settings used for KSIVI and SIVI-SM [Cheng et al., 2024, Yu and Zhang, 2023], each target uses a single-hidden-layer ReLU network with 50 hidden units. These targets provide a diverse high-dimensional suite, with posterior dimensionality ranging from 301 to 751. Because these posteriors are data-dependent, we evaluate posterior predictive performance through test root mean square error (RMSE) and negative test log-likelihood (NLL), where lower values indicate better performance. We select the learning rate for each method on each target independently from via cross-validation. We train all methods for 10,000 VI iterations except KSIVI, which, following the setting in Cheng et al. [2024], is trained for 100,000 iterations. We train the proxy score MLP for DIVI for 2 steps using 2048 samples and learning rate after each optimization step to the variational distribution. Dataset and evaluation details are in Appendix B.5.
Table 3 gives the full predictive comparison across SIVI, UIVI, AISIVI, KSIVI, and DIVI. DIVI is best or second-best on most reported RMSE and NLL entries, with particularly strong performance on Power and Protein. The results also show cases where KSIVI remains stronger, such as Wine Red and Yacht RMSE. Overall, DIVI remains competitive with the strongest baselines while requiring the lowest average wall-clock training time.
6.4 Ablation studies
First we ablate on the effect of the score estimators of each method. We evaluate SIVI, UIVI, AISIVI, and DIVI as score estimators on the same fixed variational distributions obtained after 2,000 to 10,000 DIVI updates on the X-shaped target. Table 4 reports the squared discrepancy of the estimated score with respect to a reference score produced by UIVI-styled long HMC chains, together with the score-evaluation time of each method. DIVI achieves the lowest mean score-estimation error at every checkpoint and the lowest score-evaluation latency under the tested configurations. We may also observe that the score estimates of DIVI improves continually throughout the training process. More details of the evaluation are given in Appendix B.6. We also provide a comparison of the learned score against the true target distribution score along the trajectory of each method in Appendix B.7, which demonstrates that DIVI achieves the lowest error on all reported checkpoints on the example X-shaped target.
Table 4: Score-estimation error on fixed DIVI variational checkpoints for the X-shaped target (mean standard error over five seeds). Bold indicates the lowest mean.
| Checkpoint | SIVI | UIVI | AISIVI | DIVI |
|---|---|---|---|---|
| 2,000 steps | 154.381 ± 68.264 | 1188.717 ± 509.566 | 45.529 ± 34.394 | 0.899 ± 0.406 |
| 4,000 steps | 113.301 ± 27.096 | 889.808 ± 239.577 | 13.478 ± 8.219 | 0.802 ± 0.388 |
| 6,000 steps | 78.763 ± 17.876 | 880.869 ± 314.731 | 7.249 ± 2.089 | 0.407 ± 0.211 |
| 8,000 steps | 81.909 ± 27.307 | 972.443 ± 358.567 | 20.203 ± 6.899 | 0.303 ± 0.137 |
| 10,000 steps | 107.791 ± 21.953 | 899.236 ± 273.263 | 6.881 ± 3.126 | 0.331 ± 0.245 |
| Time (ms) | 5.316 ± 0.082 | 204.523 ± 10.375 | 8.096 ± 0.099 | 0.134 ± 0.001 |
Additionally, we ablate on the expressiveness of the semi-implicit variational distributional family, providing comparison with a RealNVP variational family in Appendix B.9. We also perform ablations of DIVI's choice of score-update count in each variational optimization step and the reverse batch size in Appendix B.8. We believe this would provide practical guidance for future users of DIVI, as the score-update count and reverse batch size are two important hyperparameters in the accuracy-computaion tradeoff of DIVI.
7 Conclusion
We introduced Denoising Implicit Variational Inference (DIVI), an ELBO-based method for semi-implicit variational families that replaces reverse-conditional sampling with direct marginal-score learning. By fitting a score network via denoising score matching against tractable conditional scores, DIVI yields a simple plug-in pathwise ELBO-gradient estimator and avoids the inner sampling step used by previous UIVI-style methods. We analyzed the resulting procedure as inexact stochastic gradient ascent, showing that the averaged stationarity measure is controlled by the standard optimization term and the average score-matching error. Empirically, DIVI performs competitively across synthetic targets, conditioned diffusion posteriors, and Bayesian neural-network regression benchmarks, while achieving favorable wall-clock time in high-dimensional settings. Overall, these results suggest that denoising score estimation provides a practical route to scalable ELBO optimization with semi-implicit variational distributions. As a limitation, our analysis relies on smoothness of the target objective and boundedness of the optimization trajectory, and finite-capacity score networks may leave non-vanishing residual score-estimation error. We also acknowledge the performance in complex multimodal settings as a to-be-improved aspect, which might be mitigated by complex hierarchical variational family, though we leave these for future work.
Acknowledgments and Disclosure of Funding
This work was supported by National Natural Science Foundation of China (grant no. 12671341, grant no. 12292980 and grant no. 12292983). The research of Cheng Zhang was support in part by National Engineering Laboratory for Big Data Analysis and Applications, the Key Laboratory of Mathematics and Its Applications (LMAM) and the Key Laboratory of Mathematical Economics and
Quantitative Finance (LMEQF) of Peking University. The authors thank Zhifei Li and Haoyu Tao for the helpful discussions and feedback in the preliminary stages of this work.
References
Ahmad Ajalloeian and Sebastian U. Stich. Analysis of SGD with biased gradient estimators. arXiv preprint arXiv:2008.00051, 2020.
David M Blei, Alp Kucukelbir, and Jon D McAuliffe. Variational inference: A review for statisticians. Journal of the American Statistical Association, 112(518):859–877, 2017.
Ziheng Cheng, Longlin Yu, Tianyu Xie, Shiyue Zhang, and Cheng Zhang. Kernel semi-implicit variational inference. In Forty-first International Conference on Machine Learning, 2024.
Yury Demidovich, Grigory Malinovsky, Igor Sokolov, and Peter Richtarik. A guide through the zoo of biased sgd. In A. Oh, T. Naumann, A. Globerson, K. Saenko, M. Hardt, and S. Levine, editors, Advances in Neural Information Processing Systems, volume 36, pages 23158–23171. Curran Associates, Inc., 2023.
Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using real nvp. arXiv preprint arXiv:1605.08803, 2016.
Justin Domke, Robert Gower, and Guillaume Garrigos. Provable convergence guarantees for black-box variational inference. Advances in neural information processing systems, 36:66289–66327, 2023.
Saeed Ghadimi, Guanghui Lan, and Hongchao Zhang. Mini-batch stochastic approximation methods for nonconvex stochastic composite optimization. Mathematical Programming, 155(1):267–305, 2016.
Ryan J Giordano, Tamara Broderick, and Michael I Jordan. Linear response methods for accurate covariance estimates from mean field variational bayes. Advances in neural information processing systems, 28, 2015.
Ferenc Huszár. Variational inference using implicit distributions. ArXiv, abs/1702.08235, 2017.
Aapo Hyvärinen. Estimation of non-normalized statistical models by score matching. Journal of Machine Learning Research, 6(24):695–709, 2005. URL http://jmlr.org/papers/v6/hyvarinen05a.html.
Michael I Jordan, Zoubin Ghahramani, Tommi S Jaakkola, and Lawrence K Saul. An introduction to variational methods for graphical models. Machine learning, 37(2):183–233, 1999.
Kyurae Kim, Jisu Oh, Kaiwen Wu, Yi-An Ma, and Jacob R. Gardner. On the convergence of black-box variational inference, 2024. URL https://arxiv.org/abs/2305.15349.
Durk P Kingma, Tim Salimans, Rafal Jozefowicz, Xi Chen, Ilya Sutskever, and Max Welling. Improved variational inference with inverse autoregressive flow. Advances in neural information processing systems, 29, 2016.
Lingxiao Li, Qiang Liu, Anna Korba, Mikhail Yurochkin, and Justin Solomon. Sampling with mollified interaction energy descent, 2023. URL https://arxiv.org/abs/2210.13400.
Jen Ning Lim and Adam M. Johansen. Particle semi-implicit variational inference, 2025. URL https://arxiv.org/abs/2407.00649.
Qiang Liu, Jason Lee, and Michael Jordan. A kernelized stein discrepancy for goodness-of-fit tests. In International conference on machine learning, pages 276–284. PMLR, 2016.
Andriy Mnih and Karol Gregor. Neural variational inference and learning in belief networks. In International Conference on Machine Learning, pages 1791–1799. PMLR, 2014.
Vincent Moens, Hang Ren, Alexandre Maraval, Rasul Tutunov, Jun Wang, and Haitham Ammar. Efficient semi-implicit variational inference. arXiv preprint arXiv:2101.06070, 2021.
John Paisley, David Blei, and Michael Jordan. Variational bayesian inference with stochastic search. arXiv preprint arXiv:1206.6430, 2012.
Carsten Peterson and James R Anderson. A mean field theory learning algorithm for neural networks. Complex systems, 1(5), 1987.
Tobias Pielok, Bernd Bischl, and David Rügamer. Revisiting unbiased implicit variational inference. In Forty-second International Conference on Machine Learning, 2025.
Rajesh Ranganath, Sean Gerrish, and David Blei. Black box variational inference. In Artificial intelligence and statistics, pages 814–822. PMLR, 2014.
Rajesh Ranganath, Dustin Tran, Jaan Altosaar, and David Blei. Operator variational inference. In D. Lee, M. Sugiyama, U. Luxburg, I. Guyon, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 29. Curran Associates, Inc., 2016.
Lawrence K Saul, Tommi Jaakkola, and Michael I Jordan. Mean field theory for sigmoid belief networks. Journal of artificial intelligence research, 4:61–76, 1996.
Jiaxin Shi, Shengyang Sun, and Jun Zhu. Kernel implicit variational inference. In International Conference on Learning Representations, 2018.
Artem Sobolev and Dmitry P. Vetrov. Importance weighted hierarchical variational inference. ArXiv, abs/1905.03290, 2019.
Michalis K Titsias and Francisco Ruiz. Unbiased implicit variational inference. In The 22nd international conference on artificial intelligence and statistics, pages 167–176. PMLR, 2019.
Dustin Tran, Rajesh Ranganath, and David M. Blei. Hierarchical implicit models and likelihood-free variational inference. In Neural Information Processing Systems, 2017.
Richard Turner, M. Sahani, D. Barber, Ali Cemgil, and S. Chiappa. Two problems with variational expectation maximisation for time-series models. Bayesian Time Series Models, pages 109–130, 01 2011.
Pascal Vincent. A connection between score matching and denoising autoencoders. Neural Computation, 23(7):1661–1674, 2011. doi: 10.1162/NECO_a_00142.
Mingzhang Yin and Mingyuan Zhou. Semi-implicit variational inference. In International conference on machine learning, pages 5660–5669. PMLR, 2018.
Longlin Yu and Cheng Zhang. Semi-implicit variational inference via score matching. In The Eleventh International Conference on Learning Representations, 2023.
Longlin Yu, Tianyu Xie, Yu Zhu, Tong Yang, Xiangyu Zhang, and Cheng Zhang. Hierarchical semi-implicit variational inference with application to diffusion model acceleration. In Thirty-seventh Conference on Neural Information Processing Systems, 2023.
Cheng Zhang, Judith Bütepage, Hedvig Kjellström, and Stephan Mandt. Advances in variational inference. IEEE transactions on pattern analysis and machine intelligence, 41(8):2008–2026, 2018.
A Proofs of Propositions
A.1 Proof of Proposition 3.1
Proof. Expanding the squared norm with :
where the last equality holds under the standard regularity conditions that allow differentiation under the integral sign. If the score model class is sufficiently rich, the population minimizer satisfies , and hence .
A.2 Proof of Lemma 4.1
Proof. Under the reparameterization , , , , the gradient , . Throughout the proof, all vectors are treated as row vectors.
First we give an upper bound for . For a standard Gaussian random variable, we use the tail bound . Therefore, for any , . Hence,
Solving for such that yields . Splitting the integral at , we obtain:
So we arrive at the upper bound for the fourth moment . Based on this result, we can control the fourth order moment :
Here, denotes the 2- operator norm for matrices, is the diagonal matrix with .
A.3 Bound Based on Linear Growth Condition
We show that Assumption 2 can be derived from a linear growth condition together with a bounded fourth moment condition on the reparameterization functions.
Similar to the conditions of linear growth and fourth-moment boundedness in [Cheng et al., 2024], we assume that there exists a constant such that
holds uniformly for and and there exists a constant such that
holds uniformly for . Then Assumption 2 holds with
Proof. It suffices to prove the bound for ; the bound for follows identically. By the linear growth condition and ,
Therefore, , where . The same argument gives . We also provide numerical validations on the reasonable bound of and , which is discussed concisely in Appendix C
A.4 Proof of Proposition 4.2
Proof. Based on the preparations in Appendix A.2, we can respectively bound the bias and variance of the surrogate gradient.
First, we fix and take all expectations with respect to the fresh sampling variables , with . Equivalently, expectations of functions depending only on are taken with respect to . We concentrate on two estimators only using a single sample :
Since , (9) gives an unbiased estimator of . However, the semi-implicit score function is intractable. Therefore, (10) gives a biased estimator of with bias-variance decomposition:
where , . Then .
By Lemma 4.1 and Cauchy-Schwarz inequality, we can control the bias norm by the score matching error :
Next, could be controlled similarly.
We now relate these conditional quantities to the preceding single-sample bounds. The bounds derived above were fixed-parameter bounds: for any fixed , with fresh samples , we have , . Conditioning on , the iterates and are fixed, and the only remaining randomness comes from the fresh mini-batch. Therefore, the preceding fixed-parameter bias bound can be applied with , yielding .
It remains to justify the mini-batch variance bound. Define the single-sample surrogate gradient at iteration by , Then , and . Conditional on , the variables are i.i.d. Hence the cross terms vanish, and
This completes the proof.
A.5 Proof of Lemma 4.3
Proof. Recall that the update rule is . By the L-smoothness of , we have
By Proposition 4.2, we have the decomposition , , with , . Taking conditional expectation with respect to , we obtain
In the last inequality, we used , .
Under the stepsize condition , we have , . Therefore,
This completes the proof.
A.6 Proof of Theorem 4.4
Proof. Taking total expectation on both sides of Lemma 4.3, we obtain
Summing from n = 0 to T - 1, we get
Rearranging and using ,
Dividing both sides by , we obtain
The right-hand side consists of three terms. The first term is the finite-iteration optimization error, the second term comes from the Monte Carlo variance of the mini-batch estimator, and the third term reflects the accumulated bias caused by the imperfect score estimator . Balancing the first two terms suggests the choice . With the balancing stepsize, when it is admissible, the stochastic optimization part satisfies . Therefore, if is fixed and are treated as constants, the stochastic optimization error is of order .
B Experimental Details
B.1 Shared setup
Variational family. All SIVI variants use a conditional Gaussian semi-implicit variational family. We write the mixing variable as and the latent variable as z, with
For two-dimensional targets, the mixing prior is standard Gaussian, and and the diagonal variance are produced by a two-hidden-layer MLP with hidden width 128. For the conditioned diffusion task, uses a uniform prior, 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 BNN regression, uses a standard Gaussian prior, and the diagonal log variance are produced by a two-hidden-layer ReLU MLP with hidden width 10, and the log variance is initialized at -8 with a lower clamp at -20. These BNN choices follow the compact semi-implicit architecture used in the KSIVI and SIVI-SM comparisons.
Common training protocol. Unless otherwise noted, quantitative results use ten random seeds and report the mean and standard error. The supplementary score-error comparisons, reverse-update ablations, and RealNVP comparison use five seeds and report standard errors. For n independent runs, the standard error is , where s is the sample standard deviation across runs. Unless otherwise noted, SIVI, UIVI, AISIVI, and DIVI use 10,000 main VI iterations with batch size 128, Adam optimization, and a step learning-rate scheduler. Unless otherwise noted, all methods are trained with annealing enabled for half of the total training iterations. All experiments are conducted on a Linux server with Nvidia RTX 4090 GPUs and Intel Xeon Gold 6430 @ 2.10GHz.
SIVI. SIVI approximates the semi-implicit marginal using Monte Carlo averages over auxiliary samples. We draw 4,096 auxiliary samples on diffusion targets and 2,048 on BNN targets due to GPU memory constraints.
UIVI. UIVI samples from the reverse conditional via Hamiltonian Monte Carlo. After 5 burn-in transitions, a single HMC trajectory of 5 leapfrog steps provides auxiliary samples, one per intermediate position, following Titsias and Ruiz [2019]. The leapfrog step size is 0.2.
B.2 Metrics
KL-style ELBO. For toy and diffusion targets, we report a KL-style objective,
The estimate uses VI samples. For each , is approximated with 20 batches of 2,048 auxiliary samples, plus the generating sample. We utilize the batching logic in Pielok et al. [2025] to increase the effective number of Monte Carlo auxiliary samples to 40960.
Sliced Wasserstein-2. Sliced Wasserstein-2 is computed by averaging one-dimensional Wasserstein distances over random unit projections,
estimated using 10,000 samples and 5,000 random projections. 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. This provides a stable central-region transport diagnostic when tail draws dominate finite-sample Wasserstein estimates. We use 6 as the edge length for 8_gaussians and edge length 8 for student_uc.
Expected log marginal (ELM). For the conditioned diffusion benchmark, we report the expected log marginal likelihood,
where is the empirical distribution from the SGLD reference samples and is a one-dimensional Gaussian KDE fit to coordinate of model samples. We follow Pielok et al. [2025] in using this metric. Direct Monte Carlo approximation of the full semi-implicit marginal likelihood is difficult because it integrates over a 100-dimensional mixing distribution, so the coordinate-wise KDE estimate provides a stable diagnostic, though it does not capture the full joint marginal likelihood. The reported evaluation uses 1,000 reference samples and 100,000 model samples; the SGLD baseline uses 100,000 SGLD samples as the model sample set.
BNN predictive metrics. For BNN targets, evaluation draws 2,000 posterior samples (network weights) from the learned variational distribution. RMSE is computed from the posterior predictive mean on the test set. Test log-likelihood is estimated by Monte Carlo marginalization over posterior samples, and the reported NLL is its negative.
B.3 Two-dimensional targets
The main text displays and summarizes x_shaped, student_uc, and 8_gaussians. Visual panels use 2,000 samples per method and overlay the samples on target-density contours.
Target density definitions. We now state the precise density for each of the three two-dimensional synthetic targets used in Section 6.1. All targets have .
X-shaped. The x_shaped target is an equal-weight mixture of two zero-mean Gaussians whose covariance ellipses cross at the origin, producing an X-shaped density:
where
The high off-diagonal correlation () in each component creates two narrow ridges that intersect at the origin. Approximating both ridges simultaneously requires the variational family to represent sharp, non-convex geometry.
Student-t (uncorrelated marginals). The student_uc target is a bivariate Student-t distribution with degrees of freedom and a fixed scale matrix with . Its density is defined through the transformation with independent univariate Student-t marginals:
The matrix is generated deterministically (seed 50) as , where . The resulting density has polynomial tails ( marginally), which stress-tests whether the variational approximation can allocate sufficient probability mass far from the mode.
Eight Gaussians. The 8_gaussians target is an equally weighted mixture of eight isotropic Gaussians arranged uniformly on a circle of radius :
with and . The well-separated modes (inter-mode distance , 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.
Table 5 collects the key parameters of each target.
Table 5: Summary of two-dimensional synthetic target densities.
| Target | Density form | Parameters | Key challenge |
|---|---|---|---|
| x_shaped | Intersecting ridges | ||
| student_uc | Heavy polynomial tails | ||
| 8_gaussians | Multi-modal coverage |
Training configuration details. SIVI, UIVI, AISIVI, and DIVI use 10,000 iterations, VI learning rate , batch size 128, and a step scheduler with decay factor 0.7 every 1,000 iterations (0.9 on 8_gaussians). Linear annealing over 5,000 steps is applied on all targets except student_uc, where annealing is disabled for these methods.
Table 6: Toy target final evaluation metrics (mean standard error). Wall-clock time is averaged across the three targets; bold indicates the best mean.
| Target | Metric | SIVI | KSIVI | AISIVI | UIVI | DIVI |
|---|---|---|---|---|---|---|
| x_shaped | 0.012 ± 0.01 | 0.054 ± 0.01 | 0.070 ± 0.02 | 0.038 ± 0.02 | 0.009 ± 0.00 | |
| W2 | 0.075 ± 0.03 | 0.222 ± 0.03 | 0.191 ± 0.03 | 0.152 ± 0.04 | 0.074 ± 0.01 | |
| student_uc | 2.676 ± 0.00 | 4.512 ± 1.79 | 2.744 ± 0.06 | 2.682 ± 0.00 | 2.677 ± 0.00 | |
| W2 |x| < 8 | 0.124 ± 0.01 | 0.749 ± 0.63 | 0.166 ± 0.05 | 0.145 ± 0.00 | 0.086 ± 0.01 | |
| 8_gaussians | 0.236 ± 0.03 | 0.830 ± 0.08 | 1127.982 ± 793.92 | 0.801 ± 0.01 | 0.355 ± 0.08 | |
| W2 |x| < 6 | 0.348 ± 0.08 | 0.569 ± 0.21 | 0.789 ± 0.24 | 0.445 ± 0.06 | 0.311 ± 0.07 | |
| Wall-clock time (s) | 266 | 377 | 387 | 803 | 244 | |
SIVI. SIVI uses 4,096 auxiliary samples from the mixing prior to approximate the semi-implicit marginal density.
AISIVI. AISIVI uses a conditional RealNVP reverse model with 8 coupling layers and hidden width 12. Before joint training, the flow is pre-trained on initial VI samples for 500 warmup epochs with learning rate and batch size 8,192. During main training, the flow uses 1,024 reverse samples, reverse learning rate , and one reverse update per VI step.
DIVI. The proxy score MLP has hidden width 64 and three hidden layers. The proxy is warm-started for 500 epochs with learning rate and batch size 8,192. During main training the proxy uses reverse batch size 2,048, reverse learning rate , and 5 updates per VI step.
KSIVI. KSIVI is trained for 50,000 iterations with batch size 128, learning rate , 25,000-step linear annealing, and a step-decay schedule with factor 0.9 every 1,000 iterations, following Cheng et al. [2024]. We use a Gaussian kernel on x_shaped and 8_gaussians, and an affine-invariant Riesz kernel on student_uc. On x_shaped, the conditional variances are initialized to the constant 1.313; the mean network uses learning rate and the variance head uses , with the same decay schedule. On student_uc, the median kernel bandwidth is detached during backpropagation, and we apply log probability regularization with coefficient 0.05 during annealing following Cheng et al. [2024].
Quantitative results. Table 6 presents the quantitative results across all five methods. DIVI obtains the lowest mean on four of the six quality metrics and the second-lowest on the remaining two, while SIVI is strongest on the Student UC and eight-Gaussian KL-style metrics. DIVI also has the lowest mean end-to-end wall-clock time. The Wasserstein-2 evaluation follows the protocol in Appendix B.2. We are observing divergence on 8_gaussians for AISIVI, as a result of drifting support. The same divergence behavior has been observed in the official code of AISIVI, indicating a potential weakness in training stability.
B.4 Conditioned diffusion process
The diffusion posterior is the 100-dimensional discretized path posterior described in Section 6.2. Reference samples are produced by SGLD with 1,000 particles, 100,000 iterations, and step size . Trace plots show posterior mean paths and marginal posterior intervals against the true latent path and noisy observations.
SIVI, UIVI, AISIVI, and DIVI are trained for 10,000 VI iterations with learning rate , batch size 128, step scheduler (decay 0.7 every 1,000 steps), and 5,000-step linear annealing. KSIVI is trained for 100,000 iterations.
AISIVI. AISIVI uses a conditional RealNVP with 16 coupling layers and hidden width 256. Before joint training, the reverse flow is pre-trained on samples from the initial variational distribution for 2,000 warmup epochs with learning rate and batch size 128. During main training, the flow uses 256 reverse samples, reverse learning rate , and one reverse update per VI step.
DIVI. The proxy score MLP has hidden width 128 and three hidden layers. The proxy is warm-started for 2,000 epochs with learning rate and batch size 8,192. During main training the proxy uses reverse batch size 2,048, reverse learning rate , and 5 updates per VI step.
KSIVI. KSIVI follows the default schedule from Cheng et al. [2024]: 100,000 iterations, 50,000-step linear annealing, Gaussian kernel, and a step-decay schedule with factor 0.9 every 10,000 iterations.
Evaluation. We evaluate using the expected log marginal likelihood defined in Appendix B.2, with 1,000 reference samples from the SGLD chain and 100,000 model samples from each trained variational distribution.
B.5 Bayesian neural-network regression
Each BNN target uses a one-hidden-layer ReLU network with 50 hidden units. The input dimensions are 13 for Boston, 8 for Concrete, 4 for Power, 9 for Protein, 11 for Wine Red, and 6 for Yacht. The datasets can be found on the UCI Machine Learning website , and all follow CC BY 4.0 License to the best of our knowledge. Including weights, biases, and two precision variables, the corresponding posterior dimensions are 751, 501, 301, 551, 651, and 401. The datasets contain 506, 1,030, 9,568, 45,730, 1,599, and 308 observations respectively. Data preparation uses a fixed random seed, a 90/10 train-test split, input standardization based on the training split, and target standardization for training labels. Test labels are evaluated on their original scale.
Common BNN protocol. All methods use batch size 128, gradient clipping at norm 1, and a 100-step MSE pretraining stage that initializes the variational sampler toward predictive weights before posterior training begins. For evaluation, we apply exponential moving averages of the VI parameters with decay 0.999, following the stabilized BNN evaluation protocol used by KSIVI and SIVI-SM [Cheng et al., 2024, Yu and Zhang, 2023]. The VI learning rate is selected separately for each method and target from by cross-validation, since high-learning-rate divergence depends on both the method and the target posterior.
AISIVI. AISIVI uses a conditional RealNVP with 16 coupling layers and hidden width 256. The reverse flow is pre-trained on initial VI samples for 500 warmup epochs with learning rate and batch size 100. During main training, the flow uses 256 reverse samples, reverse learning rate , one reverse update per VI step, and 10,000-step linear annealing.
DIVI. The proxy score MLP has hidden width 512 and four hidden layers. The proxy is warm-started for 5,000 epochs with learning rate and batch size 2,048. During main training the proxy uses 2 updates per VI step. Linear annealing over 10,000 steps is applied.
KSIVI. KSIVI is trained for 100,000 iterations without annealing, using a Gaussian kernel and log-likelihood regularization term with weight 1, with a step-decay schedule of factor 0.9 every 3,000 iterations, following Cheng et al. [2024].
Evaluation. BNN evaluation draws 2,000 posterior samples and reports test RMSE and NLL as described in Appendix B.2.
B.6 Direct score-estimation evaluation
We evaluate the marginal-score error on fixed variational models obtained after 2,000, 4,000, 6,000, 8,000, and 10,000 DIVI training steps on the X-shaped target. For each model, we generate evaluation pairs by sampling and then . Following the reverse-conditional score identity used in UIVI [Titsias and Ruiz, 2019],
we construct a reference score by sampling the reverse conditional. For each , we run 20 HMC chains initialized at the generating , with 1,000 burn-in steps and 5,000 retained samples
https://archive.ics.uci.edu/ per chain. We pool the retained samples and average their conditional Gaussian scores. The reported HMC diagnostic is . The empirical squared score-estimation error is
Every estimator is applied to the same fixed DIVI variational model at each checkpoint. SIVI uses 4,096 mixing-prior samples; UIVI uses its native posterior-HMC estimator with five burn-in transitions and five auxiliary samples; AISIVI uses 1,024 importance samples from a normalizing-flow proposal optimized for 10,000 steps separately for each fixed variational distribution; and DIVI uses its checkpointed denoising score network. Table 4 reports score error means and standard errors across five seeds. Score-evaluation time is measured for a batch of 128 over 100 synchronized calls after fitting the score network or proposal.
B.7 Discrepancy from the target score
We also evaluate the squared discrepancy between each method's estimated variational score and the analytic score of the X-shaped target throughout training. At each checkpoint, we use the variational model obtained by that method and evaluate
This diagnostic measures the joint effect of variational approximation and score estimation along each method's own training trajectory. Table 7 reports the mean and standard error across five seeds. DIVI obtains the lowest mean target-score discrepancy at every reported checkpoint.
Table 7: Squared discrepancy from the analytic X-shaped target score along each method's training trajectory (mean standard error over five seeds). Bold indicates the lowest mean.
| Method | 2K steps | 4K steps | 6K steps | 8K steps | 10K steps |
|---|---|---|---|---|---|
| SIVI | 4.479 ± 1.186 | 0.546 ± 0.306 | 0.298 ± 0.248 | 0.270 ± 0.221 | 0.190 ± 0.152 |
| UIVI | 5.062 ± 0.226 | 3.265 ± 0.676 | 3.023 ± 0.276 | 3.052 ± 0.321 | 3.040 ± 0.356 |
| AISIVI | 1704.846 ± 1662.003 | 282.647 ± 161.966 | 581.071 ± 429.919 | 100.476 ± 27.904 | 88.381 ± 38.811 |
| DIVI | 3.694 ± 0.200 | 0.411 ± 0.049 | 0.148 ± 0.028 | 0.142 ± 0.038 | 0.079 ± 0.017 |
B.8 Effect and selection of score-update steps and batch size
The number of inner score updates per outer VI update, (reverse steps), and the score batch size, (reverse batch size), control the accuracy and computational cost of score tracking. DIVI warm-starts from the preceding iteration, so each inner loop tracks the score of the current variational distribution. The main experiments use two inner updates for BNN regression and five for the toy and conditioned diffusion targets. The appropriate choice depends on dimension, network capacity, batch size, and how rapidly changes. A practical selection rule starts with a larger update count, such as , and halves it while monitoring a distributional metric such as the ELBO or Wasserstein-2 distance. The selected value balances distributional accuracy and computation. For batch-size selection, provides a starting point; larger batches can be evaluated using the same distributional metric within the available memory budget.
Tables 8 and 9 give ablations on the X-shaped target over five seeds, with the remaining training settings fixed. The first varies with ; the second varies with . Increasing the update count improves both metrics and increases runtime. Larger score batches improve both metrics with similar measured runtimes over the tested range. The main toy experiments use and .
B.9 Comparison with a RealNVP variational family
Normalizing-flow VI uses invertible transformations with tractable densities and scores. Semi-implicit VI represents complex multimodal structure through an implicit mixture. DIVI learns the marginal score of this family. As a concrete comparison, we train a four-layer RealNVP [Dinh et al., 2016]
Table 8: Effect of reverse steps on the X-shaped target with reverse batch size 2,048 (mean standard error over five seeds). Bold indicates the lowest mean quality metric.
| Reverse steps | W2 | Runtime (s) | |
|---|---|---|---|
| 1 | |||
| 2 | |||
| 5 (default) | |||
| 10 |
Table 9: Effect of reverse batch size on the X-shaped target with five reverse steps (mean standard error over five seeds). Bold indicates the lowest mean quality metric.
| Reverse batch size | W2 | Runtime (s) | |
|---|---|---|---|
| 512 | |||
| 1,024 | |||
| 2,048 (default) | |||
| 4,096 | |||
| 8,192 |
for 10,000 optimization steps with batch size 128 on the eight-Gaussian target and aggregate the results across five seeds. Table 10 reports ELBO, Wasserstein-2 distance, and parameter count. DIVI achieves a higher mean ELBO and a lower mean Wasserstein-2 distance in this benchmark with fewer parameters.
Table 10: DIVI and a four-layer RealNVP variational family on the eight-Gaussian target (mean standard error over five seeds). Bold indicates the best mean or lowest parameter count.
| Method | ELBO ↑ | W2 ↓ | Parameter count |
|---|---|---|---|
| DIVI | |||
| RealNVP |
C Numerical Validations
In this section, we provide empirical diagnostics supporting Assumption 2 and Assumption 3 through numerical experiments along the observed training trajectories.
For Assumption 2, we provide empirical diagnostics by tracking the fourth moment of scores, both for the reverse model and for the target score. We plot the mean value of the fourth moment of norms of the reverse model score as the solid line, and the minimum and maximum values as the shaded regions in Figure 3, with each of the values calculated across 10 independent seeds. The same plot for fourth moment of the target score is shown in Figure 4. The figures provide empirical evidence that there exists a uniform bound on the moment of the norm of the scores over the training trajectories, consistent with Assumption 2.
For Assumption 3, we report the calculated max for each checkpoint respectively throughout the training process, and aggregate across 10 independent seeds. We track the metrics for the toy x_shaped and Conditioned Diffusion target distribution. The results are shown in Figure 5, where the solid line indicates the mean while the shaded region demonstrates the minimum and maximum values. These diagnostics suggest that we can obtain a uniform upper bound for the expected norm's fourth moment of the VI networks' gradient, justifying Assumption 3.
We also provide empirical evidence to the alternative version of Assumption 2, as present in Appendix A.3. In Appendix A.3 we proved that Assumption 2 can be derived from another linear growth condition together with a bounded fourth-moment condition , both of which we assume to hold uniformly over . As empirical evidence, we demonstrate for three checkpoints taken at 2000, 5000 and 10000 iterations, that is bounded in Figure 6. The figure demonstrates different values for samples of drawn with uniform distribution in .

Figure 3: Fourth moment of the norm of the approximated score throughout DIVI training for x_shaped and the conditioned diffusion benchmark, aggregated over 10 seeds.

Figure 4: Fourth moment of the norm of the target score throughout DIVI training for x_shaped and the conditioned diffusion benchmark, aggregated over 10 seeds.
We also plot the moment of the VI model checkpoints using 10 different seeds and plot them along the 10 checkpoints we obtained during the DIVI training regime in Figure 7. The solid line indicates the 10-seed-average of the fourth moments, while the shaded regions indicate the minimum and maximum of recorded values. These plots together demonstrate empirical evidence to support the alternate version of Assumption 2 in Appendix A.3.

Figure 5: The expected norm's fourth moment of the VI model gradient throughout the DIVI training process for x_shaped and Conditioned Diffusion experiments, aggregated across 10 different seeds. This supports Assumption 3 that the VI model gradients are bounded.

Figure 6: over different 's, 's and 's throughout DIVI training for x_shaped and the conditioned diffusion benchmark.

Figure 7: Fourth moment of the VI model reparameterization norm throughout DIVI training for x_shaped and the conditioned diffusion benchmark, aggregated over 10 seeds.