Topic Modeling Revisited: A Document Graph-based Neural Network Perspective

Dazhong Shen, Chuan Qin, Chao Wang, Zheng Dong, Hengshu Zhu, Hui Xiong

Introduction

For decades, topic modeling has relied heavily on the bag-of-words (BOW) assumption, which treats words in a document as exchangeable, independent units. While this simplifies the underlying mathematics, it ignores a fundamental truth of language: words are inherently connected.

By ignoring word order and dependency, traditional models miss out on the rich semantic context provided by linguistic structure. This often leads to topic ambiguity. For example, a topic might contain the word "network," which is vague on its own. However, knowing it frequently connects to "neural" or "social" provides the specific context needed for true interpretability.

To address this, the Graph Neural Topic Model (GNTM) moves beyond the traditional BOW assumption by representing documents as directed graphs of word dependencies. By combining Graph Neural Networks (GNNs) with a novel generative story, the model captures semantic relationships between words, resulting in significantly more interpretable topics and superior document clustering performance compared to state-of-the-art baselines.

Example of a document graph and its corresponding directed probabilistic model.

Methods: The Graph Neural Topic Model

GNTM treats each document as a directed semantic graph where nodes are words and edges represent dependencies (defined by a sliding window of neighboring words).

This approach introduces a new definition of a "topic." In GNTM, a topic is not just a distribution over a vocabulary; it is a dual distribution over both words (the "what") and word dependency edges (the "how they relate"). The model follows a four-step probabilistic process to generate both the graph's structure (where edges go) and the specific words at each node.

To handle the computational complexity of this graph-based generative story, the authors employ a Neural Variational Inference (NVI) framework based on Variational Autoencoders (VAEs):

  • Encoder: Uses a Graph Convolutional Network (GNN) to "read" the document graph, capturing local structural information, and maps it to a latent global topic distribution.
  • Decoder: Attempts to reconstruct both the word set and the graph structure from that latent distribution.
The overall architecture of the Graph Neural Topic Model (GNTM), featuring a GNN-based encoder and a graph-generating decoder.

Interestingly, the authors mathematically demonstrate that classic Latent Dirichlet Allocation (LDA) is actually a special case of GNTM where the document has no word dependencies (an empty edge set).

Key Insights and Performance

The model was evaluated on four widely used benchmark text datasets: 20 News Groups (20NG), Tag My News (TMN), the British National Corpus (BNC), and Reuters-21578.

Context and Topic Relationships

By modeling edges, GNTM can distinguish between different uses of the same word. For instance, in a "Space" topic, it learns the strong link between "satellite" and "orbit," whereas a BOW model just sees them as two independent words that happen to be nearby. Furthermore, the model learns a "Topic Dependency Matrix" that reveals how topics interact—for example, showing that a "General" topic has high connectivity to almost all specific technical topics.

Quantitative Results

  • Coherence and Diversity: GNTM consistently outperformed baselines (including LDA, ProdLDA, and ETM) in Topic Coherence (measured via NPMI and $C_v$ metrics). Crucially, it improved coherence without sacrificing Topic Diversity, meaning the topics remained distinct and non-redundant.
  • Document Clustering: In tasks where the model had to group documents by category, GNTM showed a significant lead in Purity and Normalized Mutual Information (NMI). On the 20NG dataset, it achieved a Purity score of 0.5021, notably higher than LDA (0.3740) and ETM (0.4616).

Qualitative Clarity

Visualization of the learned topics showed clear sub-clusters. For example, within a space-related topic, the model successfully grouped "celestial bodies" (moon, planet) separately from "space exploration" (nasa, shuttle, mission).

Limitations and Future Work

While GNTM represents a significant step forward, it currently builds document graphs using a simple sliding window. The authors acknowledge that using more sophisticated dependency parsing (analyzing actual grammatical roles) could further improve the model. Additionally, the current graph only considers one type of relationship between words. Future work could explore multi-relational graphs to distinguish between different types of linguistic links, such as synonyms versus subject-verb relationships. Finally, building and processing graphs for every document does introduce computational overhead compared to standard BOW approaches, though the NVI framework helps mitigate scaling issues.

Summary updated

BibTeX
@inproceedings{shen2021topic,
  author = {Dazhong Shen and Chuan Qin and Chao Wang and Zheng Dong and Hengshu Zhu and Hui Xiong},
  title = {{Topic Modeling Revisited: A Document Graph-based Neural Network Perspective}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
}
Figure