Stochastic Wasserstein Autoencoder for Probabilistic Sentence Generation

Hareesh Bahuleyan, Lili Mou, Hao Zhou, Olga Vechtomova · DOI

Introduction

Variational Autoencoders (VAEs) are a cornerstone of generative modeling, yet they have historically struggled with text data. This paper, presented at NAACL-HLT 2019, introduces the Stochastic Wasserstein Autoencoder (WAE) as a robust solution to the "KL collapse" problem that plagues traditional VAEs in Natural Language Processing.

The Problem: KL Collapse

In NLP, VAEs often suffer from KL collapse, where the model ignores the latent variables and the decoder functions as a simple language model. This happens because the VAE objective forces the latent distribution of every individual sentence to match a prior (e.g., a Gaussian). To avoid this, researchers typically use "engineering hacks" like KL annealing or word dropout, which are difficult to tune and often result in a trade-off between reconstruction quality and latent space diversity.

Methods: From VAE to Stochastic WAE

The authors propose moving away from the standard VAE framework toward the Wasserstein Autoencoder (WAE), which offers a different regularization strategy.

Aggregated Posterior and MMD

Instead of regularizing individual data points, the WAE ensures that the aggregated posterior—the average distribution of all encoded sentences—matches the prior. This is measured using Maximum Mean Discrepancy (MMD). This approach allows the model to achieve high reconstruction quality while maintaining a globally smooth latent space.

The Stochastic Twist (WAE-S)

The authors theoretically demonstrate that a standard WAE encoder tends to become deterministic during training. While deterministic encoders are excellent for reconstruction, they lack the probabilistic nature required for diverse sampling. To address this, they introduce the Stochastic WAE (WAE-S), which adds a lightweight auxiliary KL penalty to maintain encoder variance.

Comparison of latent space regularization across DAE, VAE, WAE, and the proposed WAE-S.

Key Results

The WAE-S demonstrates a significant performance leap over traditional VAEs across multiple benchmarks:

  • Superior Reconstruction: On the SNLI dataset, WAE-S achieved a BLEU score of 82.01, more than doubling the VAE’s score of 43.18. This indicates that the model is far more effective at preserving input information.
  • Enhanced Diversity: In dialogue generation tasks (DailyDialog), WAE-S outperformed both deterministic models and VAEs in diversity metrics (Dist-1 and Dist-2), generating more varied and contextually relevant responses.
  • Operational Simplicity: Unlike VAEs, WAE-S does not require complex annealing schedules or word dropout, making it significantly easier to implement and train.

Conclusion

The Stochastic Wasserstein Autoencoder provides a principled way to train generative models for text without the fragility of standard VAEs. By regularizing the aggregated posterior and preserving encoder stochasticity, it breaks the long-standing trade-off between reconstruction accuracy and generative diversity.

Summary updated

BibTeX
@inproceedings{bahuleyan2019stochastic,
  author = {Hareesh Bahuleyan and Lili Mou and Hao Zhou and Olga Vechtomova},
  title = {{Stochastic Wasserstein Autoencoder for Probabilistic Sentence Generation}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2019},
  doi = {10.18653/v1/n19-1411},
}
Figure