- Introduced by
- Jagarlamudi et al.; Andrzejewski et al.
- Year
- 2009–2012
- Type
- Probabilistic generative model with weak supervision
- Family
- Deep learning / NLP / CV
What does it do?
Weakly Supervised LDA is an extension of Latent Dirichlet Allocation that adds light human guidance, typically keyword seeds or must-link and cannot-link constraints, to the Dirichlet priors.
The guidance steers learned topics toward predefined themes without requiring fully labeled documents. It lies between unsupervised LDA and supervised classification, and is suited to corpora where labeling many documents is impractical.
The intuition behind the method
Standard LDA discovers topics from word co-occurrence alone, so the resulting topics are often statistically coherent but do not always match the categories an analyst cares about. Weakly supervised LDA lets the analyst supply a few seed words per topic, for example 'vaccine, immunity, antibody' for a health topic. The seeds act as nudges on the prior terms rather than as labels. The model still learns from the data, but the seeds shift the probabilistic solution so that discovered topics are more likely to correspond to the intended themes. The supervision is 'weak' because the seeds are sparse hints, not exhaustive annotations of documents.
History
The idea of encoding prior knowledge into LDA priors developed between 2009 and 2012. Andrzejewski et al. (2009) introduced Dirichlet Forest priors that encode must-link and cannot-link word constraints. Jagarlamudi et al. (2012) proposed lexical priors built from user-specified seed lexicons. Both works showed how domain knowledge can be built into topic models through priors, but they differ in the form of knowledge they encode.
When to use it
Choose weakly supervised LDA when you have a large unlabeled text corpus, a clear conceptual structure you want the topics to reflect, and no budget to label many documents per class. It is often used in social science, public health and policy research, where domain experts can supply seed keywords. Prefer it to plain LDA when unsupervised topics are ambiguous or split themes you consider conceptually unified. Do not use it in place of supervised classification when substantial labeled data exist, since a fine-tuned transformer is generally the stronger choice there. Avoid it when the desired topics conflict with the word co-occurrence structure of the corpus, because the seeds will then have little empirical support in the text.
Limitations and considerations
- Seed quality matters: poorly chosen seeds can produce topics that are worse than those from plain LDA.
- The number of topics K must still be specified in advance, and a poor choice of K affects results regardless of the seeds.
- If the text provides little evidence for a conceptual distinction, the seeds cannot create that distinction in the topics.
- Interpretability depends on seed design, which requires real familiarity with the domain.
- Seeded topics are not guaranteed to match the analyst's intent; the model may absorb a seed into a cluster that is somewhat shifted from the intended one.
- Assumes bag-of-words exchangeability: word order and syntax are ignored, and each document is treated as a mixture of a fixed number K of topics with Dirichlet priors.
- Assumes that seed words actually co-occur with their intended topic in the corpus; seeds that rarely appear alongside the topic have little support in the data.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Incorporates domain knowledge with little annotation effort, since a few seed words per topic can be enough.
- Topics are often more interpretable and closer to the research question than those from unsupervised LDA.
- Keeps the generative structure of LDA, so the output includes document-topic distributions.
- Seed strength can be tuned through lambda, and seed lists can be revised after inspecting the output.
- Inference uses the standard LDA sampler, so the per-iteration computation is of the same kind as in standard LDA.
Applications
- Policy and media analysis, where researchers need topics aligned with predefined thematic categories.
- Public health surveillance, steering topics toward disease, treatment and symptom themes in social media data.
- Social science research in which theory-driven topic definitions are matched to large corpora.
- Qualitative coding support, using seed words derived from a codebook to semi-automate document categorization.
- Customer feedback and survey analysis where the relevant dimensions are known to the analysts in advance.
How it works
How it works
The analyst defines K target topics and supplies a small set of seed words for each, typically 3–10, chosen from domain knowledge or a reading of part of the corpus. The seeds are a lightweight, easily revised encoding of intent and require no document-level annotation.
Seed information enters through the Dirichlet priors as an additive boost whose size is set by the strength parameter lambda, which scales the seed vector s_k as in the mechanics step. Which prior receives the boost depends on the seeded formulation, and the mechanics step gives one such form. Constrained variants such as Dirichlet Forest priors (Andrzejewski et al., 2009) encode must-link and cannot-link word relations in a different form.
Formula
\alpha_k \leftarrow \alpha_k + \lambda \cdot \mathbf{s}_kInference follows the standard LDA machinery. The collapsed Gibbs update shown in the topic-assignment step is one option, and variational EM is an alternative. The seeds change the prior values under which inference is run; the inference procedure itself is unchanged.
Each word is reassigned in turn with probability proportional to (n_dk + alpha_k)(n_kw + beta)/(n_k + V beta), following the mechanics step. In this update the seed influence reaches the sampler only through the prior terms, so it is indirect. The count statistics are those of standard collapsed Gibbs sampling for LDA.
Formula
p(z_i=k \mid w_i, \mathbf{z}_{-i}) \propto (n_{dk} + \alpha_k)(n_{kw} + \beta) / (n_k + V\beta)Learned topics are checked with held-out perplexity, topic coherence (for example NPMI), and review of the top words per topic. Comparing these measures across several candidate values of lambda shows how strongly the seeds shape the solution. Whether the top words agree with the seed-defined topics indicates whether the seeds shaped the solution, but agreement alone does not establish that the topics are good.
Common pitfalls
- Using seeds that are rare in the corpus. Rare words contribute few counts to the word-topic statistics, so their influence on inference is small and hard to verify.
- Over-constraining with many seeds per topic, which can suppress the model's ability to find genuine subthemes.
- Treating seed alignment as a quality indicator without checking topic coherence.
- Applying weakly supervised LDA when a supervised classifier is feasible, which can give less precise category assignments than a classifier trained on the same labels.
- Failing to iterate: seed design is interpretive and should be revised after inspecting the initial topics.
Frequently asked questions
How many seed words per topic are typically sufficient?
Typically 3–10 seeds per topic are used. Seeds should be frequent, unambiguous words for the topic. Too few seeds give weak guidance, while too many can over-constrain the model and suppress data-driven variation. The right number should be checked against the topic output rather than fixed in advance.
What happens if my seeds are rare in the corpus?
Rare seeds have limited influence because the word-topic count statistics that the sampler uses are based on few occurrences. Check that each candidate seed occurs often enough to be estimated reliably in your corpus before relying on it.
How does this differ from fully supervised text classification?
Weakly supervised LDA requires no document-level labels; it infers topic mixtures from word co-occurrence, guided by seeds. Supervised classifiers need labeled examples for each class and learn discriminative boundaries rather than generative topic mixtures. When labeled data are available, supervised classifiers, especially fine-tuned transformers, are generally the stronger choice for classification.
Can I use weakly supervised LDA with short texts such as tweets?
Standard LDA and its weakly supervised variants assume that documents contain enough words to estimate topic mixtures, so very short texts are problematic. Aggregating texts before modelling, for example by user, hashtag or time window, usually gives more coherent topics.
How do I choose the number of topics K?
Start from domain knowledge about the number of conceptual categories, then compare candidate values of K using held-out perplexity and topic coherence. When seeds define categories, some setups add free topics beyond the seeded ones to absorb content the seeds do not cover.
How should the seed-strength parameter lambda be chosen?
Fit the model over a small grid of lambda values and compare topic coherence, held-out perplexity and how cleanly the seed-defined topics emerge. If a higher lambda pushes seed words into several topics at once or sharply lowers coherence, the seeds are over-constraining the model. If the seeded topics barely differ from those of unsupervised LDA, the seeds have too little influence. Choose the value that gives coherent, interpretable topics aligned with the research question, and record it together with the seed list.
Related methods
Sources
Jagarlamudi, J., Daume III, H., & Udupa, R. (2012). Incorporating Lexical Priors into Topic Models. Proceedings of the 13th Conference of the European Chapter of the Association for Computational Linguistics (EACL 2012), pp. 204–213.
Open publication referenceAndrzejewski, D., Zhu, X., & Craven, M. (2009). Incorporating Domain Knowledge into Topic Modeling via Dirichlet Forest Priors. Proceedings of the 26th International Conference on Machine Learning (ICML 2009), pp. 25–32.
Open publication reference