Topic Modeling

Representing documents by latent themes instead of words. Latent semantic indexing with the singular value decomposition, probabilistic latent semantic analysis, latent Dirichlet allocation and its inference, evaluating topic models by perplexity and coherence, and extensions from dynamic topic models to neural and embedding-based methods, with experiments on Cranfield and Reuters.

Every retrieval model so far has treated words as independent dimensions. A document about automobiles and a query about cars share no terms, so the vector space model scores them zero, however closely they are related. A document about jaguars the animal and one about Jaguar the car share a term, so they look alike. Words are an imperfect stand-in for what documents are about. Can a program find out what documents are about, from nothing but the documents themselves?

Topic models try to. From word co-occurrence across a whole collection, they find a small number of latent topics, each a pattern of words that tend to appear together. Each document is then described as a mixture of those topics. No one specifies the topics in advance. Like clustering, topic modeling is unsupervised. But where clustering puts each document in one group, a topic model lets a document belong partly to several. A story about an oil company's takeover bid is partly about oil and partly about acquisitions.

The topic follows the historical sequence, in which each model kept its predecessor's idea and repaired what was wrong with it:

  • Latent semantic indexing (1990) used linear algebra, factoring the term-document matrix with the singular value decomposition.
  • Probabilistic latent semantic analysis (1999) recast the idea as a statistical model.
  • Latent Dirichlet allocation (2003) made that model fully generative, and became the standard method for exploring large text collections.

Here is the route. First we say what a topic is and how a document can be a mixture of several. Then we follow the three models in order, fitting each one by hand. Finally we set out how a topic model is judged, which is as hard as fitting one, and survey the models that came after LDA.

The course ran out of time before reaching this topic. These articles were therefore written from the textbook and the original papers rather than from lectures. The experiments test the methods on the collections used in earlier topics: LSI for retrieval on Cranfield, and LDA, LSI, and nonnegative matrix factorization for topic discovery on Reuters.

Alongside them, one tiny collection runs through every article: the textbook's six documents over the words ship, boat, ocean, voyage, and trip. It is small enough that each method can be worked by hand. Its SVD is computed in full, two iterations of pLSA's EM are traced, and LDA's Gibbs sampler is stepped word by word and checked against the exact posterior.

Articles

The idea

  • What is topic modeling: a topic is a probability distribution over words, and a document can be about several topics because it is a mixture of them. Topics as distributions over words, documents as mixtures of topics, how topic models relate to clustering, preparing text for them, and what they are used for.

The models

  • Latent semantic indexing: linear algebra finds dimensions that place documents with related words close together, even when they share none. The singular value decomposition built from an eigendecomposition, low-rank approximation with the Eckart–Young theorem proved in the spectral and Frobenius norms, the textbook's worked example computed step by step, folding in queries, and an experiment on Cranfield in which LSI outperformed BM25.
  • Probabilistic latent semantic analysis: LSI's idea as a probability model, in which every factor is a probability, at the cost of overfitting and of having no model for new documents. The aspect model and its geometry, and expectation-maximization derived in full and run by hand.
  • Latent Dirichlet allocation: each document's mixture is drawn from a distribution shared by the whole collection, which fixes the number of parameters and gives every document a probability. The generative story and the Dirichlet prior, and collapsed Gibbs sampling derived, proved to converge, traced by hand, checked against the exact posterior, and explored in a demo. Twenty topics found in Reuters.
  • Variational inference for LDA: the posterior of LDA can be approximated by one factorized distribution, fitted by two updates that never lower a bound on the evidence. The expected logarithm of a Dirichlet, the evidence lower bound, both updates proved to be maxima, and the bound traced on the six documents against the exact evidence.

Judging and extending

  • Evaluating topic models: a topic model is judged by how well it predicts held-out text, by what people make of its topics, and by coherence scores that stand in for people; none of them settles the number of topics. Held-out perplexity derived and computed, human judgments by word and topic intrusion, and coherence measures worked by hand. On Reuters, perplexity and coherence disagree about the number of topics.
  • Topic models beyond LDA: after LDA, its generative story was extended piece by piece, and matrix factorization and neural methods came to compete with it; in retrieval, topic models helped as smoothing beside exact word matching. Topic models as smoothing for retrieval, with the published results, correlated, dynamic, supervised, and nonparametric models, nonnegative matrix factorization, and neural and embedding-based methods. As the last article of the course, it closes with a look back.
  • Limits of the vector space model describes the vocabulary problem that LSI was designed to address.
  • Text clustering solves the hard version of the same problem, one group per document.
  • The 2-Poisson model and k-means are where the course first met the mixture models and expectation-maximization that pLSA and LDA build on; the pLSA article derives EM in general.

Course materials

The course did not reach this topic, and there was no assignment for it. The experiments were written for this site and are in tools/experiments/topics/ in the site repository. Each article ends with worked problems posed on the six documents and, in the evaluation article, on the Reuters counts it prints, since there are no assignment problems to solve. Their numbers are verified by the same scripts.

References

  • Blei, D. M. (2012). Probabilistic topic models. Communications of the ACM, 55(4), 77–84. record · 2 pages
  • Blei, D. M., Ng, A. Y., and Jordan, M. I. (2003). Latent Dirichlet allocation. Journal of Machine Learning Research, 3, 993–1022. record · 6 pages
  • Deerwester, S., Dumais, S. T., Furnas, G. W., Landauer, T. K., and Harshman, R. (1990). Indexing by latent semantic analysis. Journal of the American Society for Information Science, 41(6), 391–407. record · 4 pages
  • Manning, C. D., Raghavan, P., and Schütze, H. (2008). Introduction to Information Retrieval, chapter 18. Cambridge University Press. record · 102 pages

Reviewed: verified, 16 Nov 2026 · citations checked, 16 Nov 2026 · editorial review, 16 Nov 2026 · 7 revisions