Sub topic 9
Where LDA Struggles
Assume you know tokenisation, stop-word removal, TF-IDF, basic probability, and the idea of vector embeddings. This chapter focuses on failure modes rather than the full LDA algorithm.
Latent Dirichlet Allocation (LDA) represents each document as word counts. It assumes that word order does not matter. A document is treated as a mixture of topics, and each topic is a probability distribution over words. These assumptions make LDA understandable and useful, but they also limit what it can discover.
The bag-of-words problem
LDA sees words, not meaning or word order. Consider these documents:
the dog chased the catthe cat chased the dog
They have the same word counts, although their meanings differ. LDA also treats related words such as car, automobile, and vehicle as separate vocabulary items. Without careful preprocessing, a topic may split its probability across synonyms.
Word counts can also hide important context. The word bank may refer to finance or a river. LDA cannot reliably distinguish these meanings from the word alone, especially in short documents.
Short documents and sparse counts
LDA needs repeated word patterns to estimate useful distributions. Tweets, search queries, support-ticket titles, and short comments often contain too few words. Their topic mixtures become uncertain, and many documents may receive similar, weak probabilities.
Combining short documents can help. For example, group several messages from the same user or time period. This increases the available evidence, but it changes the unit being modelled and may hide differences between individual messages.
Choosing the number of topics
You must choose num_topics before training. Too few topics merge unrelated themes. Too many topics split one theme into narrow fragments or produce topics dominated by names and frequent terms.
The best value is not necessarily the one with the highest coherence score. Coherence can favour repetitive or overly broad topics. Compare several values and inspect:
- The top words in every topic
- Representative documents
- Topic prevalence
- Whether the topics support your task
Instability and preprocessing sensitivity
LDA uses random initialisation and approximate inference. Different random seeds can produce different topic IDs, word rankings, or even different groupings. Topic ID 0 in one run has no guaranteed relationship to topic ID 0 in another.
Results also depend strongly on tokenisation, stop words, rare-word filtering, stemming, and phrase detection. A preprocessing change can alter the vocabulary enough to change the topics.
When another method fits better
LDA suits sizeable, count-based corpora where interpretable word distributions matter. Consider BERTopic when semantic similarity matters, documents are short, or you want clusters formed from embeddings. BERTopic has its own failure modes, including embedding bias, unstable clustering, and outliers, so it is not automatically better.
Exercise
A corpus contains short product-review titles with many synonyms. Why might LDA produce weak topics, and what alternative could you test?
Show answer
The titles provide few repeated counts, and synonyms split evidence across tokens. Test BERTopic with suitable sentence embeddings, then inspect its clusters and representative documents.