A Large Language Model Guided Topic Refinement Mechanism for Short Text Modeling

Shuyu Chang, Rui Wang, Peng Ren, Qi Wang, Haiping HuangDASFAA 2025

TL;DR

This paper introduces "Topic Refinement," a novel, model-agnostic mechanism that uses Large Language Models (LLMs) to improve the quality of topics extracted from short texts. By leveraging LLMs' advanced comprehension, the method iteratively refines topics by identifying and replacing semantically irrelevant words, leading to more coherent and granular topics.

What Problem Does This Paper Address?

Modeling topics in short texts, like tweets and news snippets, is crucial for understanding rapidly evolving social trends. However, traditional topic models struggle with the inherent sparsity of short texts, leading to topics that lack semantic coherence and granularity. This makes it difficult to accurately capture the underlying meaning and can hinder downstream applications. Existing LLM-based approaches often deviate from the standard bag-of-words topic representation or require processing entire documents, leading to high computational costs and making direct comparison with traditional methods challenging.

Methods

The core innovation is the "Topic Refinement" mechanism, which acts as a post-processing step for existing topic models. It works in three phases:

  1. Prompt Construction: For each topic identified by a base model, the mechanism constructs a prompt for an LLM. This prompt asks the LLM to identify the common topic shared by a subset of words from the topic and then assess if a specific "intruder" word is semantically coherent with that topic. If not, the LLM is asked to suggest ten alternative, commonly used words that are closely related to the topic.
  2. LLM Request and Response: The constructed prompt is sent to an LLM (GPT-3.5-turbo was used in experiments). The LLM returns a JSON response containing the identified topic, a "Yes/No" answer regarding the intruder word's coherence, and a list of alternative words if the answer is "No."
  3. Iterative Refinement: Based on the LLM's response, the mechanism either retains the original word or selects a replacement from the suggested alternatives. The selection prioritizes words that are semantically coherent and present in the dataset's vocabulary. This process is iterated over each word in a topic, typically in reverse order, to refine the topic. The mechanism is "model-agnostic," meaning it can be applied to topics generated by any base topic modeling method.

Datasets

The authors evaluated their approach on four short text datasets:

  • Tweet: Tweets relevant to 89 queries from the 2011 and 2012 microblog tracks.
  • AGNews: A subset of 5,000 news article titles from each of the four categories.
  • TagMyNews: News titles from various sources, annotated with seven labels.
  • YahooAnswer: A subset of 2,500 question titles from each of the ten categories.

These datasets are standard benchmarks for short text analysis.

Key Insights and Ideas

  • LLMs as Topic Refiners: The paper demonstrates that LLMs, with their advanced text understanding, can be effectively used not just for topic generation but also for refining existing topics from traditional models.
  • Model-Agnostic Approach: The "Topic Refinement" mechanism's ability to work with any base topic model is a significant advantage, allowing users to improve their existing topic modeling pipelines without needing to switch models entirely.
  • Mimicking Human Judgment: The prompt engineering approach effectively mimics how a human would identify and correct semantically inconsistent words in a topic, leading to more intuitive and coherent results.
  • Efficiency Gains: Compared to LLM-based topic modeling that requires full document input, this refinement approach is more token-efficient, as it focuses on specific topic words.

Key Results

  • Improved Topic Coherence: Topic Refinement consistently enhanced topic coherence across all tested base models and datasets, with notable improvements in metrics like CA, CP, CV, UCI, and NPMI.
  • Enhanced Topic Granularity: The mechanism also improved topic granularity, as measured by within-topic similarity (S) and between-topic distance (D), with average improvements of 21.23% and 29.05%, respectively.
  • Better Text Classification: When used to generate topic distributions for text classification, refined topics led to improved Accuracy and F1 scores across all datasets and base models. For instance, on the Tweet dataset, LDA achieved a 16.98% increase in Accuracy and an 18.19% increase in F1 score after refinement.
  • LLM Performance: GPT-4 showed the most effective refinement performance, though other LLMs like PaLM2, GPT-3.5, and Gemini Pro also yielded significant improvements.

Limitations and Future Work

  • Dependence on Base Model Quality: The paper notes that the initial quality of topics from the base model influences the final performance. Datasets with already high-quality topics require less refinement.
  • LLM Choice: While GPT-4 performed best, the choice of LLM can impact the degree of refinement.
  • Future Work: The authors suggest exploring dynamic adjustment of the topic modeling process based on LLM feedback, potentially leading to more integrated and adaptive topic modeling systems. They also highlight the potential for further research into how LLMs can dynamically influence the initial topic modeling process itself.

Summary updated

BibTeX
@inproceedings{chang2025large,
  author = {Shuyu Chang and Rui Wang and Peng Ren and Qi Wang and Haiping Huang},
  title = {{A Large Language Model Guided Topic Refinement Mechanism for Short Text Modeling}},
  booktitle = {DASFAA},
  year = {2025},
  doi = {10.1007/978-981-95-3830-0\_32},
}
Figure