Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Every word chooses a topic
Imagine each document has a recipe (“70% space, 30% music”), each topic has a favourite set of words, and each word in the document was produced by first picking a topic from the recipe and then a word from that topic. pLSA learns the recipes and the topics from word counts by repeatedly guessing which topic produced each word and updating its estimates. It is the direct ancestor of LDA, and comparing the two shows why priors matter.
pLSA’s EM algorithm is the clearest worked example of fitting a latent-variable mixture to count data. It is also equivalent to non-negative matrix factorisation with a KL loss, a tool used for spectra, sensor activity patterns and usage logs. Its overfitting behaviour explains why Bayesian priors became standard.
- 1. In pLSA, each word is generated by…
- 2. pLSA is fitted by…
- 3. pLSA's document mixtures are…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.The aspect model and EM by hand
Model. p(w | d) = Σ_z p(z | d) p(w | z). With p(z | d) = (0.2, 0.8) and topics (1, 0, 0) and (0, ½, ½), the word probabilities are (0.2, 0.4, 0.4).
E-step. For each document–word pair, compute the topic responsibilities:
p(z | d, w) ∝ p(z | d) p(w | z).
With p(z | d) = (½, ½) and p(w | z) = (0.3, 0.1): (0.75, 0.25).
M-step. Re-estimate from expected counts n(d, w) p(z | d, w):
- p(w | z) ∝ Σ_d n(d, w) p(z | d, w);
- p(z | d) ∝ Σ_w n(d, w) p(z | d, w).
Log-likelihood. L = Σ_d Σ_w n(d, w) log p(w | d). EM never decreases it.
Parameters. D(K − 1) + K(V − 1): 686 for 150 documents, 4 topics and 60 words. Doubling the documents roughly doubles the count, because the document mixtures are free parameters.
The steps in plain English:
- Initialise p(z | d) and p(w | z) randomly.
- E-step: responsibilities for every observed document–word pair.
- M-step: renormalise the weighted counts into both distributions.
- Repeat until the log-likelihood stops improving; for new documents, fold in by running EM on p(z | d) with p(w | z) fixed.
- 1. The E-step computes…
- 2. EM's log-likelihood over iterations is…
- 3. New documents in pLSA need…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 30 minUndergraduate students and practising engineers.Links, and why it overfits
pLSA = KL-NMF. Writing the document–word count matrix as approximately WH, with W the document–topic weights and H the topic–word weights, and minimising the generalised KL divergence gives exactly pLSA’s EM updates, up to normalisation (Gaussier and Goutte, 2005; Ding et al., 2008). LSA does the same with squared error and no non-negativity.
Overfitting. Each document’s mixture is fitted to its own words. With many topics and short documents, each document can choose a mixture that explains its particular words almost exactly, so training perplexity keeps falling as K grows while held-out perplexity rises. Folding-in also estimates a fresh mixture from a few observed words, which overfits in turn.
Fixes.
- Tempered EM (Hofmann): raise the E-step posteriors to a power β < 1, softening assignments, and choose β on held-out data.
- LDA: put a Dirichlet prior on p(z | d), making the mixtures random variables rather than parameters, so the parameter count no longer grows with the corpus and new documents are handled by the generative model.
Exercise 1 (150 documents from 4 topics):
- the log-likelihood rose monotonically from −26 360 to −18 477;
- the recovered topics matched the truth with cosine 0.999, 1.000, 1.000, 1.000;
- the model has 686 free parameters, 3 per document for the mixtures.
from sklearn.decomposition import NMF
W = NMF(n_components=4, beta_loss="kullback-leibler", solver="mu", max_iter=500).fit_transform(counts)
# rows of W and of nmf.components_, renormalised, give p(z | d) and p(w | z) as in pLSA- 1. pLSA is equivalent to non-negative matrix factorisation with…
- 2. pLSA's parameter count grows with…
- 3. Tempered EM uses an exponent β…
Level 3: Advanced
★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.Theory
EM as minorisation. The log-likelihood is bounded below by Σ n(d, w) Σ_z q(z) log(p(z | d) p(w | z)/q(z)) for any q. The E-step makes the bound tight (q = posterior), and the M-step maximises it in closed form. That proves monotonicity, but not convergence to the global optimum. pLSA has many local optima, so several restarts are standard.
Is pLSA a generative model? Only for the training documents: d is an index, and there is no distribution for generating a new document’s mixture. Blei et al. (2003) cited this as the motivation for LDA. Girolami and Kabán (2003) showed that pLSA is a maximum a posteriori special case of LDA with a uniform Dirichlet prior (α = 1).
Interview questions.
- pLSA or LDA? LDA for most purposes: it handles new documents in a principled way, regularises, and its parameter count does not grow with the corpus. pLSA or KL-NMF remain useful as fast, deterministic baselines and when the corpus is fixed.
- How does pLSA relate to LSA? LSA is a truncated SVD of the (weighted) document–term matrix, with squared error and possibly negative values. pLSA is a probabilistic, non-negative factorisation with a likelihood objective.
- 1. The EM E-step makes the lower bound…
- 2. pLSA corresponds to MAP estimation in LDA with…
- 3. Because pLSA has many local optima, practitioners…
Level 4: Expert
★★★★★ Expert⏱ 25 minResearchers: original papers and open problems.Overfitting as topics grow
History.
- S. Deerwester et al. (1990) introduced LSA.
- T. Hofmann (1999) introduced pLSA and tempered EM.
- D. Lee and H. S. Seung (1999, 2001) introduced NMF and its multiplicative updates.
- D. Blei, A. Ng and M. Jordan (2003) introduced LDA.
- M. Girolami and A. Kabán (2003) related pLSA to LDA.
- E. Gaussier and C. Goutte (2005) related pLSA to NMF.
Exercise 2. Only 40 short training documents (40 words each) generated from 4 topics over 60 words. Each cell gives training perplexity, then held-out document-completion perplexity on 60 new documents: folding-in for pLSA, and variational inference for LDA.
| K | pLSA | pLSA, tempered (β = 0.8) | LDA |
|---|---|---|---|
| 2 | 14.12, 16.93 | 14.25, 16.26 | 14.36, 16.74 |
| 4 | 9.11, 11.42 | 9.18, 10.08 | 9.27, 9.34 |
| 8 | 8.65, 13.02 | 9.03, 10.10 | 9.07, 9.48 |
| 16 | 8.15, 17.64 | 8.84, 10.23 | 9.11, 9.64 |
- pLSA overfitted as K grew: training perplexity fell to 8.15 at K = 16 while held-out perplexity nearly doubled, to 17.64, worse than with just 2 topics.
- Tempered EM held the held-out perplexity near 10 for every K above 2, at the cost of a slightly worse training fit.
- LDA was the most robust (9.3–9.6 for K ≥ 4), with training and held-out perplexity close together. The Dirichlet prior keeps short documents from claiming idiosyncratic mixtures, and its inference for new documents is principled rather than ad hoc folding-in.
pLSA and KL-NMF in AI, robotics and aerospace
- Spectral unmixing: decomposing non-negative spectra (vibration, acoustic, hyperspectral) into source signatures with KL-NMF.
- Usage patterns: latent “modes” in counts of events per flight or per asset.
- Fixed-corpus topic summaries: quick deterministic topic baselines for a closed set of reports.
References
- T. Hofmann (1999). “Probabilistic latent semantic analysis.” Proc. UAI.
- T. Hofmann (2001). “Unsupervised learning by probabilistic latent semantic analysis.” Machine Learning 42(1–2).
- M. Girolami, A. Kabán (2003). “On an equivalence between PLSI and LDA.” Proc. ACM SIGIR.
- E. Gaussier, C. Goutte (2005). “Relation between PLSA and NMF and implications.” Proc. ACM SIGIR.
- D. D. Lee, H. S. Seung (2001). “Algorithms for non-negative matrix factorization.” Advances in NeurIPS 13.