Efficient Methods for Incorporating Knowledge into Topic Models

Yi Yang, Doug Downey, Jordan L. Boyd-Graber

Introduction

Latent Dirichlet Allocation (LDA) has long been a foundational tool for discovering thematic structures in large document collections. However, as an unsupervised method, it frequently produces "junk" topics that lack human interpretability. While researchers have attempted to guide these models by injecting prior knowledge—such as word correlations or document labels—these supervised variants often suffer from a significant "computational tax." This paper introduces Sparse Constrained LDA (SC-LDA), a framework designed to incorporate complex constraints without sacrificing the scalability required for industrial-scale datasets.

The Scalability-Supervision Trade-off

Standard Gibbs sampling for LDA typically scales linearly with the number of topics ($T$). When complex prior constraints (e.g., "must-link" or "cannot-link" word pairs) are introduced, the mathematical complexity increases, often breaking the efficient sampling algorithms used for large-scale applications. Consequently, practitioners are often forced to choose between the interpretability of supervised models and the performance of unsupervised ones.

Sparse Constrained LDA (SC-LDA)

The authors propose SC-LDA to bridge this gap by combining a factor graph framework with the efficiency of SparseLDA. The core innovation lies in how the model handles "potentials"—functions that reward or penalize topic assignments based on prior knowledge.

Exploiting Sparsity

A key observation in large-scale topic modeling is that most words are only relevant to a small subset of topics. In a model with 500 topics, the vast majority of word types appear in fewer than 50 topics. SC-LDA exploits this inherent sparsity by only updating topic "buckets" that are relevant to a specific word or document, rather than recalculating the influence of prior knowledge for every possible topic.

Distribution of word types across nonzero topics, illustrating the inherent sparsity that SC-LDA exploits.

By decomposing the sampling equation into three distinct components—smoothing-only, document-only, and word-topic counts—SC-LDA achieves sub-linear update times. Furthermore, the introduction of a correlation strength hyperparameter ($\lambda$) allows the model to ignore constraints for topics with negligible counts, further preserving computational resources.

Experimental Evaluation

The framework was evaluated across three diverse benchmarks:

  • NIPS: 1,500 papers used for word correlation experiments.
  • NYT-News: 3 million articles (100M tokens) to test large-scale word correlation.
  • 20 Newsgroups (20NG): 18,800 posts used for document label experiments.

Results: Speed and Coherence

SC-LDA demonstrates significant improvements in both efficiency and topic quality. On the 20 Newsgroups dataset with 500 topics, SC-LDA outperformed the standard Labeled-LDA baseline by more than 10x.

Rapid Convergence

In large-scale tests on the NYT-News dataset, SC-LDA reached likelihood convergence significantly faster than other state-of-the-art methods, such as MRF-LDA or DF-LDA. This efficiency makes it feasible to apply supervised topic modeling to datasets comprising millions of documents.

Log likelihood change over time, showing the significantly faster convergence of SC-LDA compared to baseline models.

Improved Topic Quality

Beyond speed, SC-LDA improves the semantic coherence of the resulting topics. On the NIPS dataset, it successfully grouped rare but related words, leading to higher UMass coherence scores for the "top 20" topics compared to vanilla LDA.

Conclusion

SC-LDA provides a modular and highly efficient framework for injecting human knowledge into topic models. By leveraging the natural sparsity of topic assignments, it removes the performance barriers that previously hindered supervised LDA. This efficiency opens the door for interactive topic modeling, where users can provide real-time feedback to refine models on the fly.

Summary updated

BibTeX
@inproceedings{yang2015efficient,
  author = {Yi Yang and Doug Downey and Jordan L. Boyd-Graber},
  title = {{Efficient Methods for Incorporating Knowledge into Topic Models}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2015},
  doi = {10.18653/v1/d15-1037},
}
Figure