Collapsed Variational Inference for HDP

Yee Whye Teh, Kenichi Kurihara, Max Welling

Introduction

In the realm of natural language processing, "topic modeling" allows researchers to discover hidden themes within massive collections of documents. While the Latent Dirichlet Allocation (LDA) model is a classic choice, it requires users to pre-specify the number of topics ($K$). The Hierarchical Dirichlet Process (HDP) offers a more powerful, "nonparametric" alternative that automatically determines the optimal number of topics from the data itself.

However, HDPs are notoriously difficult to compute. The standard inference tool, collapsed Gibbs sampling, is highly accurate but suffers from slow execution, difficult convergence assessment, and "label switching" (where topic identities swap during simulation). Variational Bayes (VB) provides a faster, deterministic alternative, but standard VB often introduces significant bias, leading to inferior predictive performance compared to sampling.

This paper introduces Collapsed Variational HDP (CV-HDP), bridging the gap by bringing the "collapsed" benefits of sampling into the variational framework. It stands as the first variational inference algorithm for HDPs that is faster, easier to assess for convergence, and more accurate than previous variational topic models.

Proposed Method: Collapsed Variational HDP

The authors propose a sophisticated extension of the "collapsed variational" approach, introducing several key mathematical innovations to make deterministic inference viable for HDPs:

  1. Collapsing the Parameters: Instead of approximating the topic-word and document-topic distributions directly, the authors integrate (marginalize) them out. This leaves a distribution over only the latent topic assignments, which significantly reduces bias and leads to a tighter, more accurate approximation.
  2. Auxiliary Variables: To handle the complex mathematics resulting from the HDP—specifically ratios of Gamma functions—the authors introduce four sets of auxiliary variables ($\eta, \xi, s, t$). These variables conceptually represent the number of "occupied tables" in a Chinese Restaurant Process, a common metaphor for HDPs.
Graphical models for standard HDP (left) and the proposed CV-HDP with auxiliary variables (right).
  1. Nested Truncation: While HDPs theoretically allow for an infinite number of topics, computational limits require a maximum threshold ($K$). The authors use a "nested" truncation method ensuring that as $K$ increases, the variational bound strictly improves. This allows the model to automatically "prune" unnecessary topics by zeroing them out.
  2. Improved Taylor Expansion: The digamma function appears frequently in Dirichlet-based models. The authors employ a second-order Taylor expansion to handle it, specifically treating the "zero-count" case exactly to avoid the mathematical instability that typically plagues these approximations.

Experimental Setup

The authors evaluated CV-HDP on three standard text corpora to test its real-world applicability:

  • KOS: A dataset of blog posts (3,430 documents, ~6,900 unique words).
  • Reuters: A subset of news articles (8,433 documents, ~4,600 unique words).
  • 20Newsgroups: A subset of the famous Usenet collection (4,716 documents, ~8,400 unique words).

Key Findings and Results

The experiments revealed several major advantages of the CV-HDP approach over existing methods:

  • Superior Accuracy: CV-HDP significantly outperformed CV-LDA (the previous state-of-the-art variational topic model) and standard VB in both training likelihood and test-set predictive power.
  • Speed and Convergence: All variational methods, including CV-HDP, converged much faster than their Gibbs sampling counterparts.
  • The Importance of Initialization: While CV-HDP is powerful, it remains sensitive to initialization. The authors discovered that initializing CV-HDP with the results of a short Gibbs sampling run allowed it to find even better local optima than the sampler itself.
  • Automatic Topic Discovery: Demonstrating its nonparametric strength, the HDP-based models automatically identified roughly 113 to 168 topics in the KOS dataset, bypassing the need for manual tuning required by fixed-$K$ models.
Performance comparisons showing CV-HDP outperforming standard variational methods across different truncation levels and iterations.

Crucially, the results highlight that treating full posterior distributions over the hyperparameters of Dirichlet variables—rather than using fixed point estimates—is a major driver of CV-HDP's improved accuracy.

Limitations and Future Work

Despite these advancements, CV-HDP still slightly underperforms collapsed Gibbs sampling in terms of raw test-set likelihood. Sampling remains the "gold standard" for absolute accuracy if computational time is not a constraint.

Furthermore, the current mathematical derivation is limited to "two-layer" HDPs (a layer of document-specific processes tied to a global process). Extending this framework to more complex, multi-layer hierarchical models remains an open challenge. Finally, while the model successfully prunes topics, the authors suggest that incorporating active "split and merge" moves could help the variational algorithm escape local optima even more effectively in future iterations.

Summary updated

BibTeX
@inproceedings{teh2007collapsed,
  author = {Yee Whye Teh and Kenichi Kurihara and Max Welling},
  title = {{Collapsed Variational Inference for HDP}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2007},
}
Figure