Model-Parallel Inference for Big Topic Models

Xun Zheng, Jin Kyu Kim, Qirong Ho, Eric P. XingarXiv 2014

Abstract

Traditional data-parallel approaches for Latent Dirichlet Allocation (LDA) struggle with 'gigantic' models common in industrial applications, where the number of parameters can reach the trillions. This paper introduces a model-parallel framework that partitions the word-topic count matrix across a cluster. By employing a dynamic partitioning and rotation strategy, the system eliminates memory bottlenecks and synchronization errors inherent in data-parallel systems. Our evaluation on massive corpora, including a 218-billion-parameter model, shows that this approach achieves faster convergence and superior scalability compared to existing state-of-the-art systems.

Introduction

In large-scale machine learning, data-parallelism—where datasets are split across machines while each maintains a local copy of the model—is the standard. However, for applications like online advertising, topic models can involve vocabularies of 10 million words and 100,000 topics, requiring the estimation of over a trillion variables. Such models exceed the RAM capacity of single worker nodes and suffer from significant synchronization errors in distributed environments due to the use of 'stale' parameters to avoid network locks.

System Architecture and Methods

The proposed framework shifts the focus from partitioning documents to partitioning the word-topic count matrix ($V \times K$). This allows the memory burden to be distributed across the cluster, where adding more nodes directly reduces the RAM required per node.

System architecture for model-parallel LDA, showing the interaction between the scheduler, key-value store, and workers.

Dynamic Model Partitioning and Rotation

The $V \times K$ matrix is divided into disjoint blocks. A central scheduler assigns these blocks to workers and rotates them in 'sub-iterations.' This ensures that by the end of a full round, every word-topic assignment has been updated exactly once. Because the blocks are disjoint, workers can perform updates simultaneously without interference, eliminating the 'parallelization error' typical of asynchronous systems.

Communication and Sampling

Workers interact with a distributed key-value store to fetch only the specific model blocks required for their assigned tasks. To maintain efficiency, the system uses an inverted index (mapping words to documents) and a mathematically decomposed Gibbs sampling formula with $O(K_d + K_t)$ complexity, where $K_d$ and $K_t$ represent the number of topics in a document and the number of topics for a word, respectively.

Experimental Evaluation

The system was tested on three massive corpora: Pubmed (8.2M documents), Wiki-unigram (3.9M documents), and Wiki-bigram (21.8M unique phrases). The latter was used to create a model with 218 billion elements, testing the limits of the architecture.

Performance and Scalability

The model-parallel approach demonstrated unprecedented scale, successfully training a 200-billion-variable model on 64 low-end machines—a task where the previous state-of-the-art, Yahoo!LDA, failed to initialize due to memory limits.

Log-likelihood vs. (a) Iteration and (b) Time for Model-Parallel LDA and Yahoo!LDA on the Pubmed dataset.

As shown in the results, the model-parallel system reaches a higher log-likelihood significantly faster than Yahoo!LDA, both per iteration and in total wall-clock time. Furthermore, memory usage per machine followed an ideal $1/M$ scaling trend, confirming the system's ability to efficiently distribute the storage burden.

Discussion and Limitations

While highly effective for LDA, the system's performance is sensitive to network bandwidth during block rotations. On extremely low-bandwidth networks, the rotation of blocks could become a bottleneck. Future work could explore applying these model-parallel primitives to other complex models like Hierarchical Dirichlet Processes (HDP) or optimizing for GPU-accelerated architectures.

Summary updated

BibTeX
@misc{zheng2014model,
  author = {Xun Zheng and Jin Kyu Kim and Qirong Ho and Eric P. Xing},
  title = {{Model-Parallel Inference for Big Topic Models}},
  year = {2014},
  eprint = {1411.2305},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1411.2305},
}
Figure