- Introduced by
- Multiple groups (building on Lee & Seung, 1999; self-supervised extensions ca. 2020–2022)
- Year
- 2020–2022
- Type
- Unsupervised / self-supervised topic model
- Family
- Deep learning / NLP / CV
What does it do?
The Self-supervised NMF Topic Model applies Non-negative Matrix Factorization to text corpora and adds a self-supervised auxiliary objective, such as masked-word reconstruction or a contrastive loss, to the factorization.
The auxiliary term is intended to push the discovered topics toward more semantically meaningful groupings. The method needs no human-labeled data. Its gain in topic quality over plain NMF is not firmly established, so it should be checked on each target corpus.
The intuition behind the method
Classical NMF factorizes a document-term matrix into topics and per-document topic weights, but it uses only word co-occurrence patterns. This variant adds a training signal derived from the corpus itself, for example by predicting hidden words or by pulling together two augmented views of one document. The intended effect is topics that match human-interpretable themes more closely, with no annotated data required. Whether this works on a given corpus is an empirical question, best checked with coherence scores and by reading the top words of each topic.
History
Non-negative Matrix Factorization was introduced by Lee and Seung in 1999 as a parts-based representation method (Nature). The closest verified self-supervised NMF work is Shi et al. (2022), which applies NMF-based contrastive learning to semi-supervised node classification on graphs rather than to text topic models. Specific originators and dates for self-supervised NMF topic models are not firmly established, so any attribution to a single group or period should be treated with caution and checked against primary literature.
When to use it
Choose this method when you need interpretable topics from a text corpus without labels, and plain NMF or LDA produces topics that are hard to interpret. It suits settings where a self-supervised signal can be defined naturally from the text, such as masked-word prediction. Do not use it when labeled data is sufficient for a supervised classifier, when the corpus is very small (fewer than a few hundred documents), or when you need per-document topic probabilities with uncertainty estimates. In that last case a neural variational model such as ProdLDA may be more appropriate.
Limitations and considerations
- Number of topics K must be specified in advance; topic quality is sensitive to this choice.
- Self-supervised signal design requires domain knowledge — wrong augmentation strategies can hurt topic coherence.
- Convergence is to a local optimum; random initialization can lead to variable results across runs.
- Joint hyperparameter tuning (lambda, K, augmentation policy) adds complexity compared to vanilla NMF or LDA.
- Lacks an explicit probabilistic generative model, so Bayesian uncertainty estimates over topics are not available.
- Its performance relative to LDA or ProdLDA is not established, so it must be measured directly on the target corpus.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- The non-negativity constraint gives parts-based, additive topic representations, a property inherited from NMF (Lee and Seung, 1999).
- No labeled documents are required, so the method applies to unannotated corpora; the auxiliary signal is computed from the text itself.
- The self-supervised objective can be swapped (masked, contrastive, or pseudo-label) to suit the corpus, although each choice needs its own tuning.
- When the input is a word-count or TF-IDF matrix, topics remain lists of weighted words, so the word-level interpretability of bag-of-words NMF is kept.
Applications
- Exploratory topic discovery in unannotated document collections such as news, scientific abstracts, or social media posts.
- Using document-topic weights as features for downstream classification when labeled data is scarce.
- Exploratory coding of open-ended survey responses in social science research.
- Organizing a text corpus into interpretable groups to support clustering or retrieval.
How it works
How it works
The corpus is represented as a non-negative matrix X of shape D x V, with D documents and V vocabulary terms, where each entry holds a word count or a TF-IDF weight. Non-negativity matters because NMF treats its factors as additive, parts-based contributions, which is why topics can be read as mixtures of words (Lee and Seung, 1999).
Formula
X \in \mathbb{R}_{\geq 0}^{D \times V}X is approximated by the product W H, where W (D x K) holds document-topic weights and H (K x V) holds topic-word weights, and both are non-negative. Each row of H is a topic over the vocabulary, and each row of W gives one document's mixture of the K topics.
Formula
X \approx W H, \quad W,H \geq 0
An auxiliary objective is defined from the corpus itself, without labels. The options are masked-token reconstruction (predicting hidden words from their context), contrastive learning (bringing augmented views of the same document closer while separating different documents), and pseudo-label consistency. The method does not fix one explicit expression for this term. The exact loss, such as a cross-entropy loss for masked-word prediction or a contrastive loss over document views, is determined by the chosen implementation.
The loss adds the NMF reconstruction error, the squared Frobenius norm of X minus WH, to the self-supervised term, weighted by the hyperparameter lambda. The formula shown is a general template and becomes a complete objective only once the auxiliary term is specified. The optimizer is likewise set by the implementation; multiplicative updates and projected gradient methods are common choices for NMF-type problems. The self-supervised term is intended to act as a regularizer that steers W and H toward factors consistent with the auxiliary signal.
Formula
\mathcal{L} = \|X - WH\|_F^2 + \lambda \mathcal{L}_{\text{self-sup}}After optimization, each row of H is read as a topic and labelled by its highest-weighted vocabulary words. The document-topic weights in W show how strongly each document loads on each topic and can feed clustering, retrieval, or classification. W and H are unnormalized non-negative weights. To read them as probabilities, rescale each row of H to sum to one for topic-word distributions and each row of W to sum to one for document-topic proportions. Because the overall scale of the factors is arbitrary, features taken from W should be standardized consistently before use in a downstream classifier.
Common pitfalls
- Choosing K without comparing topic coherence (for example NPMI) across candidate values.
- Importing an image-style augmentation such as random cropping into text without adapting it to tokens and sentences.
- Ignoring preprocessing choices: stopword removal, vocabulary size, and minimum document frequency all change which topics appear.
- Reporting only reconstruction error, which does not show whether the topics are coherent or interpretable.
- Treating the topic-word weights in H as probabilities without normalizing each row.
Frequently asked questions
How is this different from standard NMF for topic modeling?
Standard NMF minimizes only the reconstruction error between the document-term matrix and its factorization, relying entirely on word co-occurrence. Self-supervised NMF adds an auxiliary loss derived from the data itself, such as masked word prediction or contrastive document pairing. This loss is intended to steer the factors toward more semantically coherent topics. Whether it improves topic quality over standard NMF is an empirical question, best answered with coherence scores on the target corpus.
How do I choose the number of topics K?
Run the model over a range of K values and compare the solutions using a topic coherence metric such as NPMI (Normalized Pointwise Mutual Information), computed from word co-occurrence statistics over the documents. Reconstruction error or perplexity alone does not show whether topics are coherent, and reading the top words of each topic is a useful complement to automated scores.
Which self-supervised objective should I use?
No single self-supervised objective is established as giving the best topics, so the choice is empirical. Masked-word reconstruction is a reasonable starting point because it does not require designing an augmentation. If coherence stays low, compare a contrastive objective with a text augmentation suited to documents, since augmentation design can strongly affect results.
Can I use pretrained BERT embeddings instead of a bag-of-words matrix?
Not as a standard part of this method. Standard NMF requires a non-negative input matrix, and the input described on this page is a bag-of-words or TF-IDF matrix, which satisfies that requirement. Using contextual embeddings would require a non-negative transformation of the embedding matrix (D x d), and no such transformation is established for this method, so the user would need to choose and document one. The change also alters the semantic character of the topics, which are then no longer simple lists of vocabulary weights, reducing direct word-level interpretability.
Is the result reproducible across runs?
NMF and its self-supervised extensions are non-convex and converge to local optima. Multiple random restarts with different initializations are strongly recommended, and the best solution should be selected by topic coherence score rather than reconstruction loss alone.
Related methods
Sources
Shi, T., Guo, X., Lv, J., & Yu, P. S. (2022). Self-supervised NMF-based graph contrastive learning for semi-supervised node classification. In Proceedings of the 36th AAAI Conference on Artificial Intelligence.
Open publication referenceLee, D. D., & Seung, H. S. (1999). Learning the parts of objects by non-negative matrix factorization. Nature, 401(6755), 788–791.
Open DOI reference