Introduction
Probabilistic topic models, such as Latent Dirichlet Allocation (LDA), have long been the standard for discovering latent thematic structures in large document collections. While effective, traditional inference methods like Gibbs sampling are computationally expensive. Neural topic models (NTMs) address this by using Variational Autoencoders (VAEs) to perform amortized inference. However, NTMs face significant challenges in accurately modeling the Dirichlet prior and avoiding the "posterior collapse" phenomenon.
Challenges in Neural Topic Modeling
The Dirichlet distribution is critical for topic modeling because its concentration parameters promote sparsity, reflecting the intuition that documents typically cover only a few topics. Standard VAEs struggle with this because the "reparameterization trick" is not directly applicable to the Dirichlet distribution. Most existing models resort to Gaussian approximations, which fail to capture the sparse nature of the simplex. Furthermore, VAEs are prone to posterior collapse, where the encoder ignores input data and simply outputs the prior, resulting in uninformative latent representations.
The W-LDA Approach
To overcome these hurdles, we propose W-LDA, a neural topic model built on the Wasserstein Autoencoder (WAE) framework. Unlike VAEs, which force individual document posteriors to match the prior, WAEs minimize the distance between the aggregated posterior of the entire dataset and the prior distribution. This global constraint provides the flexibility needed to avoid posterior collapse while strictly adhering to a Dirichlet prior.
Distribution Matching with MMD
W-LDA employs Maximum Mean Discrepancy (MMD) to align the latent distribution with the Dirichlet prior. We utilize a specialized Information Diffusion Kernel, which operates on the geodesic distance of a simplex. This kernel is particularly effective at capturing the boundaries of the latent space, which is essential for maintaining sparsity in high-dimensional topic modeling.
Dirichlet Noise Injection
A key innovation in W-LDA is the injection of random Dirichlet noise into the encoder's output during training. This technique acts as a powerful regularizer, forcing the decoder to learn more robust word-topic associations. As shown in our experiments, this noise injection is a primary driver of improved topic coherence.
Evaluation Metrics: Coherence and Uniqueness
Standard evaluation of topic models relies on Normalized Pointwise Mutual Information (NPMI) to measure topic coherence. However, NPMI alone can be misleading; a model might achieve high coherence by generating the same "good" topic repeatedly. To address this, we introduce the Topic Uniqueness (TU) metric. TU measures the diversity of topics by penalizing word repetition across the discovered topic set. A high-quality model should maximize both NPMI and TU.
Results
W-LDA was evaluated against several baselines, including traditional LDA and state-of-the-art neural models like ProdLDA.
Quantitative Performance
W-LDA consistently outperforms baselines across diverse datasets such as 20 Newsgroups, NYTimes, and Wikitext-103. For instance, on the NYTimes dataset, W-LDA achieved an NPMI of 0.356 and a perfect TU score of 1.00, significantly surpassing ProdLDA (0.319 NPMI, 0.67 TU). The use of MMD proved more stable than GAN-based alternatives, which often suffered from vanishing gradients in high-dimensional spaces.
Qualitative Analysis
Qualitative inspection of the generated topics confirms that W-LDA produces semantically meaningful and distinct word clusters across various domains.
Conclusion
W-LDA demonstrates that the Wasserstein Autoencoder framework, combined with MMD and Dirichlet noise injection, provides a superior foundation for neural topic modeling. By preserving the sparsity of the Dirichlet prior and ensuring topic diversity through the TU metric, W-LDA offers a robust and scalable solution for discovering latent themes in text data without the pitfalls of standard VAE-based approaches.
Summary updated