Effective Neural Topic Modeling with Embedding Clustering Regularization

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

Introduction: The Problem of Topic Collapsing

Topic modeling has long been a foundational technique in Natural Language Processing (NLP) for uncovering latent themes within massive document collections. While traditional methods like Latent Dirichlet Allocation (LDA) paved the way, the field has increasingly shifted toward Neural Topic Models (NTMs). NTMs offer significant advantages, primarily their ability to leverage powerful, pre-trained word embeddings (such as GloVe) and scale efficiently to large datasets.

However, NTMs suffer from a notorious and pervasive flaw known as topic collapsing. In practice, this means the model outputs dozens of supposedly different topics that are semantically nearly identical. The authors of this paper diagnose the root cause as a byproduct of Zipf’s Law: because a few high-frequency words dominate natural language datasets, the standard reconstruction loss in NTMs is heavily biased toward them. Without a counteracting force, topic embeddings naturally drift toward the "center of gravity" created by these common terms, ruining model interpretability and degrading performance on downstream tasks like categorization.

The Solution: ECRTM and Optimal Transport

To combat this, the researchers introduce the Embedding Clustering Regularization Topic Model (ECRTM). The core innovation is the addition of an Embedding Clustering Regularization (ECR) module, which operates alongside the standard Variational Autoencoder (VAE) architecture typical of neural topic modeling.

ECRTM introduces several key technical mechanisms to keep topics distinct:

  • Optimal Transport (OT) for Clustering: Standard clustering algorithms like K-Means are notoriously difficult to optimize jointly within a neural network. Instead, ECRTM models the relationship between word embeddings and topic embeddings as an Optimal Transport problem.
  • Sinkhorn’s Algorithm: To solve the OT problem efficiently, the model employs Sinkhorn’s algorithm. This generates a differentiable "transport plan" that assigns word embeddings to topic centers, allowing the entire architecture to be trained end-to-end via backpropagation.
  • Cluster Size Constraints: A common failure mode in clustering is the "trivial solution," where one massive cluster swallows the majority of the data while others remain empty. ECRTM prevents this by enforcing a preset constraint (typically uniform) on cluster sizes. This forces every topic to "own" a distinct, non-overlapping portion of the semantic space.
  • Joint Optimization: The model's final loss function carefully balances the standard reconstruction error (ensuring topics accurately describe the documents) with the ECR loss (ensuring topics remain spatially separated from one another).

Experimental Setup

The authors rigorously evaluated ECRTM across four standard benchmark datasets, capturing a variety of text types and lengths:

  1. 20 News Groups (20NG): A classic dataset of news articles spanning 20 distinct categories.
  2. IMDB: A collection of movie reviews, ideal for testing sentiment-oriented topics.
  3. Yahoo Answers: A dataset of question-and-answer pairs distributed across 10 labels.
  4. AG News: News titles and descriptions categorized into four broad classes (e.g., Sports, Business).

Key Findings and Results

The results demonstrate that ECRTM effectively breaks the traditional trade-off between topic diversity and coherence. Historically, forcing a model to produce more diverse topics resulted in "noisier," less coherent groupings. By forcing topics to act as the literal centers of word clusters, ECRTM ensures they are semantically tight (coherent) while remaining spatially separated (diverse).

When compared against state-of-the-art baselines like ETM and NSTM, ECRTM yielded striking improvements:

  • Unprecedented Topic Diversity: ECRTM achieved near-perfect diversity scores (approximately 0.96 on the 20NG dataset), whereas previous state-of-the-art models typically stagnated between 0.40 and 0.70.
  • Clear Spatial Separation: Visualizations of the embedding space (using t-SNE) revealed that while baseline models' topic embeddings huddled in a single central blob, ECRTM’s topics were widely dispersed, with each claiming a unique "island" of word embeddings.
  • Superior Downstream Performance: When the discovered topics were utilized as features for downstream text classification tasks, ECRTM consistently outperformed all baselines. This confirms that highly diverse, distinct topics translate directly into higher-quality document representations.

Limitations and Future Directions

While ECRTM presents a massive leap forward for neural topic modeling, the authors note a few limitations that pave the way for future research:

  • Uniform Cluster Assumption: The current iteration of ECRTM assumes all topics should be roughly the same size (i.e., containing a similar number of words). In reality, semantic categories vary wildly in breadth—a topic like "Sports" is naturally broader than "Curling." Future work could incorporate prior knowledge to allow for dynamic, non-uniform cluster sizes.
  • Hyperparameter Sensitivity: The model requires tuning for the ECR loss weight and the Sinkhorn algorithm's temperature parameter, which can vary depending on the specific dataset.
  • Computational Overhead: Although Sinkhorn’s algorithm is highly optimized for GPUs, it still introduces an iterative step to every training batch, making ECRTM slightly more computationally intensive than a standard VAE-based topic model.

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