Probabilistic Topic Modelling with Transformer Representations
Arik Reuter, Anton Thielmann, Christoph Weisser, Benjamin Säfken, Thomas Kneib
TL;DR
TNTM unifies transformer-based word embeddings with probabilistic topic modelling by representing topics as multivariate Gaussians in embedding space and inferring document-topic mixtures via a variational autoencoder. The model initializes topics with a Gaussian Mixture on reduced word embeddings and employs UMAP for dimensionality reduction to speed up inference. A logistic-normal prior on document-topic distributions and carefully engineered numerical stability techniques enable scalable, stable training, with results showing superior embedding coherence and near-perfect topic diversity compared to baselines. The work demonstrates the practical impact of combining rich contextual embeddings with principled probabilistic structure, and provides a codebase for broader adoption and extension.
Abstract
Topic modelling was mostly dominated by Bayesian graphical models during the last decade. With the rise of transformers in Natural Language Processing, however, several successful models that rely on straightforward clustering approaches in transformer-based embedding spaces have emerged and consolidated the notion of topics as clusters of embedding vectors. We propose the Transformer-Representation Neural Topic Model (TNTM), which combines the benefits of topic representations in transformer-based embedding spaces and probabilistic modelling. Therefore, this approach unifies the powerful and versatile notion of topics based on transformer embeddings with fully probabilistic modelling, as in models such as Latent Dirichlet Allocation (LDA). We utilize the variational autoencoder (VAE) framework for improved inference speed and modelling flexibility. Experimental results show that our proposed model achieves results on par with various state-of-the-art approaches in terms of embedding coherence while maintaining almost perfect topic diversity. The corresponding source code is available at https://github.com/ArikReuter/TNTM.
