Mr. LDA: a Flexible Large Scale Topic Modeling Package Using Variational Inference in Mapreduce

Mr. LDA: a Flexible Large Scale Topic Modeling Package Using Variational Inference in Mapreduce

Ke Zhai, Jordan Boyd-Graber, Nima Asadi, and Mohamad Alkhouja. Mr. LDA: A Flexible Large Scale Topic Modeling Package using Variational Inference in MapReduce. ACM International Conference on World Wide Web, 2012, 10 pages. @inproceedings{Zhai:Boyd-Graber:Asadi:Alkhouja-2012, Author = {Ke Zhai and Jordan Boyd-Graber and Nima Asadi and Mohamad Alkhouja}, Url = {docs/mrlda.pdf}, Booktitle = {ACM International Conference on World Wide Web}, Title = {{Mr. LDA}: A Flexible Large Scale Topic Modeling Package using Variational Inference in MapReduce}, Year = {2012}, Location = {Lyon, France}, } Links: • Code [http://mrlda.cc] • Slides [http://cs.colorado.edu/~jbg/docs/2012_www_slides.pdf] Downloaded from http://cs.colorado.edu/~jbg/docs/mrlda.pdf 1 Mr. LDA: A Flexible Large Scale Topic Modeling Package using Variational Inference in MapReduce Ke Zhai Jordan Boyd-Graber Nima Asadi Computer Science iSchool and UMIACS Computer Science University of Maryland University of Maryland University of Maryland College Park, MD, USA College Park, MD, USA College Park, MD, USA [email protected] [email protected] [email protected] Mohamad Alkhouja iSchool University of Maryland College Park, MD, USA [email protected] ABSTRACT In addition to being noisy, data from the web are big. The MapRe- Latent Dirichlet Allocation (LDA) is a popular topic modeling tech- duce framework for large-scale data processing [8] is simple to learn nique for exploring document collections. Because of the increasing but flexible enough to be broadly applicable. Designed at Google prevalence of large datasets, there is a need to improve the scal- and open-sourced by Yahoo, Hadoop MapReduce is one of the ability of inference for LDA. In this paper, we introduce a novel mainstays of industrial data processing and has also been gaining and flexible large scale topic modeling package in MapReduce (Mr. traction for problems of interest to the academic community such LDA). As opposed to other techniques which use Gibbs sampling, as machine translation [9], language modeling [10], and grammar our proposed framework uses variational inference, which easily fits induction [11]. In this paper, we propose a parallelized LDA algorithm in the into a distributed environment. More importantly, this variational 1 implementation, unlike highly tuned and specialized implementa- MapReduce programming framework (Mr. LDA). Mr. LDA relies tions based on Gibbs sampling, is easily extensible. We demonstrate on variational inference, as opposed to the prevailing trend of us- two extensions of the models possible with this scalable framework: ing Gibbs sampling. We argue for using variational inference in informed priors to guide topic discovery and extracting topics from Section 2. Section 3 describes how variational inference fits nat- a multilingual corpus. We compare the scalability of Mr. LDA urally into the MapReduce framework. In Section 4, we discuss against Mahout, an existing large scale topic modeling package. Mr. two specific extensions of LDA to demonstrate the flexibility of the LDA out-performs Mahout both in execution speed and held-out proposed framework. These are an informed prior to guide topic likelihood. discovery and a new inference technique for discovering topics in multilingual corpora [12]. Next, we evaluate Mr. LDA’s ability to scale in Section 5 before concluding with Section 6. Categories and Subject Descriptors H.3.3 [Information Search and Retrieval]: Clustering—topic mod- 2. SCALING OUT LDA els, scalability, mapreduce In practice, probabilistic models work by maximizing the log- likelihood of observed data given the structure of an assumed prob- 1. INTRODUCTION abilistic model. Less technically, generative models tell a story of Because data from the web are big and noisy, algorithms that how your data came to be with some pieces of the story missing; process large document collections cannot solely depend on human inference fills in the missing pieces with the best explanation of the annotations. One popular technique for navigating large unanno- missing variables. Because exact inference is often intractable (as it tated document collections is topic modeling, which discovers the is for LDA), complex models require approximate inference. themes that permeate a corpus. Topic modeling is exemplified by La- tent Dirichlet Allocation (LDA), a generative model for document- 2.1 Why not Gibbs Sampling? centric corpora [1]. It is appealing for noisy data because it requires One of the most widely used approximate inference techniques no annotation and discovers, without any supervision, the thematic for such models is Markov chain Monte Carlo (MCMC) sampling, trends in a corpus. In addition to discovering which topics exist in a where one samples from a Markov chain whose stationary distribu- corpus, LDA also associates documents with these topics, revealing tion is the posterior of interest [20, 21]. Gibbs sampling, where the previously unseen links between documents and trends over time. Markov chain is defined by the conditional distribution of each la- Although our focus is on text data, LDA is widely used in com- tent variable, has found widespread use in Bayesian models [20, 22, puter vision [2, 3], computational biology [4, 5], and computational 23, 24]. MCMC is a powerful methodology, but it has drawbacks. linguistics [6, 7]. Convergence of the sampler to its stationary distribution is difficult Copyright is held by the International World Wide Web Conference Com- to diagnose, and sampling algorithms can be slow to converge in mittee (IW3C2). Distribution of these papers is limited to classroom use, high dimensional models [21]. and personal use by others. 1 WWW 2012, April 16–20, 2012, Lyon, France. Download the code at http://mrlda.cc. ACM 978-1-4503-1229-5/12/04. Likelihood Asymmetric Hyperparameter Informed Framework Inference Multilingual Computation α Prior Optimization β Prior Mallet [13] Multi-thread Gibbs √ √ √ √ × GPU-LDA [14] GPU Gibbs & V.B. √ × × × × Async-LDA [15] Multi-thread Gibbs √ √ × × × N.C.L. [16] Master-Slave V.B. ∼ × × × × pLDA [17] MPI & MapReduce Gibbs ∼ × × × × Y!LDA [18] Hadoop Gibbs √ √ √ × × Mahout [19] MapReduce V.B. √ × × × × Mr. LDA MapReduce V.B. √ √ √ √ √ Table 1: Comparison among different approaches. Mr. LDA supports all of these features, as compared to existing distributed or multi-threaded implementations. ( - not available from available documentation.) ∼ Blei, Ng, and Jordan presented the first approximate inference random number generator in a shard-dependent way), but it adds technique for LDA based on variational methods [1], but the col- another layer of complication to the algorithm. Variational inference, lapsed Gibbs sampler proposed by Griffiths and Steyvers [23] has given an initialization, is deterministic, which is more in line with been more popular in the community because it is easier to imple- MapReduce’s system for ensuring fault tolerance. ment. However, such methods inevitably have intrinsic problems that lead to difficulties in moving to web-scale: shared state, ran- Many Short Iterations. domness, too many short iterations, and lack of flexibility. A single iteration of Gibbs sampling for LDA with K topics is very quick. For each word, the algorithm performs a simple Shared State. multiplication to build a sampling distribution of length K, samples Unless the probabilistic model allows for discrete segments to from that distribution, and updates an integer vector. In contrast, be statistically independent of each other, it is difficult to conduct each iteration of variational inference is difficult; it requires the inference in parallel. However, we want models that allow special- evaluation of complicated functions that are not simple arithmetic ization to be shared across many different corpora and documents operations directly implemented in an ALU (these are described in when necessary, so we typically cannot assume this independence. Section 3). At the risk of oversimplifying, collapsed Gibbs sampling for LDA This does not mean that variational inference is slower, how- is essentially multiplying the number of occurrences of a topic in ever. Variational inference typically requires dozens of iterations to a document by the number of times a word type appears in a topic converge, while Gibbs sampling requires thousands (determining across all documents. The former is a document-specific count, but convergence is often more difficult for Gibbs sampling). Moreover, the latter is shared across the entire corpus. For techniques that the requirement of Gibbs sampling to keep a consistent state means scale out collapsed Gibbs sampling for LDA, the major challenge is that there are many more synchronizations required to complete keeping these second counts for collapsed Gibbs sampling consistent inference, increasing the complexity of the implementation and when there is not a shared memory environment. the communication overhead. In contrast, variational inference re- Newman et al. [25] consider a variety of methods to achieve quires synchronization only once per iteration (dozens of times for consistent counts: creating hierarchical models to view each slice a typical corpus); in a naïve Gibbs sampling implementation, infer- as independent or simply syncing counts in a batch update. Yan et ence requires synchronization after every word in every iteration al. [14] first cleverly partition the data using integer programming (potentially billions of times for a moderately-sized corpus). (an NP-Hard problem). Wang et al.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    11 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us