Abstract
Standard topic modeling algorithms often fail to capture "minority topics"—themes that are rare within a corpus but carry significant importance. This paper introduces a novel constrained Non-negative Matrix Factorization (NMF) model that utilizes a single, unified list of seed words and soft mathematical constraints to guide topic discovery. By avoiding rigid, predefined structures, the model allows for the organic emergence of sub-topics while effectively filtering background noise. Experimental results on synthetic and real-world datasets demonstrate that this approach significantly outperforms state-of-the-art baselines in both clustering accuracy and topic interpretability.
Introduction
Topic modeling is a cornerstone of text analysis, used to extract latent themes from large document collections. However, popular methods such as Latent Dirichlet Allocation (LDA), standard Non-negative Matrix Factorization (NMF), and modern neural approaches like BERTopic are inherently biased toward dominant patterns. Consequently, they often overlook "minority topics"—niche themes that appear infrequently across a corpus or briefly within individual documents.
In domains like public health or social media monitoring, these rare topics (e.g., specific mental health discussions) are often the most critical. While semi-supervised or "guided" models exist, they typically require experts to provide exhaustive prior knowledge, such as mapping specific seed words to specific topics. This over-specification limits the model's ability to discover how topics naturally manifest in real-world data. This paper proposes a flexible, constrained NMF approach to bridge this gap.
Methodology
The NMF Framework
The authors build upon the classical NMF framework, which factorizes a document-term matrix $V$ into two lower-rank matrices: $W$ (the document-topic distribution) and $H$ (the topic-word distribution). The goal is to minimize the reconstruction error, often measured using generalized Kullback-Leibler (KL) divergence.
Soft Constraints for Minority Topics
To target minority topics without over-constraining the model, the authors introduce two soft inequality constraints based on a single, unstructured pool of domain-specific seed words:
- Document Constraint ($W$): Documents that do not contain any seed words are mathematically restricted from having a high prevalence of minority topics. This prevents the "majority" background noise from being misclassified as a minority theme.
- Topic Constraint ($H$): The designated minority topics must contain at least a user-defined minimum proportion of the provided seed words.
Crucially, the remaining "majority" topics are left entirely unconstrained. This allows them to absorb the general background noise of the corpus, leaving the constrained topics free to focus on the rare signals.
Optimization
The authors formulate a Lagrangian using these constraints and apply Karush-Kuhn-Tucker (KKT) conditions. This derivation leads to custom multiplicative update rules that iteratively refine $W$ and $H$ while maintaining non-negativity and satisfying the soft constraints. This approach ensures the model remains anchored to the seeds while still allowing for the discovery of related, non-seed vocabulary.
Experimental Design
Datasets
The model was evaluated using two distinct datasets:
- Synthetic Dataset: A controlled environment of 500 documents where 18 specific mental health topics were injected into only 10% of the documents. The remaining 90% served as background noise, providing a ground truth for quantitative benchmarking.
- Finnish YouTube Comments: A real-world dataset comprising approximately 3 million comments from 20 YouTubers popular with younger audiences. This dataset was used to test the model's ability to extract nuanced mental health discussions from massive volumes of general social media chatter.
Baselines
The proposed model was compared against 11 strong baselines, including:
- Traditional: LDA, NMF.
- Guided/Semi-supervised: SeededLDA, GuidedNMF, Corex.
- Neural/Contextualized: Top2Vec, BERTopic, FASTopic.
Results and Discussion
Quantitative Performance
On the synthetic dataset, the constrained NMF model demonstrated clear superiority. It achieved the highest Normalized Mutual Information (NMI) of 0.2453 and a custom Purity score of 0.1765. For comparison, the next best guided model (GuidedNMF) achieved a Purity score of only 0.0723. Furthermore, the model achieved the lowest Jensen-Shannon Divergence (JSD) relative to the ground-truth topic distributions, indicating that the learned topics were the most representative of the actual underlying data.
Qualitative Insights
In the YouTube case study, the model successfully isolated highly interpretable and nuanced mental health themes. Rather than producing a single generic "mental health" topic, the model's flexibility allowed it to discover natural sub-divisions, such as:
- Sadness and suicide
- Family dynamics and trauma
- Treatment, therapy, and anxiety
By using soft constraints, the model avoided "seed regurgitation"—a common failure in guided models where the output merely repeats the input seeds. Instead, it discovered relevant Finnish slang and context-specific terms that were not in the original seed list.
Conclusion
This research demonstrates that flexible, soft constraints are more effective than rigid supervision for discovering rare themes in large datasets. By allowing majority topics to absorb background noise and providing a broad anchor for minority topics, the constrained NMF model achieves a high degree of granularity and accuracy. Future work will explore integrating these constraint-based methods with Large Language Models (LLMs) and incorporating human-in-the-loop evaluations to further refine topic coherence.
Summary updated