Abstract
Neural Topic Models (NTMs) offer a flexible alternative to traditional probabilistic models but often struggle with topic coherence due to their reliance on sparse bag-of-words representations. This paper presents a modular framework that leverages knowledge distillation from pre-trained transformers to enhance NTMs. By using a BERT-based autoencoder as a "teacher," the proposed method, BAT, provides dense, contextualized targets for the "student" topic model. Experimental results across multiple benchmarks demonstrate that this approach significantly improves topic coherence while preserving the interpretability of the underlying model.
Introduction
Topic modeling is a cornerstone of text analysis, enabling the discovery of latent themes in large document corpora. While recent advances in neural architectures have improved the flexibility of these models, they frequently produce "noisy" or incoherent topics. This is largely because standard NTMs operate on bag-of-words (BoW) inputs, ignoring the rich contextual information captured by modern language models like BERT.
The challenge lies in bridging the gap between the high-performance but opaque representations of transformers and the simple, interpretable structure of topic models. This research addresses this by introducing a distillation-based training objective that transfers contextual knowledge into the topic modeling process.
The BAT Framework
The core of the proposed approach is the BAT (BERT-based Autoencoder as Teacher) method. It employs a knowledge distillation strategy where a pre-trained transformer guides the learning of a student NTM.
The process involves three main components:
- Teacher Model: A pre-trained DistilBERT model is fine-tuned as a deterministic autoencoder. For any given document, it generates a dense probability distribution over the vocabulary, effectively "smoothing" the target by assigning weights to semantically related words not present in the text.
- Student Model: A standard NTM (e.g., SCHOLAR or W-LDA) acts as the student.
- Distillation Objective: The student is trained to minimize a combined loss: the standard reconstruction error of the BoW input and the divergence from the teacher's soft labels.
This modular design allows the BAT framework to be integrated into various NTM architectures with minimal code changes.
Experimental Setup
The framework was evaluated on three diverse datasets: 20 Newsgroups (20NG), Wikitext-103 (Wiki), and IMDb. These datasets represent different document lengths and linguistic styles, providing a robust test for the distillation method. The primary evaluation metric was Normalized Pointwise Mutual Information (NPMI), which serves as a proxy for human-perceived topic coherence.
Results and Discussion
The inclusion of the BAT teacher consistently led to higher topic coherence across all tested models and datasets.
 Source, p. 6
As shown in the results, the distilled version of the SCHOLAR model (Sch.
- BAT) achieved state-of-the-art NPMI scores. For instance, on the 20NG dataset with $K=50$ topics, NPMI improved from 0.322 to 0.354. Qualitative analysis further revealed that topics became more specific and less cluttered with generic terms. For example, a topic related to sports saw generic words replaced by highly relevant, specific entities.
Importantly, this improvement in coherence does not come at the cost of interpretability. Because the distillation only affects the training objective and not the student's architecture, the resulting model remains a standard topic model with a clear, inspectable topic-word matrix.
Conclusion
Knowledge distillation from pre-trained transformers offers a powerful and modular way to improve neural topic models. By moving beyond sparse BoW representations and incorporating contextual "smarts" from models like BERT, the BAT framework produces significantly more coherent topics. While there is a one-time computational cost for teacher fine-tuning, the resulting student models remain efficient and highly interpretable, making them more effective tools for human-in-the-loop text analysis. Future work may explore the impact of different teacher models and the potential for improving downstream task performance.
Summary updated