Abstract
A recent line of work in natural language processing has aimed to combine language models and topic models. These topic-guided language models (TGLMs) augment neural language models with topic models, unsupervised learning methods that can discover document-level patterns of word use. This paper compares the effectiveness of these methods in a standardized setting. We study four topic-guided language models and two baselines, evaluating the held-out predictive performance of each model on four corpora. Surprisingly, we find that none of these methods outperform a standard LSTM language model baseline, and most fail to learn good topics. Further, we train a probe of the neural language model that shows that the baseline's hidden states already encode topic information. We make public all code used for this study.
Introduction
Recurrent Neural Networks (RNNs) and Long Short-Term Memory (LSTM) networks are the traditional workhorses for capturing local syntax in natural language processing. However, they are often criticized for struggling with long-range dependencies and global document-level semantics. To bridge this gap, researchers developed Topic-Guided Language Models (TGLMs), which integrate latent topic models (like Latent Dirichlet Allocation) into neural architectures. The promise was twofold: improved predictive performance (lower perplexity) and more interpretable latent structures. This study provides a rigorous, standardized re-evaluation to determine if these complex hybrid models actually provide a benefit over a well-tuned, standard LSTM baseline.
Methodology
The authors conduct a reproducibility study by implementing and evaluating four representative TGLM architectures:
- TopicRNN: Uses a global topic vector to bias the output distribution.
- TDLM (Topically Driven Language Model): Employs a Gated Recurrent Unit (GRU) to combine hidden states with topic information.
- VRTM (Variational Recurrent Topic Model): Treats the language model as a mixture of RNNs weighted by topic proportions.
- rGBN-RNN: A hierarchical model with multiple stochastic layers.
A critical component of this evaluation is the use of a "document-level" LSTM baseline. Unlike "sentence-level" models that reset their memory after every sentence, this baseline retains its hidden state across sentence boundaries within a document, matching the contextual information available to the TGLMs.
Analysis: The Implicit Topic Model
The most striking finding is that LSTMs are effectively "closet" topic models. The authors trained a linear probe to predict document topic proportions from the hidden states of a standard, non-topic-guided LSTM. The probe could explain up to 62% of the variance in topic proportions, suggesting that if the LSTM already implicitly captures the topic, adding an explicit topic model component is largely redundant.
Furthermore, the study identifies a "look-ahead" flaw in previous TGLM evaluations. Some models were found to be "cheating" by using the entire document (including future words) to estimate the topic for predicting the next word. When restricted to using only previous words—as required in real-world applications—their performance gains vanished.
Empirical Results
The models were evaluated on four diverse corpora: APNEWS, IMDB, BNC, and WikiText-2. As shown in the results table, the standard document-level LSTM matched or beat the TGLMs in almost every case. For example, on the APNEWS dataset, the LSTM baseline achieved a perplexity of 56.5, while TopicRNN and VRTM scored 56.6 and 56.8, respectively.
Beyond perplexity, the study found that neural TGLMs often produced lower-quality topics compared to classical LDA. Using the NPMI (Normalized Pointwise Mutual Information) metric, classical LDA consistently produced more coherent and interpretable word lists than the neural variants.
Conclusion
This re-evaluation demonstrates that for predictive tasks like next-word prediction, TGLMs do not offer a clear advantage over well-tuned, document-level LSTMs. The inherent capacity of LSTMs to encode global semantic context in their hidden states renders explicit topic guidance largely unnecessary for perplexity-based performance. While TGLMs might still hold value for controllable generation tasks, their role as a general improvement for language modeling should be reconsidered. Future work should investigate whether these findings extend to Transformer-based architectures, which are even more expressive and likely to capture topic information implicitly.
Summary updated