Skip to main content
QUICK REVIEW

[Paper Review] TopicGPT: A Prompt-based Topic Modeling Framework

Chau Pham, Alexander Hoyle|arXiv (Cornell University)|Nov 2, 2023
Topic ModelingComputer Science11 citations
TL;DR

TopicGPT uses prompt-based large language models to generate and assign interpretable topics from a text corpus, achieving higher alignment with human-ground-truth topics than LDA and BERTopic, and supporting topic refinement and hierarchy without retraining.

ABSTRACT

Topic modeling is a well-established technique for exploring text corpora. Conventional topic models (e.g., LDA) represent topics as bags of words that often require "reading the tea leaves" to interpret; additionally, they offer users minimal control over the formatting and specificity of resulting topics. To tackle these issues, we introduce TopicGPT, a prompt-based framework that uses large language models (LLMs) to uncover latent topics in a text collection. TopicGPT produces topics that align better with human categorizations compared to competing methods: it achieves a harmonic mean purity of 0.74 against human-annotated Wikipedia topics compared to 0.64 for the strongest baseline. Its topics are also interpretable, dispensing with ambiguous bags of words in favor of topics with natural language labels and associated free-form descriptions. Moreover, the framework is highly adaptable, allowing users to specify constraints and modify topics without the need for model retraining. By streamlining access to high-quality and interpretable topics, TopicGPT represents a compelling, human-centered approach to topic modeling.

Motivation & Objective

  • Develop a human-centric topic modeling framework that yields interpretable topics with natural language labels and descriptions.
  • Leverage iterative LLM prompting to generate and refine topics from a sample of documents without retraining.
  • Provide document-topic assignments with supporting quotes to enhance verifiability of results.
  • Enable a hierarchical extension to explore subtopics and finer granularity when needed.
  • Assess robustness, stability, and alignment of topic outputs against ground-truth human annotations.

Proposed method

  • Iteratively prompt an LLM to generate topics from a sample of documents and existing seed topics.
  • Refine topics by merging near-duplicates and removing infrequent topics using embeddings and a frequency threshold.
  • Optionally extend to a topic hierarchy by prompting for subtopics grounded in associated documents.
  • Assign documents to topics via LLM prompts that return a topic label, description, and supporting quotation.
  • Incorporate a self-correction step to fix hallucinations and formatting issues in topic assignments.
Figure 1: Overview of TopicGPT. 1) Topic Generation : Given a corpus and a list of manually-curated seed topics, TopicGPT identifies topics within each corpus document. The framework then refines the topic list by merging repeated topics and removing infrequent topics. 2) Topic Assignment : Given th
Figure 1: Overview of TopicGPT. 1) Topic Generation : Given a corpus and a list of manually-curated seed topics, TopicGPT identifies topics within each corpus document. The framework then refines the topic list by merging repeated topics and removing infrequent topics. 2) Topic Assignment : Given th

Experimental results

Research questions

  • RQ1Do TopicGPT-generated topics align more closely with human-annotated ground-truth topics than LDA and BERTopic across datasets?
  • RQ2How robust are TopicGPT outputs to prompt variations, sample selections, and open vs. closed-source LLMs?
  • RQ3Can TopicGPT reliably produce interpretable topics with natural language labels and descriptive quotes that support assignments?
  • RQ4Does extending TopicGPT to a hierarchical structure improve the granularity and usefulness of topics?
  • RQ5What is the impact of seed-topic quality and quantity on topic coherence and alignment?

Key findings

  • TopicGPT shows higher topical alignment with ground-truth labels than LDA and BERTopic across Wiki and Bills datasets (e.g., Wiki P1=0.73, ARI=0.58, NMI=0.71; Bills P1=0.57, ARI=0.42, NMI=0.47 in default settings).
  • Refinement improves interpretability and reduces misaligned topics (e.g., refined Wiki P1=0.74, ARI=0.60; refined Bills P1=0.57, ARI=0.40).
  • TopicGPT assignments remain stable across varied prompts and data samples, with performance comparable or better than LDA on alignment metrics; running the pipeline twice yields high stability (P1=0.95, ARI=0.92, NMI=0.92).
  • Open-source LLMs can handle topic assignment (e.g., Mistral-7B-Instruct performs reasonably well for assignment), but open-source models struggle for topic generation compared to GPT-4.
  • TopicGPT produces semantically closer topics to ground truth than LDA in both unrefined and refined forms, with refinement substantially reducing misaligned topics.
  • Hierarchical TopicGPT can generate informative subtopics grounded in parent topics and their documents, enabling richer analysis.
Figure 2: The number of topics generated over documents processed in the Bills and Wiki corpus. The grey line indicates the number of expected topics, simulated using the empirical distribution of ground-truth topics for the datasets. For both datasets, we see a similar pattern - after a "topic drou
Figure 2: The number of topics generated over documents processed in the Bills and Wiki corpus. The grey line indicates the number of expected topics, simulated using the empirical distribution of ground-truth topics for the datasets. For both datasets, we see a similar pattern - after a "topic drou

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.