Enhancing BERTopic with Intermediate Layer Representations

Dominik Koterwa, Maciej Świtała
5/10/2025
cs.CL

No official code found. Best implementation: dkoterwa/optimizing_bertopic (0 stars, last commit 2025-05-10).

Abstract

BERTopic is a topic modeling algorithm that leverages transformer-based embeddings to create dense clusters, enabling the estimation of topic structures and the extraction of valuable insights from a corpus of documents. This approach allows users to efficiently process large-scale text data and gain meaningful insights into its structure. While BERTopic is a powerful tool, embedding preparation can vary, including extracting representations from intermediate model layers and applying transformations to these embeddings. In this study, we evaluate 18 different embedding representations and present findings based on experiments conducted on three diverse datasets. To assess the algorithm's performance, we report topic coherence and topic diversity metrics across all experiments. Our results demonstrate that, for each dataset, it is possible to find an embedding configuration that performs better than the default setting of BERTopic. Additionally, we investigate the influence of stop words on different embedding configurations.

View on arXivView PDF

Code Implementations(1)

00Python, Jupyter NotebookDec 24, 20231 years ago

Cite this paper

@article{koterwa2025enhancing,
  title  = {Enhancing BERTopic with Intermediate Layer Representations},
  author = {Dominik Koterwa and Maciej Świtała},
  year   = {2025},
  eprint = {2505.06696},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.06696v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2505.06696.svg)](https://codeofpaper.com/paper/2505.06696)

Discussion