Effective Neural Topic Modeling with Embedding Clustering Regularization

Xiaobao Wu, Xinshuai Dong, Thong Thanh Nguyen, Anh Tuan Luu

TL;DR

Neural topic models often suffer from "topic collapsing," a phenomenon where different discovered topics end up looking identical and repetitive. This paper introduces the Embedding Clustering Regularization Topic Model (ECRTM), which uses a novel regularization technique based on Optimal Transport to force topic embeddings to stay semantically distinct. The result is a model that produces significantly more diverse and interpretable topics while outperforming state-of-the-art baselines in document clustering and classification.

The Problem: Topic Collapsing in Neural Models

Topic modeling aims to discover the latent themes within a collection of documents. While traditional methods like Latent Dirichlet Allocation (LDA) have been foundational for decades, recent research has shifted toward Neural Topic Models (NTMs). These models leverage Variational Autoencoders (VAEs) and word embeddings to handle large-scale text data more efficiently.

However, NTMs face a major hurdle: topic collapsing. Because these models are trained primarily to minimize "reconstruction error" (predicting the words in a document based on its inferred topics), they tend to over-index on high-frequency, uninformative words. Consequently, the embeddings for different topics "collapse" toward the same high-frequency word embeddings in the semantic space. This leads to repetitive topics, poor interpretability, and a failure to discover the full breadth of themes in a dataset.

Methodology: ECRTM

The authors propose the Embedding Clustering Regularization Topic Model (ECRTM) to directly combat this issue. The core innovation is the addition of an Embedding Clustering Regularization (ECR) term to the standard VAE loss function.

  1. Topic Embeddings as Cluster Centers: ECRTM treats topic embeddings as cluster centers and word embeddings as data points within a shared semantic space.
  2. Optimal Transport (Sinkhorn Algorithm): To prevent topics from bunching together, the model uses an Optimal Transport framework. It calculates a "transport plan" that maps word embeddings to topic embeddings, ensuring an optimal distribution of words across topics.
  3. Preset Cluster Size Constraints: Unlike standard clustering algorithms (like K-Means), ECR enforces constraints on cluster sizes. By forcing each topic to "own" a certain proportion of the vocabulary (typically $1/K$ for $K$ topics), the model ensures that no topic is left empty and that topics must spread out to cover different semantic regions.
Cluster size proportions comparing ECR to baselines
  1. Differentiable Training: Because the Sinkhorn algorithm is differentiable, this clustering regularization can be optimized jointly with the main topic modeling objective using standard backpropagation.

Key Insights

  • The "Zipf's Law" Bias: The authors identify that topic collapsing is a direct result of the long-tail distribution of words. Since a few words appear everywhere, a model purely focused on reconstruction will naturally pull all topics toward those few words to minimize error.
  • Diversity is as Important as Coherence: Most research focuses heavily on Topic Coherence ($C_V$), but a model can appear "coherent" by simply repeating the same high-frequency words in every topic. ECRTM emphasizes Topic Diversity (TD), proving that high diversity can be achieved without sacrificing coherence.
  • Structural vs. Probabilistic Constraints: While previous models tried to fix collapsing using complex probability priors (like Dirichlet distributions), ECRTM fixes it geometrically by enforcing a strict clustering structure in the embedding space.

Key Results

The model was evaluated on four widely used benchmark datasets: 20 News Groups (20NG), IMDB, Yahoo Answers, and AG News. ECRTM consistently outperformed baselines (including ETM, NSTM, and WeTe) across several metrics:

  • Topic Diversity (TD): This is where ECRTM truly shines. On the IMDB dataset with 50 topics, ECRTM achieved a TD score of 0.974, while the next best neural baseline (ETM) scored only 0.557, and others (like NSTM) collapsed as low as 0.175.
  • Topic Coherence ($C_V$): ECRTM achieved the highest coherence scores across almost all datasets, indicating that its topics are not just diverse, but also semantically meaningful.
  • Downstream Performance: In document clustering (measured by Purity and NMI) and text classification (F1 score), ECRTM significantly surpassed state-of-the-art models, proving that its discovered topics serve as better features for other machine learning tasks.
  • Visual Proof: t-SNE visualizations clearly show topic embeddings in baseline models huddling in a single tight spot, whereas ECRTM’s topic embeddings are evenly distributed throughout the word embedding cloud.
Visual comparison of topic embeddings

Limitations and Future Work

  • Uniform Cluster Assumptions: Currently, the model assumes all topics should have roughly equal "semantic volume" (uniform cluster size proportions). In reality, some topics are naturally broader than others. Incorporating expert prior knowledge to set non-uniform cluster sizes could be a fruitful future direction.
  • Hyperparameter Sensitivity: The model introduces new hyperparameters, such as the regularization weight ($\lambda_{ECR}$) and the Sinkhorn entropy ($\epsilon$). Tuning these for new datasets may require additional effort.
  • Computational Cost: While the Sinkhorn algorithm is efficient, it still adds an iterative step to every training batch, which may slightly increase training time compared to simpler NTMs.

Summary updated

BibTeX
@inproceedings{wu2023effective,
  author = {Xiaobao Wu and Xinshuai Dong and Thong Thanh Nguyen and Anh Tuan Luu},
  title = {{Effective Neural Topic Modeling with Embedding Clustering Regularization}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=TlezjJUytC},
}
Figure