Neural Sparse Topical Coding

Min Peng, Qianqian Xie, Hua Wang, Yanchun Zhang, Xiuzhen Zhang, Jimin Huang, Gang Tian

Introduction

Topic modeling is a fundamental task in natural language processing, aimed at discovering latent themes within document collections. However, traditional methods like Latent Dirichlet Allocation (LDA) struggle with short, "noisy" texts—such as tweets or search snippets—where word co-occurrence signals are sparse. While Sparse Topical Coding (STC) was developed to address this via sparsity-inducing penalties, its reliance on complex, hand-derived inference algorithms makes it mathematically rigid and difficult to extend.

Neural Sparse Topical Coding (NSTC) bridges this gap by reframing sparse topic modeling as a neural network optimization problem. By replacing rigid graphical model inference with a flexible neural framework and incorporating pre-trained word embeddings, NSTC achieves state-of-the-art performance in extracting coherent topics from limited text data.

Methodology

The core of NSTC is a neural reconstruction of the STC framework. Unlike traditional models that require re-deriving inference equations for every architectural tweak, NSTC uses backpropagation, making the model "pluggable" and easily extensible.

Architecture

The model processes a document $d$ and word $n$ to produce a reconstruction $C(d, n)$. It leverages a "Word code layer" $s(d, n)$ and a "Word basis layer" $eta(n)$. A key innovation is the integration of pre-trained word embeddings (e.g., GloVe) as a lookup table, allowing the model to leverage external semantic knowledge to supplement the sparse information in short snippets.

The architecture of the Neural Sparse Topical Coding (NSTC) framework, illustrating the interaction between word codes, topic dictionaries, and word embeddings.

Sparsity and Extensions

To maintain interpretability and "clean" topics, NSTC applies $l_1$ norm regularization and simplex projections. The framework's flexibility allows for several structural sparsity variants:

  1. NSTCE: Utilizes a "Deep $l_1$ Encoder" for efficient sparse code approximation.
  2. NGSTC: Incorporates Group Lasso to encourage sparsity at the document level.
  3. NSTCSG: Combines individual and group sparsity via Sparse Group Lasso.
Illustration of different sparsity patterns supported by the framework: (a) standard connections, (b) group-level sparsity, and (c) sparse group-level sparsity.

Key Insights

The Advantage of Neural Inference

A significant insight of this work is that replacing tailored graphical model inference with a neural "black box" does more than simplify implementation. It makes the model faster to train and easier to extend without sacrificing the interpretability of the original sparse coding. By treating topic modeling as an optimization problem, researchers can easily swap out loss functions or add new constraints, such as the group sparsity mechanisms explored in the NGSTC and NSTCSG variants.

Embeddings as a Semantic Prior

By integrating pre-trained GloVe embeddings, NSTC effectively utilizes the "collective knowledge" of large-scale corpora (like Wikipedia) to supplement the limited information present in a single short document. This allows the model to recognize semantic relationships—for instance, identifying that "doctor" and "physician" belong to the same topic—even if those specific words never co-occur within the target dataset.

Experimental Evaluation

The models were evaluated on the 20Newsgroups dataset and the Web Snippet dataset, the latter serving as a rigorous test for short-text performance.

Key Results

  • Classification Accuracy: On the Web Snippet benchmark, the Sparse Group Lasso variant (NSTCSG) achieved an accuracy of 82.9%, significantly outperforming LDA (58.3%) and the original non-neural STC (72.3%).
  • Perplexity: NSTC demonstrated superior data fitting on 20Newsgroups with a perplexity of 517, nearly half that of LDA (1091).
  • Sparsity Ratio: Analysis confirmed that NSTC produces significantly sparser word and document codes than competing neural models like DocNADE, ensuring that documents are represented by a few salient topics rather than a broad probability smear.

Conclusion

NSTC demonstrates that replacing tailored graphical model inference with a neural "black box" enhances both flexibility and performance. By using word embeddings as a semantic prior and employing structural sparsity, the model effectively handles the challenges of short-text topic modeling. Future work may explore fine-tuning embeddings during training or integrating variational approaches to further enhance generative capabilities.

Summary updated

BibTeX
@inproceedings{peng2018neural,
  author = {Min Peng and Qianqian Xie and Hua Wang and Yanchun Zhang and Xiuzhen Zhang and Jimin Huang and Gang Tian},
  title = {{Neural Sparse Topical Coding}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2018},
  doi = {10.18653/v1/p18-1217},
}
Figure