NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Topic-Guided Variational Auto-Encoder for Text Generation

Wenlin Wang, Zhe Gan, Hongteng Xu, Ruiyi Zhang, Guoyin Wang, Dinghan Shen, Changyou Chen, Lawrence Carin

Introduction

Variational Autoencoders (VAEs) are a popular choice for text generation due to their ability to learn meaningful latent representations. However, they typically rely on a simple Gaussian prior, which fails to capture the diverse topical structure of natural language. Furthermore, VAEs often suffer from "posterior collapse," where a powerful decoder ignores the latent variables entirely. This paper introduces the Topic-Guided Variational Autoencoder (TGVAE), which utilizes a Gaussian Mixture Model (GMM) prior guided by a neural topic module and employs Householder flows to ensure the latent space remains informative.

Methodology

The TGVAE architecture integrates two primary components: a Neural Topic Model (NTM) and a Neural Sequence Model (NSM).

The TGVAE architecture showing the Neural Sequence Model (NSM) and Neural Topic Model (NTM) components, including the extension to text summarization.

Neural Topic Model (NTM)

The NTM discovers latent topics from a bag-of-words representation of the input text. It outputs a topic distribution that serves as the basis for the mixture components in the VAE's prior.

Topic-Guided GMM Prior

Instead of a single Gaussian, the TGVAE uses a GMM prior where each component corresponds to a specific topic. This structure allows the model to generate text that is semantically aligned with a chosen topic, providing a mechanism for controllable generation.

Householder Flows

To combat posterior collapse, the model applies Householder flows—a sequence of invertible, volume-preserving transformations. These flows transform the simple approximate posterior into a more flexible, multi-modal distribution. This increased complexity prevents the decoder from collapsing the latent space, ensuring that the generated text is conditioned on the latent code.

Experiments

The model was evaluated on two tasks:

  1. Unconditional Text Generation: Tested on the APNEWS, IMDB, and BNC datasets to measure perplexity and generation quality.
  2. Abstractive Summarization: Evaluated on GIGAWORDS and DUC-2004 to assess the model's ability to perform conditional generation guided by topics.

Results

The TGVAE demonstrated superior performance across all benchmarks. It achieved lower perplexity than standard VAEs and existing topic-aware models like Topic-RNN. In summarization, it reached state-of-the-art ROUGE scores, indicating that topic guidance helps the model identify and preserve salient information.

Latent Space Analysis

A significant contribution of the TGVAE is the interpretability of its latent space. By using a GMM prior, the model naturally clusters documents by their thematic content.

t-SNE visualization of the latent space, showing distinct clusters for different topics such as finance, sports, and politics.

As illustrated in the t-SNE visualization above, the latent codes for various categories (e.g., "finance," "sports," "politics") form distinct, well-separated clusters. This confirms that the GMM prior effectively organizes the latent space according to the topics discovered by the NTM.

Conclusion

The TGVAE successfully addresses the limitations of standard text VAEs by incorporating topic-based guidance and flexible posterior distributions. The combination of a GMM prior and Householder flows results in a model that is both semantically interpretable and resistant to posterior collapse. Future research could explore applying this framework to other controllable attributes, such as sentiment or author style.

Summary updated

BibTeX
@inproceedings{wang2019topic,
  author = {Wenlin Wang and Zhe Gan and Hongteng Xu and Ruiyi Zhang and Guoyin Wang and Dinghan Shen and Changyou Chen and Lawrence Carin},
  title = {{Topic-Guided Variational Auto-Encoder for Text Generation}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2019},
  doi = {10.18653/v1/n19-1015},
}
Figure