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).
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:
- Unconditional Text Generation: Tested on the APNEWS, IMDB, and BNC datasets to measure perplexity and generation quality.
- 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.
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