Distributed Inference for Latent Dirichlet Allocation

David Newman, Arthur U. Asuncion, Padhraic Smyth, Max Welling

Overview

Latent Dirichlet Allocation (LDA) is a cornerstone of topic modeling, widely used to discover underlying themes in massive text collections. However, as datasets grow to millions of documents and billions of words, standard LDA inference hits severe memory and computational bottlenecks. This paper introduces two novel frameworks for scaling LDA by distributing computation across multiple processors. The authors demonstrate that distributed inference—even when using a simplified "approximate" approach—achieves the same predictive accuracy as single-processor learning while providing significant speedups.

The Bottleneck: Memory and Time

When scaling to massive datasets, standard LDA faces two primary walls:

  1. Memory: A corpus of one million documents can require gigabytes of RAM just for storage, easily exceeding the capacity of standard single machines.
  2. Time: Standard inference via Gibbs sampling is inherently sequential. A single pass through a large corpus can take hours, and full model training can take days or weeks.

The core challenge is that LDA is not "embarrassingly parallel." Because topics are global distributions over words, processors need a way to coordinate their local findings to arrive at a consistent global solution without drowning in communication overhead.

Proposed Distributed Methods

The authors propose two distinct distributed inference schemes to tackle these bottlenecks:

  • Approximate Distributed LDA (AD-LDA): This is the "pragmatic" approach. Each of the $P$ processors is given a subset of the data and runs local Gibbs sampling. Periodically, the processors synchronize by summing their local word-topic counts into a global count matrix. While technically an approximation (since local samplers are briefly "out of sync" with the global state), it is simple to implement and highly computationally efficient.
  • Hierarchical Distributed LDA (HD-LDA): This is the "principled" approach. The authors extend the LDA model itself into a hierarchy where a "parent" collection of topics generates "child" topics for each processor. This version uses a Monte Carlo Expectation Maximization (MCEM) algorithm. It offers theoretical convergence guarantees but is mathematically complex and slower to run due to the need for digamma function evaluations.

Key Insights: The Robustness of Approximation

The most striking insight from the research is that AD-LDA—despite lacking formal convergence proofs—consistently reaches the same posterior mode as the standard single-processor version. The stochastic nature of Gibbs sampling appears to help the model "ignore" the slight noise introduced by delayed distributed updates.

Convergence trajectories of AD-LDA vs. standard LDA

The authors also proved that coordinated learning is essential. You cannot simply train separate LDA models on different processors and average their results; that approach yields poor predictive performance. A mechanism like the global count synchronization in AD-LDA is required to force the processors to "agree" on the global topic definitions.

Furthermore, parallel efficiency depends heavily on the ratio of total words to the product of processors and vocabulary size. As the dataset grows relative to the vocabulary, the communication overhead becomes negligible compared to the computational gains.

Results: Speed and Statistical Parity

The researchers evaluated their models on several real-world text corpora, including a massive New York Times dataset containing 100 million words across 300,000 documents.

  • Statistical Parity: In terms of perplexity (how well the model predicts unseen text) and precision-recall, the distributed models were indistinguishable from the single-processor gold standard.
  • Significant Speedup: On the 100-million-word NYTIMES dataset, the authors achieved an 8.5x speedup using 16 processors, reducing a 10-day training task to just over one day.
  • Massive Scaling: The authors successfully simulated large-scale computation on up to 1,000 virtual processors, showing that the model remains stable even when each processor only sees a tiny fraction of the data.
Perplexity remains stable across different numbers of processors (P)

Limitations and Future Directions

While highly effective, the current AD-LDA implementation relies on a synchronous "reduce-scatter" operation where all processors must wait for each other to sync. In a real-world distributed system, "straggler" nodes could become a bottleneck. Additionally, while memory scales perfectly ($1/P$), communication costs still depend on the vocabulary size.

For future work, the authors suggest exploring asynchronous communication—where processors sync at different times—and adaptive schemes where data moves between processors to balance the load dynamically. They also note that the core AD-LDA synchronization principle could be applied to scale other algorithms, such as Non-negative Matrix Factorization (NMF).

Summary updated

BibTeX
@inproceedings{newman2007distributed,
  author = {David Newman and Arthur U. Asuncion and Padhraic Smyth and Max Welling},
  title = {{Distributed Inference for Latent Dirichlet Allocation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2007},
}
Figure