Generalizing Variational Autoencoders with Hierarchical Empirical Bayes

Wei Cheng, Gregory Darnell, Sohini Ramachandran, Lorin CrawfordarXiv 2020

Introduction

Variational Autoencoders (VAEs) have established themselves as a cornerstone of generative modeling, offering a principled probabilistic framework and stable training dynamics. However, they are frequently hampered by "posterior collapse," a phenomenon where the regularization term (KL divergence) dominates the reconstruction loss. This leads the encoder to ignore input data, outputting a distribution that matches the prior but lacks meaningful information.

While alternatives like Wasserstein Autoencoders (WAEs) mitigate this by matching the aggregated posterior to the prior, they often sacrifice the probabilistic nature of the latent space. This trade-off typically results in less smooth latent manifolds and lower-quality generated samples. This paper introduces the Hierarchical Empirical Bayes Autoencoder (HEBAE), a novel architecture designed to retain the benefits of VAEs while effectively eliminating posterior collapse.

Methodology

HEBAE bridges the gap between VAEs and WAEs through a hierarchical Bayesian approach. Its architecture is defined by several key innovations:

  1. Hierarchical Prior: Rather than imposing a fixed standard normal prior on every individual encoding, HEBAE utilizes a hierarchical prior. It assumes a Gaussian process prior over the encoder function itself, allowing for more flexible regularization.
  2. Aggregated Posterior Matching: Drawing inspiration from WAEs, HEBAE minimizes the divergence between the aggregated mean of the encodings and the target prior. This shift from point-wise to distribution-wide regularization prevents the over-penalization of individual samples.
  3. General Covariance Structure: Unlike standard VAEs that assume independent latent variables, HEBAE models a general covariance structure ($\Sigma$). This covariance is estimated from training mini-batches using an empirical Bayes approach, encouraging true feature independence through learned dynamics rather than rigid assumptions.
  4. Adaptive Variance: By regularizing the aggregated mean, HEBAE allows sample-specific variances to be determined by the reconstruction requirements. This decoupling resolves the gradient conflict between reconstruction and regularization that plagues standard VAEs.

Experimental Setup

The performance of HEBAE was evaluated against baseline VAE and WAE models using two benchmark datasets:

  • MNIST: A dataset of 70,000 handwritten digits used to assess convergence and basic generative capabilities.
  • CelebA: A large-scale dataset of over 200,000 celebrity face images, providing a more complex testbed for high-dimensional feature generation and image quality.

Results and Discussion

Quantitative Performance and Robustness

HEBAE demonstrates significant improvements in both generation quality and training stability. On the CelebA dataset, HEBAE achieved a Fréchet Inception Distance (FID) of 46, notably better than the VAE (60) and WAE (54).

Furthermore, HEBAE exhibits remarkable robustness to hyperparameter tuning. While VAE performance is highly sensitive to the weight of the KL divergence term ($\lambda$), HEBAE maintains high performance across a broad range of $\lambda$ values. In terms of convergence, HEBAE consistently reaches higher Evidence Lower Bound (ELBO) values faster than VAEs across various latent dimensions.

Quantitative performance comparison including ELBO convergence, FID scores across hyperparameter λ, and best FID results.

Qualitative Analysis

Visual inspection of the generated samples confirms the quantitative findings. HEBAE successfully occupies the "Goldilocks Zone" of generative modeling: it produces images with the sharpness associated with WAEs while maintaining the smooth latent space transitions characteristic of VAEs.

Qualitative comparison of test interpolation, random samples, and test reconstruction across VAE, WAE, and HEBAE models on CelebA.

The model also effectively preserves mutual information between the input and latent code. While WAEs maximize this information at the cost of generative smoothness, HEBAE maintains a balance that allows for high-fidelity reconstruction without sacrificing the ability to sample new, realistic data points.

Conclusion

The Hierarchical Empirical Bayes Autoencoder (HEBAE) offers a robust solution to the long-standing problem of posterior collapse in VAEs. By integrating hierarchical priors with aggregated posterior matching, it achieves superior image quality and hyperparameter robustness. While GANs currently maintain an edge in pure image fidelity, HEBAE represents a significant step forward for autoencoder-based generative models, with potential applications extending into natural language processing and synthetic data generation for sensitive domains like genomics.

Summary updated

BibTeX
@misc{cheng2020generalizing,
  author = {Wei Cheng and Gregory Darnell and Sohini Ramachandran and Lorin Crawford},
  title = {{Generalizing Variational Autoencoders with Hierarchical Empirical Bayes}},
  year = {2020},
  eprint = {2007.10389},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2007.10389},
}
Figure