Abstract
Learning latent variable models with stochastic variational inference is challenging when the approximate posterior is far from the true posterior, due to high variance in the gradient estimates. Variational Rejection Sampling (VRS) introduces a "soft" rejection sampling step into stochastic variational inference, allowing the approximate posterior to better match the true posterior. By discarding samples with low likelihoods, VRS provides a tunable "knob" to trade off extra computation for higher statistical accuracy, outperforming state-of-the-art methods on generative modeling tasks.
Introduction
In latent variable models, Variational Inference (VI) is typically used to approximate an intractable true posterior $p(z|x)$ with a simpler distribution $q_\phi(z|x)$, known as the recognition model. However, a fundamental "variational gap" often exists when the recognition model is too simple to capture the complexity of the true posterior. This mismatch leads to biased learning and high variance in gradient estimates, making convergence difficult. While multi-sample methods like IWAE or VIMCO help tighten the Evidence Lower Bound (ELBO), they still rely on a fixed number of samples from a potentially poor proposal. VRS seeks to dynamically refine these samples to bridge this gap.
Methods
Variational Rejection Sampling (VRS) modifies the sampling procedure by introducing a resampled proposal distribution $r(z|x, T)$. The process follows a two-step "soft" rejection sampling approach: first, a sample $z$ is proposed from the recognition model $q_\phi(z|x)$; then, it is accepted with a probability $a(z)$ based on its fit to the generative model $p(x, z)$.
To make this work for deep learning, the authors introduce two key innovations:
- Differentiable Acceptance: Standard rejection sampling uses a hard "if" statement, which breaks gradients. VRS uses a "soft" acceptance function based on the softplus function, allowing the entire process to remain differentiable.
- Resampled ELBO (R-ELBO): Because the resampled distribution is unnormalized, the standard ELBO does not apply. The authors derive the R-ELBO and a novel gradient estimator that uses the covariance between samples and acceptance probabilities to provide unbiased updates.
A critical parameter is the threshold $T$, which acts as a "knob": as $T \to \infty$, the method recovers standard VI; as $T \to -\infty$, it performs exact rejection sampling, matching the true posterior perfectly at a higher computational cost.
Experiments and Results
The authors evaluated VRS on a diagnostic 2D discrete distribution and the Binarized MNIST benchmark using Sigmoid Belief Networks (SBNs).
Posterior Refinement
As illustrated in the diagnostic experiment (Figure 6), lowering the threshold $T$ allows the approximate distribution to "mold" itself to complex, multi-modal targets. This effectively "boosts" a simple recognition model into a much more expressive one without requiring a more complex neural architecture. Furthermore, VRS provides a cleaner gradient signal than alternatives like VIMCO, which can be dominated by noise.
Performance on MNIST
VRS achieved significant improvements in marginal log-likelihood on MNIST, outperforming state-of-the-art single-sample methods by 3.71 nats and multi-sample alternatives by 0.21 nats on average. Notably, VRS demonstrated high efficiency, often surpassing multi-sample methods that used significantly more samples ($k=50$) even when operating with low computational overhead.
Conclusion
VRS offers a flexible framework for improving variational inference by dynamically refining posterior samples. By providing a cleaner gradient signal and monotonic improvements in approximation error, it addresses the fundamental limitations of standard VI. Future work includes scaling the method to high-dimensional continuous latent spaces and exploiting model structure for more efficient intermediate resampling.
Summary updated