On Smoothing and Inference for Topic Models

Arthur U. Asuncion, Max Welling, Padhraic Smyth, Yee Whye Teh

Abstract

Performance disparities between popular topic modeling algorithms, such as Variational Bayes (VB) and Collapsed Gibbs Sampling (CGS), are often attributed to the inherent strengths of the inference techniques. This research demonstrates that these gaps are largely artifacts of suboptimal hyperparameter tuning. By properly adjusting smoothing parameters to account for algorithmic "offsets," we show that most standard algorithms achieve nearly identical accuracy. We introduce CVB0, a simplified, deterministic "zeroth-order" approximation of Collapsed Variational Bayes. CVB0 is easier to implement and faster than standard approaches while maintaining high accuracy across diverse datasets.

Introduction

In Latent Dirichlet Allocation (LDA), researchers have long sought the most effective inference algorithm. Previous literature suggested that Collapsed Variational Bayes (CVB) and Collapsed Gibbs Sampling (CGS) significantly outperformed standard Variational Bayes (VB). This paper investigates whether these differences are fundamental or merely a result of hyperparameter settings. In high-dimensional word spaces, "smoothing"—the probability mass assigned to rare words—is critical. We hypothesize that small variations in how algorithms handle smoothing account for the perceived performance differences.

Methods and the CVB0 Algorithm

We compared five inference techniques: Maximum Likelihood (ML), Maximum A Posteriori (MAP), Variational Bayes (VB), Collapsed Variational Bayes (CVB), and Collapsed Gibbs Sampling (CGS).

A key discovery was that VB and MAP algorithms contain implicit "offsets" in their update equations (effectively subtracting 0.5 or 1.0 from counts). This causes "under-smoothing" when using standard hyperparameters. By increasing hyperparameters ($\alpha$ and $\eta$) to compensate, VB performance aligns with CGS.

The Innovation: CVB0

We derived CVB0, a zeroth-order approximation of CVB. Standard CVB tracks variance and uses complex second-order Taylor expansions. CVB0 simplifies this by ignoring these higher-order terms. The resulting algorithm is deterministic, rapid, and avoids the stochastic nature of Gibbs sampling while matching its accuracy.

Perplexity vs. Iteration: CVB0 converges rapidly to a low perplexity compared to standard VB and CGS.

Experimental Results

The study utilized seven diverse corpora, ranging from research abstracts (CRAN) to large-scale patent descriptions (PAT).

Accuracy Parity

When hyperparameters were optimized via grid search or fixed-point updates, the performance gaps vanished. As shown in Figure 3, the perplexity—a measure of predictive performance—became nearly identical for VB, CVB, and CGS across most datasets. This confirms that smoothing is often more influential than the choice of inference engine.

Perplexity across various datasets: After optimization, different algorithms show similar performance levels.

Computational Efficiency

CVB0 demonstrated significant speed advantages. For instance, on the MED dataset, CVB0 reached target perplexity in 9.5 seconds, whereas standard VB took 151.6 seconds and CGS took 18.2 seconds. Furthermore, parallelized CVB0 can process thousands of documents in under 3 seconds, making it highly scalable for large-scale text analysis.

Conclusion

This work reveals that hyperparameter optimization is the primary driver of topic model performance. The perceived superiority of certain complex algorithms is often due to better default smoothing behavior. By accounting for algorithmic offsets, simpler methods like VB can be highly competitive. CVB0 emerges as a particularly attractive option, offering the accuracy of Gibbs sampling with the speed and determinism of variational methods. Future work will explore these insights in the context of more complex hierarchical and non-parametric models.

Summary updated

BibTeX
@inproceedings{asuncion2009smoothing,
  author = {Arthur U. Asuncion and Max Welling and Padhraic Smyth and Yee Whye Teh},
  title = {{On Smoothing and Inference for Topic Models}},
  booktitle = {Conference on Uncertainty in Artificial Intelligence},
  year = {2009},
  url = {https://openreview.net/forum?id=rDBTdABmUOu},
}
Figure