A Collapsed Variational Bayesian Inference Algorithm for Latent Dirichlet Allocation

Yee Whye Teh, David Newman, Max WellingNeurIPS 2006

TL;DR

This paper introduces the Collapsed Variational Bayesian (CVB) inference algorithm for Latent Dirichlet Allocation (LDA). By "collapsing" the parameter space before applying variational approximations, the authors create an algorithm that is as computationally efficient as standard Variational Bayes but approaches the high accuracy of Collapsed Gibbs Sampling.

What Problem Does This Paper Address?

Latent Dirichlet Allocation (LDA) is the "bread and butter" of topic modeling, used to discover underlying themes in massive collections of documents. However, performing inference—the process of actually finding those topics—is difficult at scale.

Historically, researchers had to choose between two compromises:

  1. Variational Bayes (VB): Fast and deterministic, but often inaccurate because it assumes the model parameters and latent topics are independent (a "mean-field" assumption that doesn't hold well in practice).
  2. Collapsed Gibbs Sampling (CGS): Highly accurate, but slow, stochastic, and difficult to diagnose for convergence.
Inference Algorithm Landscape

The authors identify a "missing middle": an algorithm that maintains the speed of variational methods without sacrificing the accuracy gained by marginalizing out (collapsing) the model parameters.

Methods

The core innovation is CVB inference. In standard VB, you approximate the posterior distribution by assuming everything—the topics of words ($z$), the document-topic distributions ($\theta$), and the topic-word distributions ($\phi$)—is independent.

The authors argue that $\theta$ and $\phi$ are actually very tightly coupled with $z$. By marginalizing out (integrating out) $\theta$ and $\phi$ first, they move the problem into a "collapsed space" where only the latent topic assignments $z$ remain. In this collapsed space, the dependencies between different $z$ variables are "spread out" and weak, making the independence assumption of the variational approach much more valid.

To make this computationally feasible, the authors employ a Gaussian approximation. Calculating the exact expectations in the collapsed space is normally too expensive, but because the variables are sums of independent Bernoulli trials, the Central Limit Theorem allows them to use a second-order Taylor expansion to simplify the math. This keeps the complexity at $O(K)$ per word (where $K$ is the number of topics), the same as standard VB.

Datasets

The authors evaluated their algorithm on two well-known text corpora:

  • KOS: A dataset from dailykos.com containing 3,430 documents and approximately 467,000 words.
  • NIPS: A collection of research papers from the NIPS conference, containing 1,675 documents and over 2.1 million words.

Key Insights and Ideas

  • The "Collapsed" Advantage: The "aha moment" is realizing that the mean-field assumption (independence) is a poor fit for the joint space of parameters and variables, but a fantastic fit for the collapsed space. In the collapsed space, one variable interacts with others only through "summary statistics," making the impact of any single variable very small.
  • Deterministic Gibbs: CVB can be viewed as a deterministic, mean-field version of the popular Collapsed Gibbs Sampler. It provides the benefits of "collapsing" without the "noise" and convergence headaches of MCMC.
  • Gaussian Efficiency: The use of a Gaussian approximation to handle the expensive averages is a vital practical contribution. It allows the algorithm to remain fast enough for real-world, large-scale applications.

Key Results

  • Accuracy: CVB significantly outperformed standard VB in terms of both the variational lower bound (a measure of how well the model fits the training data) and test-set log probabilities.
  • Convergence Speed: CVB converged much faster than Collapsed Gibbs Sampling. While Gibbs Sampling eventually reached a slightly higher accuracy given enough time, CVB reached a high-quality solution in far fewer iterations.
Convergence Comparison
  • Efficiency: The memory and computational requirements for CVB are essentially the same as standard VB ($O(MK)$, where $M$ is the number of unique document/word pairs), making it a "drop-in" improvement for existing systems.

Limitations and Future Work

The authors note that while the Gaussian approximation is highly effective, it is still an approximation. In very small data regimes (very few words per document), the assumption that the sums of variables behave like a Gaussian might become "dubious," though their experiments showed it remained robust even with smaller subsets of data.

The paper suggests that the CVB framework isn't limited to LDA. The authors propose extending this approach to other discrete graphical models, such as Hidden Markov Models (HMMs) with discrete outputs and more complex non-parametric models like Dirichlet Processes.

Summary updated

BibTeX
@inproceedings{teh2006collapsed,
  author = {Yee Whye Teh and David Newman and Max Welling},
  title = {{A Collapsed Variational Bayesian Inference Algorithm for Latent Dirichlet Allocation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2006},
  url = {https://openreview.net/forum?id=rJ44MOZuZB},
}
Figure