Characterizing and Avoiding Problematic Global Optima of Variational Autoencoders

Yaniv Yacoby, Weiwei Pan, Finale Doshi-Velez

Abstract

Variational Auto-encoders (VAEs) are deep generative latent variable models consisting of a generative model $p(x|z)$ and an inference model $q(z|x)$. Recent work shows that traditional training methods tend to yield solutions that violate modeling desiderata: (1) the learned generative model captures the observed data distribution but does so while ignoring the latent codes (posterior collapse); (2) the aggregate of the learned latent codes does not match the prior $p(z)$ (prior mismatch). In this paper, we demonstrate that both issues stem from the fact that the global optima of the VAE training objective often correspond to undesirable solutions. Our analysis builds on two observations: (1) the generative model is unidentifiable and (2) bias in the VAE objective—the VAE objective may prefer generative models that explain the data poorly but have posteriors that are easy to approximate. We present a novel inference method, LiBI, mitigating these problems. On synthetic datasets, we show that LiBI can learn generative models that capture the data distribution and inference models that better satisfy modeling assumptions.

Introduction: The Bias of the ELBO

Variational Autoencoders (VAEs) are a staple of modern generative modeling, but they are notoriously finicky. Practitioners often struggle with "posterior collapse"—where the model ignores the latent variables entirely—or "prior mismatch," where the generated data looks nothing like the training set. This research argues that these aren't just bugs in optimization; they are often the global optima of the Evidence Lower Bound (ELBO) objective function itself.

The ELBO consists of a reconstruction term (MLE objective) and a regularization term (Posterior Matching objective). If the true posterior of a high-quality generative model is too complex for the chosen variational family (e.g., a diagonal Gaussian), the ELBO will favor a worse generative model that has a simpler, easier-to-approximate posterior. This "lazy" behavior leads the VAE to "cheat" by choosing a decoder that makes the encoder's job easy, often resulting in poor data representation or latent collapse.

Visualizing objective bias and distribution mismatch in VAEs.

Methods: Likelihood Before Inference (LiBI)

To address these issues, the authors introduce LiBI (Likelihood Before Inference). The core idea is to decouple generative and inference training to prevent the encoder and decoder from "colluding" on a suboptimal solution.

  • Generative Model Learning: LiBI first learns the decoder ($\theta$) and the latent codes ($z$) directly. To ensure the latents follow the desired distribution, they apply the Henze-Zirkler (HZ) test—a statistical test for multivariate normality—forcing the learned latent codes to match the Gaussian prior.
  • Inference Model Learning: Once the generative model is fixed, the encoder ($\phi$) is trained to approximate the posterior. Because the decoder is fixed, it can no longer simplify itself to accommodate a weak encoder.
  • Iterative Refinement: The process is repeated iteratively, using the learned posterior means to re-initialize latent codes, helping the model escape local minima.

Results

The researchers evaluated LiBI on four synthetic datasets: LinearJTEx, CubicJTEx, Gaussian, and Mobius. These datasets provide a "ground truth" to verify if the model recovers the true underlying structure.

LiBI significantly outperformed standard VAEs and popular variants like $\beta$-VAE and Lagging Inference Networks. As shown in the quantitative results, LiBI consistently achieves better data fit (lower S-kNN) and higher test log-likelihoods in challenging scenarios.

Quantitative comparison of LiBI against baseline VAE methods across synthetic datasets.

On the LinearJTEx dataset, LiBI achieved a Smooth $k$-NN statistic of 0.06, compared to 1.62 for a standard VAE. Furthermore, LiBI was the only method that consistently produced an aggregated posterior matching the Gaussian prior, whereas other methods showed significant mismatch or collapse.

Conclusion

The study demonstrates that the failures of VAEs are often rooted in the objective function's bias toward simple posteriors. By decoupling the learning of the likelihood from the inference network, LiBI provides a more robust framework for generative modeling. While challenges remain regarding scalability to massive datasets and the definition of task-specific desiderata, LiBI offers a promising path toward more reliable latent variable models.

Summary updated

BibTeX
@inproceedings{yacoby2019characterizing,
  author = {Yaniv Yacoby and Weiwei Pan and Finale Doshi-Velez},
  title = {{Characterizing and Avoiding Problematic Global Optima of Variational Autoencoders}},
  booktitle = {AABI},
  year = {2019},
  url = {https://openreview.net/forum?id=xXwM6yZyGR},
}
Figure