Zero-Variance Gradients for Variational Autoencoders

Zilei Shao, Anji Liu, Guy Van den Broeck · DOI

Abstract

Variational Autoencoders (VAEs) typically rely on stochastic sampling to estimate gradients, introducing significant noise that can hinder training and lead to "posterior collapse." This paper introduces Silent Gradients, a method that eliminates estimator variance by utilizing a specialized linear decoder to compute the training signal analytically. By combining this stable signal with a standard nonlinear decoder, the proposed architecture achieves faster convergence and improved reconstruction across multiple benchmarks.

Introduction

At the heart of every Variational Autoencoder is a contradiction: the goal is to learn a smooth, continuous latent space, but training requires "sampling" from that space. This sampling process is inherently stochastic, introducing estimation variance. Even with popular workarounds like the "reparameterization trick" or Gumbel-Softmax, the gradients remain noisy, slowing down training and often causing the model to ignore the latent space entirely because the signal-to-noise ratio is too low.

Methods: The Silent Gradient Architecture

The authors propose a fundamentally different path: bypassing sampling entirely during the early stages of training. The core innovation is a dual-decoder strategy that provides a stable "tutor" signal to the encoder.

Dual-Decoder Strategy

The model utilizes a shared encoder but two distinct decoders:

  1. Linear Decoder: By restricting the decoder to a linear architecture, the expected Evidence Lower Bound (ELBO) can be computed mathematically in closed form. This provides a "Silent Gradient"—a perfectly stable signal derived directly from the latent distribution's parameters without drawing a random sample.
  2. Nonlinear Decoder: A standard neural network that provides the "Noisy Gradient" necessary for capturing fine-grained, expressive details in complex data.
Figure 1: The Silent Gradients architecture featuring a dual-decoder strategy to balance stability and expressivity.

Training Dynamics

During training, the model follows an annealing schedule. It starts by listening primarily to the Silent Gradients to "sketch" the latent manifold. As training progresses, it gradually transitions to the standard stochastic gradients of the nonlinear decoder to capture high-resolution details.

Analysis of Gradient Variance

A key insight of this work is the decomposition of gradient noise. In standard VAEs, estimator variance (noise from sampling) can account for over 90% of the total gradient noise. Silent Gradients reduce this specific component to exactly 0%, providing a clean signal that encourages the encoder to utilize the latent space effectively.

Figure 2: Comparison of gradient variance across different methods. Silent Gradients achieve zero estimator variance (Est Var) across all epochs.

Key Results

The method was evaluated on MNIST, CIFAR-10, and ImageNet, consistently outperforming established baselines:

  • Faster Convergence: On MNIST, Silent Gradients reached performance milestones in 45 epochs that standard reparameterization took 90 epochs to achieve—a 2x speedup in learning efficiency.
  • Improved Performance: Across all datasets, adding Silent Gradients consistently lowered the Bits Per Dimension (BPD) and Mean Squared Error (MSE) compared to standalone estimators like Gumbel-Softmax or REINFORCE.
  • Mitigating Posterior Collapse: By providing a cleaner signal, Silent Gradients encourage higher KL Divergence scores, meaning the latent representations are more informative and less likely to collapse into useless noise.

Conclusion and Future Work

Silent Gradients offer a promising solution to the variance problem in VAE training. While the current method relies on a linear proxy to remain mathematically tractable, the results demonstrate that even a simplified stable signal can significantly improve the training of complex generative models. Future work may explore integrating more complex tractable models, such as Probabilistic Circuits, to allow for exact expectation computations without the linearity constraint.

Summary updated

BibTeX
@inproceedings{shao2025zero,
  author = {Zilei Shao and Anji Liu and Guy Van den Broeck},
  title = {{Zero-Variance Gradients for Variational Autoencoders}},
  booktitle = {SPIGM @ NeurIPS},
  year = {2025},
  url = {https://openreview.net/forum?id=Yy7jmORpg3},
}
Figure