A Surprisingly Effective Fix for Deep Latent Variable Modeling of Text

Bohan Li, Junxian He, Graham Neubig, Taylor Berg-Kirkpatrick, Yiming Yang

Abstract: Bohan Li, Junxian He, Graham Neubig, Taylor Berg-Kirkpatrick, Yiming Yang. Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP).

2019.

Introduction

Variational Autoencoders (VAEs) are powerful tools for learning compressed, meaningful representations ($z$) of data ($x$). However, in the domain of natural language processing, VAEs frequently suffer from a phenomenon known as posterior collapse. When using high-capacity decoders like LSTMs, the model often finds a "lazy" local optimum where it ignores the latent variables entirely, relying solely on the autoregressive properties of the decoder. In these cases, the KL divergence term drops to zero, and the encoder fails to provide useful information for reconstruction.

This paper proposes a simple yet remarkably effective strategy to mitigate this issue by combining two existing heuristics: autoencoder pretraining and a "free bits" objective.

Methodology

The authors' approach relies on the synergy of two primary components:

  1. Autoencoder Pretraining: The encoder and decoder are initially trained as a standard deterministic autoencoder (AE). This ensures the encoder is capable of extracting salient features before the stochastic constraints of the VAE objective are introduced.
  2. KL Thresholding ("Free Bits"): Instead of minimizing KL divergence to zero, a hinge loss is employed to only penalize the KL term if it exceeds a target threshold ($\lambda$). This prevents the model from discarding useful latent information simply to satisfy the objective function.
  3. Linear Annealing: These methods are integrated with a linear schedule that gradually increases the KL term's weight during the initial training epochs.

The core insight is that pretraining provides a useful initialization in the optimization landscape, while the Free Bits objective prevents the training process from collapsing back into a "lazy" decoder-only solution.

Experimental Results

The proposed method was evaluated across several benchmarks, including Penn Treebank (PTB), Yahoo Answers, SNLI, and Yelp Sentiment.

Table 1: Performance comparison on PTB and Yahoo datasets across various metrics.

As shown in the results, the method consistently outperforms standard VAEs and other common mitigation strategies like cyclic annealing or aggressive training. On the PTB dataset, the model achieved a Perplexity (PPL) of 96.17, surpassing both the standard VAE (101.39) and a standard LSTM language model (100.47). Similar gains were observed in reconstruction loss on the Yahoo dataset, dropping from ~329 to ~315.

Key Insights and the ELBO Paradox

A significant finding of this research is the ELBO Paradox: the proposed method often results in a worse Evidence Lower Bound (ELBO) while simultaneously achieving better Perplexity and Reconstruction. This suggests that for text-based VAEs, ELBO may be a poor proxy for actual model quality.

Furthermore, the method significantly improves the utilization of the latent space. While standard VAEs often collapse to zero active units (AU), the proposed method consistently utilizes all available latent dimensions (e.g., 32 out of 32).

Table 2: Pearson Correlation Coefficient (PCC) between latent space distance and edit distance, indicating latent smoothness.

The quality of the learned representations is also superior. As seen in the Pearson Correlation Coefficient (PCC) metrics, the proposed model shows a much higher correlation between latent space distance and text edit distance, indicating a smoother and more semantically logical latent space. In downstream tasks like Yelp sentiment classification, representations learned with this method using only 100 labeled examples outperformed a standard VAE trained with 10,000 labels.

Conclusion

By combining autoencoder pretraining with a Free Bits objective, the authors provide a robust solution to posterior collapse in text VAEs. The resulting models not only serve as better language models but also learn highly informative latent representations that are useful for a variety of downstream tasks. The work highlights the need to look beyond ELBO when evaluating deep latent variable models for text.

Summary updated

BibTeX
@inproceedings{li2019surprisingly,
  author = {Bohan Li and Junxian He and Graham Neubig and Taylor Berg-Kirkpatrick and Yiming Yang},
  title = {{A Surprisingly Effective Fix for Deep Latent Variable Modeling of Text}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2019},
  url = {https://openreview.net/forum?id=Ru1pbRE2rP2},
}
Figure