LLM-Enhanced Topic Modeling System for Qualitative Text Analysis

qualit · Research & Academia · 2024 · source Agentic: no · promotional bias: low · source-backed · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Qualitative text analysis and topic modeling

Amazon researchers needed to make large volumes of qualitative free-text data easier to analyze while preserving nuanced, interpretable topics that standard topic-modeling methods often miss.

Constraints:

Architecture

QualIT combines pretrained LLM key-phrase extraction with traditional hierarchical clustering. The LLM extracts multiple salient key phrases from each document, a coherence score filters hallucinated or weakly aligned key phrases, primary clustering groups phrases into high-level themes, and secondary clustering finds granular subtopics inside each theme. Human reviewers and benchmark comparisons validate the resulting topics.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  Free_text_corpus["Free-text corpus"] --> LLM_key_phrase_extractor["LLM key-phrase extractor"]
  LLM_key_phrase_extractor --> Coherence_scorer["Coherence scorer"]
  Coherence_scorer --> Primary_clustering["Primary clustering"]
  Primary_clustering --> Secondary_clustering["Secondary clustering"]
  Secondary_clustering --> Topic_hierarchy["Topic hierarchy"]
  Topic_hierarchy --> Human_validation["Human validation"]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Free-text corpus Qualitative documents such as surveys, feedback, voice-of-customer text, or product interaction data. LLM key-phrase extractor
LLM key-phrase extractor Pretrained LLM that extracts multiple salient phrases from each document. Free-text corpus, Coherence scorer
Coherence scorer Checks how well extracted key phrases align with the original text and filters possible hallucinations. LLM key-phrase extractor, Primary clustering
Primary clustering Groups validated key phrases into broad topic clusters. Coherence scorer, Secondary clustering
Secondary clustering Finds more granular subtopics inside each primary cluster. Primary clustering, Topic hierarchy
Topic hierarchy Interpretable output that lets researchers move from broad themes to detailed subtopics. Human validation
Human validation Reviewer process comparing generated topics to known ground-truth categories. Topic hierarchy

Data flow

Free-text documents are passed to an LLM for key-phrase extraction. Each extracted phrase receives a coherence score against the source text; low-scoring phrases are removed as possible hallucinations. The remaining key phrases are clustered into primary themes and then subclustered into more specific topics, giving analysts a navigable hierarchy from broad topics to details.

3 supporting quotes
“The LLM analyzes each document, identifying key phrases that capture the most salient themes and topics.”article, stated
“QualIT calculates a coherence score for each one. This score assesses how well the key phrase aligns with the actual text”article, stated
“First, the model groups key phrases extracted by the LLM into primary clusters, representing the overarching themes present in the corpus.”article, stated

Why this architecture

The architecture uses LLMs for language understanding and phrase generation, but keeps clustering and coherence filtering explicit so the output remains interpretable, less noisy, and benchmarkable against classical topic modeling.

3 supporting quotes
“QualIT doesn't simply rely on the LLM to generate topics and themes.”article, stated
“By extracting multiple key phrases per document, QualIT is able to deal with the reality that a single piece of text can encompass a range of interconnected themes”article, stated
“QualIT leverages the key phrases as the basis for clustering, rather than directly grouping the full documents.”article, stated

Models used: pretrained LLMs · QualIT · hierarchical clustering · coherence scoring · LDA · BERTopic

Scale

Alternatives considered (roads not taken)

Standard LDA topic modeling

Rejected because: LDA clusters by word co-occurrence and often misses contextual nuance and ambiguity.

“Topic-modeling approaches like latent Dirichlet allocation (LDA), which cluster documents on the basis of word co-occurrence”article, stated
“LDA and other standard topic-modeling techniques often struggle to fully capture the contextual nuances and ambiguities inherent in natural language.”article, stated

Let the LLM directly generate final topics and themes

Rejected because: QualIT explicitly avoids relying only on generated topics and instead uses key phrases, coherence checks, and clustering.

“QualIT doesn't simply rely on the LLM to generate topics and themes.”article, stated

Cluster full documents directly

Rejected because: Clustering validated key phrases reduces noise and focuses on thematic essence.

“QualIT leverages the key phrases as the basis for clustering, rather than directly grouping the full documents.”article, stated
“This reduces noise and the influence of irrelevant data, enabling the algorithm to focus on the thematic essence of the text.”article, stated

Patterns

confidence-thresholding (quality-control)

QualIT scores extracted key phrases for coherence and removes phrases below a threshold as possible hallucinations.

“Key phrases that fall below a certain coherence threshold are flagged for potential "hallucination" and removed from the analysis”article, stated

eval-driven-development (evaluation)

The researchers compared QualIT against LDA and BERTopic with coherence, diversity, and human ground-truth overlap metrics.

“Compared to standard LDA and the state-of-the-art BERTopic approach, QualIT demonstrated substantial improvements”article, stated
“we also asked human reviewers to validate its output.”article, stated

Tradeoffs

Use LLM key phrases plus clustering rather than only LLM-generated topics.

Chose LLM extraction with hierarchical clustering over Direct LLM topic generation.

Rationale: This keeps the LLM's language understanding while preserving an interpretable clustering structure.

“QualIT doesn't simply rely on the LLM to generate topics and themes. It employs a unique two-stage clustering approach”article, stated

Cluster key phrases rather than full documents.

Chose Key-phrase clustering over Full-document clustering.

Rationale: Key phrases reduce noise and let a single document contribute multiple themes.

“By extracting multiple key phrases per document, QualIT is able to deal with the reality that a single piece of text can encompass a range of interconnected themes”article, stated
“This reduces noise and the influence of irrelevant data”article, stated

Gotchas (what bit them)

LLM-extracted phrases can hallucinate or misalign with the text.

Root cause: The LLM generates key phrases and may produce phrases that do not cohere with the actual document.

Resolution: Calculate a coherence score for each key phrase and remove low-scoring phrases.

“To ensure the reliability of the extracted key phrases, QualIT calculates a coherence score for each one.”article, stated
“Key phrases that fall below a certain coherence threshold are flagged for potential "hallucination" and removed from the analysis”article, stated

Single-topic document assumptions miss qualitative complexity.

Root cause: One text can contain multiple connected themes and perspectives.

Resolution: Extract multiple key phrases per document before clustering.

“This is a crucial advantage over alternative methods that characterize each document according to a single topic.”article, stated
“a single piece of text can encompass a range of interconnected themes and perspectives.”article, stated

Full-document clustering can be noisy.

Root cause: Irrelevant document content can dominate clustering when full documents are grouped directly.

Resolution: Cluster validated key phrases to focus on thematic essence.

“rather than directly grouping the full documents. This reduces noise and the influence of irrelevant data”article, stated

Evaluation

The researchers evaluated QualIT on the 20 Newsgroups benchmark against LDA and BERTopic using topic coherence, topic diversity, and human reviewer ground-truth overlap.

Metrics: topic coherence · topic diversity · human reviewer ground-truth overlap · three of four evaluator agreement

3 supporting quotes
“We evaluated QualIT on the 20 Newsgroups dataset, a widely used benchmark for topic-modeling research.”article, stated
“topic coherence (70% vs. 65% and 57% for the benchmarks) and topic diversity (95.5% vs. 85% and 72%).”article, stated
“QualIT achieved a 50% overlap with the ground truth, compared to just 25% for LDA and BERTopic.”article, stated

Outcomes

The source reports benchmark results on 20 Newsgroups and four-human-reviewer agreement thresholds, but not a production deployment size.

3 supporting quotes
“QualIT demonstrated substantial improvements in both topic coherence (70% vs. 65% and 57% for the benchmarks)”article, stated
“when at least three out of four evaluators agreed on the topic classification, QualIT achieved a 50% overlap with the ground truth”article, stated
“a system similar to QualIT could analyze the questions asked of an AI chatbot, to understand what topics are of most interest to users.”article, stated