MAE: Mutual Posterior-Divergence Regularization for Variational AutoEncoders

Xuezhe Ma, Chunting Zhou, Eduard H. Hovy

The Problem: KL Vanishing in VAEs

The "holy grail" of generative modeling is to simultaneously estimate the data distribution (to generate realistic samples) and learn meaningful, disentangled representations (to understand the underlying "factors" of the data). Variational Autoencoders (VAEs) are a popular tool for this, but they suffer from a notorious Achilles' heel known as KL Vanishing.

When a VAE is equipped with a highly expressive decoder, such as an auto-regressive PixelCNN, the model often finds a "shortcut." It realizes it can model the data perfectly using just the decoder's power, entirely ignoring the latent variables provided by the encoder. In these cases, the KL divergence term in the objective function drops to zero, the latent space becomes uninformative noise, and the model essentially collapses into a standard auto-regressive model.

This paper introduces Mutual Posterior-Divergence Regularization (MAE), a novel method designed to force the model to use its latent space effectively without sacrificing the quality of the generated data.

Methods: Shaping the Latent Geometry

To combat KL vanishing, the authors introduce the MAE regularization framework. Instead of relying solely on the standard Evidence Lower Bound (ELBO), they add two data-dependent terms to the objective function to explicitly control the geometry of the latent space:

  1. Mutual Posterior Diversity ($L_{diverse}$): This term encourages the variational posteriors $q(z|x)$ for different data points to be as distinct from each other as possible. By maximizing the KL-divergence between pairs of posteriors, the model is discouraged from mapping all inputs to the same "safe" overlapping spot in the latent space.
  2. Smoothness Regularization ($L_{smooth}$): Diversity alone is insufficient, as latent codes scattered randomly are not useful. This term minimizes the standard deviation of the pairwise KL-divergences, encouraging the posteriors to spread out smoothly and evenly across the latent space.
Conceptual illustration of latent space geometry. (a) shows clumped posteriors, while (b) demonstrates the diverse and smooth distribution encouraged by MAE.

The "Aha!" Connection: The authors provide a theoretical proof showing that their diversity measure is actually a symmetric version of the Mutual Information between the data and the latent variables. Unlike previous methods that require complex adversarial training or Maximum-Mean Discrepancy (MMD) to maximize mutual information, MAE provides a proxy that is computationally efficient and easy to calculate using Monte Carlo sampling in mini-batches.

Key Insights

  • Geometry Matters: Rather than just tweaking the objective function's weights, MAE explicitly shapes the geometry of the latent space. It treats the latent space as a landscape that should be varied yet organized.
  • The Decoder Trade-off: The paper demonstrates that you do not have to weaken your decoder to get good representations. By using MAE, you can keep a powerful PixelCNN decoder and still achieve a highly informative latent space.

Key Results

The model was evaluated on standard image benchmarks, including MNIST (binarized hand-written digits), OMNIGLOT (characters from 50 different alphabets), and CIFAR-10 (natural color images).

  • Density Estimation: MAE achieved state-of-the-art negative log-likelihood (NLL) results on MNIST (77.98) and OMNIGLOT (89.09), outperforming the standard Variational Lossy Autoencoder (VLAE).
  • Unsupervised Clustering: On MNIST, MAE's latent representations proved far superior for clustering. Using K-Means (K=10), MAE achieved 91.2% accuracy, compared to only 68.1% for the base VLAE.
  • Semi-supervised Learning: When only 100 labeled examples were available, a simple classifier trained on MAE's features achieved 91.9% accuracy, significantly higher than the 84.9% achieved by VLAE.
  • Visualizations: t-SNE plots of the latent space show that MAE creates much cleaner, more distinct clusters for different classes compared to standard models, where classes often overlap or collapse.
Generated samples from the MAE model on MNIST (left) and OMNIGLOT (right) datasets.

Limitations and Future Work

While MAE offers significant improvements, it does introduce two new hyperparameters ($\eta$ and $\gamma$). Although the authors found them relatively easy to tune, this adds another layer of complexity to the training process. Additionally, while MAE improved results on CIFAR-10 compared to its direct baseline, it still slightly trails the very best specialized auto-regressive models (like PixelSNAIL) in pure density estimation (2.95 bits/dim vs 2.85).

The authors suggest that the most promising future direction is applying MAE to text generation, where KL vanishing is an even more severe problem due to the immense strength of LSTM and Transformer decoders.

Summary updated

BibTeX
@inproceedings{ma2019mae,
  author = {Xuezhe Ma and Chunting Zhou and Eduard H. Hovy},
  title = {{MAE: Mutual Posterior-Divergence Regularization for Variational AutoEncoders}},
  booktitle = {International Conference on Learning Representations},
  year = {2019},
  url = {https://openreview.net/forum?id=ZmkV7RST7aO},
}
Figure