NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

VAE with a VampPrior

Jakub M. Tomczak, Max Welling

Abstract

Standard Variational Auto-Encoders (VAEs) often suffer from the "inactive stochastic units" problem, where the KL divergence term in the Evidence Lower Bound (ELBO) forces the encoder to ignore latent dimensions in favor of a simplistic Gaussian prior. We present the VampPrior (Variational Mixture of Posteriors), which replaces the standard Normal prior with a mixture of the model's own posteriors conditioned on learnable "pseudo-inputs." This coupling ensures the prior evolves with the encoder, preventing latent collapse and significantly improving generative performance across multiple benchmarks.

Introduction: The Gaussian Bottleneck

In the standard VAE framework, the objective is to maximize the ELBO, composed of a reconstruction term and a regularization term (the KL divergence). The KL term encourages the variational posterior $q(z|x)$ to match a prior $p(z)$, typically a standard Normal distribution $\mathcal{N}(0, I)$.

However, this "boring" Gaussian prior often acts as an over-zealous regulator. If the prior lacks sufficient complexity to represent the data manifold, the model may "shut down" latent dimensions entirely to minimize the KL penalty. This results in blurry generations and a latent space that fails to capture the true diversity of the training data.

The VampPrior Method

The authors propose the VampPrior, defined as a mixture of $K$ components where each component is the variational posterior evaluated at a learnable "pseudo-input" $u_k$:

$$p(z) = \frac{1}{K} \sum_{k=1}^{K} q(z|u_k)$$

Key Innovations:

  1. Learnable Pseudo-inputs: The $u_k$ are $d$-dimensional parameters optimized via backpropagation alongside the network weights. They act as "prototypes" or templates for the latent space.
  2. Prior-Posterior Coupling: Because the prior is constructed from the encoder itself, the two components are coupled. As the encoder learns better representations, the prior automatically adapts to provide a more flexible and accurate target.
  3. Hierarchical Extension: The method naturally extends to multi-layer Hierarchical VAEs (HVAEs). By applying the VampPrior to the top-level latent variables, the model maintains high expressivity even in deep architectures where units typically "die" in upper layers.

Experimental Results

The VampPrior was evaluated on six standard image benchmarks, including MNIST, OMNIGLOT, and Caltech 101 Silhouettes.

Performance and Scalability

As shown in Figure 5, the VampPrior significantly outperforms both the standard Gaussian (SG) prior and a standard Mixture of Gaussians (MoG) prior in terms of the ELBO. Notably, the performance is robust to the number of pseudo-inputs $K$, with even a moderate number of components providing a substantial boost over traditional methods.

ELBO performance of HVAE with different priors as a function of the number of pseudo-inputs K.

Solving the Inactive Units Problem

A critical advantage of the VampPrior is its ability to keep latent units active. In a standard VAE, many dimensions of $z$ become constant (inactive). The VampPrior acts as an "anchor," allowing the model to distribute different data modalities across the latent space without incurring a heavy KL penalty.

Comparison of the number of active units across different models. The VampPrior maintains significantly more active units, particularly in the second latent layer (z2), compared to VAE and IWAE.

On static MNIST, the VampPrior increased the number of active units in the second layer by four times compared to a standard VAE. Qualitatively, this leads to sharper, more diverse image samples that avoid the "average" blurriness typical of standard VAEs.

Conclusion

The VampPrior offers a simple yet powerful modification to the VAE framework. By coupling the prior to the variational posterior through learnable pseudo-inputs, it effectively bypasses the limitations of Gaussian priors. Future work may explore the application of VampPriors in sequential domains like text and audio, or combine them with advanced architectures like Normalizing Flows to further enhance generative modeling.

Summary updated

BibTeX
@inproceedings{tomczak2018vae,
  author = {Jakub M. Tomczak and Max Welling},
  title = {{VAE with a VampPrior}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2018},
}
Figure