Training latent variable models with discrete components is notoriously difficult because gradient estimates often suffer from massive variance. This paper introduces OVIS (Optimal Variance – Importance Sampling), a new gradient estimator that flips a known limitation of Importance Weighted Autoencoders (IWAE) on its head: instead of the Signal-to-Noise Ratio (SNR) getting worse as you add more samples, OVIS ensures the SNR actually improves at a rate of $\sqrt{K}$.
The Challenge of Discrete Latent Variables
In deep learning, we often use latent variable models to capture complex data distributions. To train these, we need gradients. If our model uses continuous variables, we use the "reparameterization trick" (the magic behind VAEs) to get low-variance gradients. However, if the model uses discrete variables (like categories or binary switches), that trick doesn't work.
Instead, we rely on the "score function" estimator (also known as REINFORCE). The problem? It has notoriously high variance. Researchers previously found that for the Importance Weighted Autoencoder (IWAE)—a popular way to get tighter bounds on model performance—increasing the number of samples ($K$) actually makes the gradient noisier, causing the SNR to vanish. This paper aims to fix that "vanishing SNR" problem by designing a mathematically optimal way to reduce variance.
OVIS: Optimal Variance – Importance Sampling
The authors derive OVIS, a novel score function estimator equipped with an optimal control variate. A control variate is essentially a "baseline" subtracted from the gradient estimate to reduce noise without introducing bias.
Key technical contributions include:
- Optimal Control Variate Derivation: They analytically find the control variate that minimizes the trace of the gradient's covariance matrix.
- Practical Approximations: Since the "perfect" control variate is computationally expensive, they propose two practical versions:
- $\text{OVIS}_{MC}$: Uses a few extra Monte Carlo samples to estimate the control variate.
- $\text{OVIS}_{\sim}$: A "sample-free" version that uses analytical approximations based on whether the importance weights are concentrated (low Effective Sample Size) or spread out (high Effective Sample Size).
- Integration with Rényi Bounds: They suggest using the Importance Weighted Rényi (IWR) bound, which allows for a smoother trade-off between the tightness of the bound and the stability of the gradients.
Key Insights
- The SNR Flip: The most striking insight is that the "SNR decay" in IWAE isn't an inherent flaw of the objective, but a flaw in standard estimators like VIMCO. With OVIS, the SNR grows as $\sqrt{K}$, meaning more samples actually lead to better gradients.
- Variance vs. Bias: While $\text{OVIS}_{MC}$ is unbiased, the authors show that a slightly biased version ($\text{OVIS}_{\sim}$ with $\gamma=1$) can perform significantly better in practice when the effective sample size is low, preventing the model from getting stuck in poor local optima.
- Independence is Key: The derivation relies on exploiting the mutual independence of importance samples to cancel out high-variance terms that don't contribute to the expected gradient.
Key Results
OVIS consistently outperformed state-of-the-art reparameterization-free estimators like VIMCO, Reweighted Wake-Sleep (RWS), and the Thermodynamic Variational Objective (TVO) across several benchmarks, including synthetic Gaussian models, Gaussian Mixture Models (GMM), and Binarized MNIST.
Asymptotic Behavior: OVIS is the only estimator where the SNR increases with the number of particles ($K$), while standard pathwise and VIMCO estimators see their SNR drop.
Posterior Accuracy: In GMM experiments, OVIS achieved the lowest $L_2$ distance to the true posterior, showing it learns much more accurate inference networks.
Deep Models: On Sigmoid Belief Networks trained on Binarized MNIST, OVIS gained roughly +1.0 nats over VIMCO when using few samples ($K=5$) and remained competitive or superior as $K$ increased.
Limitations and Future Work
- Hyperparameter Tuning: The $\text{OVIS}_{\sim}$ estimator introduces a parameter $\gamma$ to interpolate between low and high effective sample size regimes. While the authors tested $\gamma=0$ and $\gamma=1$, they note that dynamically tuning this parameter could yield even better results.
- Computational Cost: $\text{OVIS}_{MC}$ requires $S$ auxiliary samples. While they show this can be optimized to $O(K+S)$ complexity, it still represents a slight overhead compared to simpler estimators.
- Posterior Collapse: Like many IWAE-based methods, OVIS can still suffer from posterior collapse at very high $K$ values, though the authors mitigate this using the Rényi (IWR) objective.
Summary updated