Abstract: Stochastic optimization techniques are fundamental to variational inference, typically relying on independent Monte Carlo samples to estimate gradients. However, these estimates often suffer from high variance, leading to unstable training. This paper introduces a method to make antithetic sampling—a classic variance reduction technique—fully differentiable. By generating correlated samples that better represent the underlying distribution and enabling backpropagation through the sampling process, the proposed approach significantly improves the performance of Variational Autoencoders (VAEs), particularly in high-dimensional latent spaces and low-sample regimes.
Introduction
Training deep generative models like Variational Autoencoders (VAEs) relies on Stochastic Variational Inference (SVI). At its heart, SVI uses Monte Carlo (MC) sampling to estimate gradients of the Evidence Lower Bound (ELBO). While these estimates are unbiased, they often suffer from high variance. A single "unlucky" sample from the tail of a distribution can wildly skew the gradient estimate, leading to slow convergence or unstable training.
The standard solution is to increase the number of samples, but this is computationally expensive. This research addresses a core question: With a fixed computational budget, can we choose better samples? Instead of drawing independent, identically distributed (i.i.d.) samples, the authors explore using correlated samples that are more representative of the true distribution's moments, such as mean and variance.
Methodology: Differentiable Antithetic Sampler
The core contribution is a differentiable antithetic sampler. While antithetic sampling is a well-known statistical tool, making it compatible with modern gradient-based optimization (backpropagation) is non-trivial.
The proposed method utilizes a geometric approach to generate a set of $k$ samples that exactly match a target sample mean and variance. Geometrically, this involves intersecting a hyperplane (mean constraint) with a sphere (variance constraint). To ensure the samples are still marginally distributed correctly, the authors use the inverse Cumulative Distribution Function (CDF) to find "opposite" moments.
Because the inverse CDF of a Chi-squared distribution (needed for variance) lacks a simple closed form, the authors employ the Hawkins-Wixley transform. This provides a differentiable approximation, allowing the model to backpropagate through the entire sampling operation. This differentiability is the "secret sauce": it allows the encoder to "know" about the sampling strategy and adjust the posterior parameters to be more diverse and representative.
Experimental Results
The authors evaluated their "AntiVAE" across seven diverse image datasets, including MNIST, FashionMNIST, OMNIGLOT, and Histopathology patches.
Performance and Efficiency
AntiVAE consistently outperformed standard VAEs in terms of test log-likelihood. On datasets like FashionMNIST and Histopathology, the improvement was as large as 25-30 log units. The advantage of this method is most pronounced when the number of samples ($k$) is small. As $k \to \infty$, i.i.d. sampling eventually catches up, but for practical, low-budget settings, AntiVAE is significantly superior. Furthermore, the computational overhead is minimal, with only a negligible increase in wall-clock time (approx. 0.004 seconds per step).
The Impact of Dimensionality
As the dimensionality of the latent space ($d$) increases, the volume of the space grows exponentially, making i.i.d. samples increasingly likely to miss important regions. The authors found that the relative benefit of antithetic sampling actually increases with $d$, as shown in the quantitative analysis below.
Discussion and Future Work
While the use of the Hawkins-Wixley transform introduces a small amount of bias, it did not negatively impact performance in practice. Future research could explore perfectly unbiased, differentiable inverse CDFs or higher-order moment matching to further reduce variance. Additionally, this differentiable sampling framework could be highly effective in Reinforcement Learning, where high-variance gradient estimates (e.g., in policy gradients) are a notorious bottleneck.
Summary updated