LLM Reading Tea Leaves: Automatically Evaluating Topic Models with Large Language Models

Xiaohao Yang, He Zhao, Dinh Phung, Wray Buntine, Lan Du

TL;DR

Evaluating topic models has traditionally been a fragmented process, forcing researchers to choose between metrics that track topic quality or those that track document classification accuracy. This paper introduces WALM (Word Agreement with Language Model), a unified evaluation framework that uses Large Language Models (LLMs) as a proxy for human judgment to jointly assess both aspects. By measuring how well a topic model's generated "topical words" align with LLM-suggested keywords, WALM provides a robust, automated, and human-aligned benchmark for topic modeling.

What Problem Does This Paper Address?

Topic modeling is a staple of unsupervised text analysis, but evaluating these models is notoriously difficult. Traditionally, researchers have relied on perplexity (held-out log-likelihood), but it doesn't always correlate with human interpretability and is often intractable to compute for modern Neural Topic Models (NTMs).

Consequently, the community split the evaluation into two silos:

  1. Topic Quality: Measured via automated metrics like Normalized Pointwise Mutual Information (NPMI) or topic diversity.
  2. Document Representation Quality: Measured via downstream tasks like classification accuracy (ACC) or clustering.

The core issue is that these two dimensions are often contradictory. As shown in the paper's experiments, a model checkpoint that yields the highest topic coherence might perform poorly on document classification, and vice versa.

Figure 1: Performance rankings of topic quality (NPMI) and document representation quality (ACC) during model selection. The best model state/checkpoint can be determined using either NPMI or ACC as the selection criterion. However, it can be observed that the rankings for topic quality and document representation quality are inconsistent under the same selection criteria. Experiments are conducted five times, with the number of topics set to 50.

This discrepancy makes model selection a guessing game. While human evaluation remains the gold standard, it is far too expensive and slow for iterative development.

Methods

The authors propose WALM, which reframes topic model evaluation as a keyword agreement task. The framework operates in three main steps:

  1. Generate Model Topical Words: For a given document, the trained topic model infers its topic distribution and multiplies it by the topic-word distributions to reconstruct a per-document word distribution. The top-weighted words from this distribution represent the model's semantic summary of the document.
  2. Generate LLM Reference Keywords: The same document is fed to an LLM to generate a ground-truth set of keywords. The authors explore two prompting strategies: a standard Keywords Suggestion prompt and a two-stage Topic-Aware Keywords Suggestion pipeline that forces the LLM to first identify corpus-level themes before extracting document-specific words.
  3. Compute Agreement Scores: Finally, WALM quantifies the alignment between the model's topical words ($w$) and the LLM's keywords ($k$) using four distinct scoring functions:
  4. Word Overlap: A simple count of exact root-word matches.
  5. Synset Overlap: Uses WordNet to count matches based on overlapping synsets (allowing synonyms like "puppy" and "dog" to match).
  6. Word Optimal Assignment (OA): Uses pre-trained word embeddings (like GloVe) and the Hungarian algorithm to find the minimum semantic distance alignment between the two word sets.
  7. Word Optimal Transport (OT): A "soft" assignment method that solves an Optimal Transport problem, factoring in the probability mass of the words rather than treating them as equal sets.

Datasets

The framework was validated using two widely recognized text benchmarks:

  • 20Newsgroup (20News): A dataset containing relatively long documents across various news categories.
  • DBpedia: A dataset consisting of shorter text snippets extracted from Wikipedia.
  • 500N-KPCrowd: An existing human-annotated dataset used specifically to evaluate WALM's correlation with actual human keyword extraction.

Key Insights and Ideas

  • A Unified Perspective: WALM successfully bridges the gap between topic interpretation and document representation. To score well, a model must excel at both global topic learning and local document inference.
  • LLMs as Reliable Proxies: The keywords generated by LLMs closely mirror those provided by human annotators. More importantly, the final model rankings remain highly stable regardless of whether you use LLaMA3, Mistral, Phi-3, or Yi-1.5, proving the metric's robustness against the choice of the underlying evaluator model.
  • Catching Overfitting: WALM metrics effectively expose when a model begins to overfit. For instance, in their learning curve analysis, the authors showed that the Neural Variational Document Model (NVDM) starts to exhibit clear overfitting in later training epochs, a trend clearly captured by WALM's embedding-based scores.

Key Results

  • Minimal Human-LLM Gap: In a case study comparing LLM-generated keywords against three human annotators, the evaluation gap was remarkably small. The Word Optimal Assignment ($S_{oa}$) metric achieved a gap value of just 0.03 on the 20News dataset, demonstrating that the LLM serves as an excellent stand-in for human judgment.
  • Strong Human Correlation: When tested against the human-labeled 500N-KPCrowd dataset, WALM scores demonstrated a strong Pearson correlation coefficient (up to 0.68 when using 10-word suggestions with Optimal Transport), validating its real-world utility.

Limitations and Future Work

The authors openly acknowledge a key vulnerability: LLM Bias. If a topic model is optimized solely to maximize its WALM score, it risks merely mimicking the inherent biases or stylistic preferences of the specific LLM used for evaluation. To mitigate this, they recommend using WALM as a complementary metric alongside traditional evaluations like NPMI and classification accuracy, rather than a total replacement.

Future work could explore expanding WALM to cross-lingual topic models or leveraging even larger, domain-specific language models to evaluate highly technical corpora (e.g., medical or legal documents).

Summary updated

BibTeX
@article{yang2025llm,
  author = {Xiaohao Yang and He Zhao and Dinh Phung and Wray Buntine and Lan Du},
  title = {{LLM Reading Tea Leaves: Automatically Evaluating Topic Models with Large Language Models}},
  journal = {Trans. Assoc. Comput. Linguistics},
  year = {2025},
  doi = {10.1162/tacl\_a\_00744},
}
Figure