Abstract
Latent Dirichlet Allocation (LDA) is a fundamental technique for discovering latent topics in large-scale text corpora. However, scaling LDA to handle thousands of topics and billions of words presents significant computational and architectural challenges. This paper introduces F+Nomad LDA, a highly scalable and asynchronous distributed algorithm designed to overcome these bottlenecks. By integrating a novel $O(\log T)$ Fenwick tree-based sampler (F+tree) with a lock-free, token-passing parallel framework (Nomad), the proposed system achieves substantial performance gains. Experimental results on massive real-world datasets demonstrate that F+Nomad LDA processes billions of words significantly faster than state-of-the-art implementations like Yahoo! LDA.
Introduction
As datasets grow to millions of documents, learning meaningful topic models requires a large number of topics ($T$), often in the thousands. Standard Collapsed Gibbs Sampling (CGS) methods scale linearly with $T$, making them prohibitively slow for massive applications. Furthermore, distributing CGS across multiple machines is difficult due to high update interdependency, which typically leads to severe locking overhead or communication bottlenecks in centralized parameter server architectures. F+Nomad LDA addresses these issues through algorithmic innovation in sampling and a decentralized distributed framework.
Methodology
The authors propose two primary innovations to address the algorithmic and distributed systems challenges:
1. F+tree Sampling and Word-by-Word CGS
To handle a massive number of topics, the authors adapt the Fenwick tree into an F+tree. This binary tree structure enables sampling from a $T$-dimensional multinomial distribution and updating topic counts in $O(\log T)$ time. The algorithm mathematically decomposes the sampling probability distribution and utilizes a word-by-word sampling sequence instead of the traditional document-by-document approach. This strategy minimizes the number of tree updates required per step, significantly enhancing efficiency for large corpora.
2. Nomad Framework for Parallel LDA
To distribute the workload without the overhead of locks or a central parameter server, the authors introduce a decentralized, asynchronous architecture inspired by the "Nomad" algorithm. The data is partitioned, and "nomadic tokens" are used to pass ownership of specific words and the global state between workers. A worker can only update a word's topic assignment if it holds the corresponding token, guaranteeing lock-free, conflict-free execution while ensuring workers use the most up-to-date parameters.
Experimental Setup
The algorithm was evaluated on several standard and massive real-world datasets:
- Standard UCI datasets: Enron (6.2M words), NyTimes (98M words), and PubMed (737M words).
- Massive datasets: Amazon product reviews (1.5B words) and the UMBC WebBase corpus (1.5B words).
Key Insights
- Efficiency of Word-by-Word Sampling: By changing the sampling sequence, the number of non-zero elements requiring updates drops significantly. This makes the F+tree approach mathematically faster than recent innovations like AliasLDA for large-scale document sets.
- Decentralized Parameter Management: Token passing eliminates the parameter server bottleneck. Workers always have access to the latest, conflict-free data without hammering a central server.
- Asynchronous Global State Updates: The Nomad framework uses local "shadow nodes" and delta updates to asynchronously sync the global topic count vector without halting computation, exploiting the fact that relative changes to the massive global sum are tiny.
Results
- Serial Performance: On a single thread, F+LDA converges at the same rate as exact Gibbs sampling but generates samples faster than SparseLDA and AliasLDA as dataset size increases.
- Multi-core Scaling: On a single 20-core machine, F+Nomad LDA outperforms both disk-based and memory-based versions of Yahoo! LDA.
- Distributed Scaling: On a 32-machine cluster (640 cores), F+Nomad LDA achieves target model quality (log-likelihood) approximately 4x faster than Yahoo! LDA on 1.5-billion-word datasets.
Conclusion and Future Work
F+Nomad LDA demonstrates exceptional scalability for large-scale topic modeling. While the current implementation requires latent variables to fit in memory, the authors plan to incorporate disk-streaming capabilities to handle datasets exceeding cluster RAM. Additionally, the asynchronous token-passing framework shows promise for application to other inference schemes, such as Collapsed Variational Bayes (CVB0).
Summary updated