Blei 2003 - LDA Generative Model and Exchangeability
Summary
Terminology: words (vocabulary items as unit-basis vectors), documents (sequences of words), corpora ( documents). LDA draws per document, a topic per word, then . Exchangeability of words and topics within a document plus de Finetti’s theorem motivates the mixture form.
Main Content
Notation. A word is with and (); a document ; a corpus . The model is not tied to text (collaborative filtering, image retrieval, bioinformatics).
LDA generative process (Sec. 3)
For each document: (1) ; (2) ; (3) for each of words: and , a multinomial with ( is ). Simplifying assumptions: fixed and known; a fixed quantity to estimate; the Poisson length is ancillary and ignored.
Dirichlet density (Eq. 1)
on the -simplex; exponential family, conjugate to the multinomial.
Joint, document and corpus likelihood (Eqs. 2-3)
Three levels: corpus-level (sampled once), document-level, word-level. This differs from a Dirichlet-multinomial clustering model, which samples the cluster once per document: in LDA the topic node is resampled within the document, so a document can exhibit multiple topics. The structure is a conditionally independent hierarchical model (Kass and Steffey 1989), and are estimated by parametric empirical Bayes in the simple implementation.
Exchangeability and the continuous mixture of unigrams (Secs. 3.1-3.2)
Words and topics are assumed infinitely exchangeable within a document; by de Finetti, . Marginalising : , so LDA is a continuous mixture of unigrams , with only parameters but a multimodal density on the word simplex (Fig. 2).
Examples
Marginalising the topics
Take . For a 5-word document the likelihood given and is , the product of mixture word probabilities; summing over all topic assignments gives exactly the same number. This is the identity used to “sum out token topics” in gradient-based samplers (see Blei 2003 - LDA Beyond Text Baskets and Sessions).
import numpy as np
rng = np.random.default_rng(0)
K, V, N = 3, 6, 5
phi = rng.dirichlet(np.ones(V) * .5, K); th = rng.dirichlet(np.ones(K) * .5)
w = rng.integers(0, V, N)
explicit = np.prod([sum(th[k] * phi[k, wn] for k in range(K)) for wn in w])
print(explicit, np.prod((th @ phi)[w])) # equalConnections
Hierarchical Models for the shared-hyperparameter structure. Compare with DP-based clustering: Teh 2010 - DP Mixture Models and Applications.