LLM-TA: An LLM-Enhanced Thematic Analysis Pipeline for Transcripts from Parents of Children with Congenital Heart Disease

Muhammad Zain Raza, Jiawei Xu, Terence Lim, Lily Boddy, Carlos M. Mery, Andrew Well, Ying Ding · DOI

Introduction

Thematic Analysis (TA) is a foundational qualitative research method used to understand complex human experiences, particularly in healthcare settings. By identifying recurring patterns or "themes" within interview transcripts, researchers can gain deep insights into patient needs and clinical gaps. However, inductive TA is incredibly resource-intensive. Analyzing even a small set of transcripts can require dozens of person-hours, making it difficult to scale in fast-paced clinical environments.

While Large Language Models (LLMs) offer potential for automation, high-stakes medical domains like pediatric congenital heart disease demand high precision. Previous automated approaches often failed to capture the nuanced "clinical common sense" of human experts or struggled with the length of medical transcripts. To address these challenges, researchers developed LLM-TA, a specialized pipeline designed to make qualitative analysis both accurate and efficient.

The LLM-TA Pipeline

The LLM-TA pipeline employs a "divide-and-conquer" strategy to process long transcripts without losing fine-grained detail. The process is divided into two primary stages:

  1. Stage 1: Coding: Transcripts are partitioned into 1,500-word chunks. The LLM identifies specific "codes"—labels for distinct ideas—alongside descriptions and supporting quotes. These codes are then organized into manageable groups.
  2. Stage 2: Theme Generation: The model synthesizes these code groups into preliminary themes, which are subsequently consolidated into a final, overarching thematic list representing the entire dataset.
The two-stage LLM-TA pipeline: Coding and Theme Generation.

The researchers evaluated three distinct prompting strategies to optimize performance:

  • Zero-shot: Providing direct instructions without examples.
  • One-shot: Including a high-quality example from a related study to guide the model.
  • Reflexion: An iterative process where the LLM evaluates its own initial output, generates self-feedback, and regenerates themes to improve specificity and alignment with the data.

Evaluation and Key Results

The pipeline was tested using focus group transcripts from 42 parents of children with Anomalous Aortic Origin of a Coronary Artery (AAOCA). The LLM's performance was benchmarked against a "ground truth" established by three human researchers who spent 30 hours manually coding the same data.

The results demonstrate that LLM-TA significantly outperforms existing automated baselines while offering massive efficiency gains. Manual analysis required 30 hours, whereas the LLM-TA pipeline completed the task in 10 to 90 minutes, depending on the prompting strategy—a time reduction of up to 97%.

Comparison of LLM-TA variants and baselines against human coding standards.

Key findings include:

  • Superior Accuracy: LLM-TA achieved a 216% improvement in average Jaccard Similarity compared to previous methods.
  • High Hit Rate: The 1-shot and Reflexion strategies captured nearly all major themes identified by human experts.
  • Expert Validation: Human TA experts rated the "1-shot + Reflexion" configuration as having the highest theme-level similarity and being genuinely helpful for real-world research workflows.

Discussion and Future Directions

While LLM-TA shows remarkable promise, certain limitations remain. LLMs can occasionally over-emphasize dramatic but rare anecdotes (e.g., a single cardiac arrest event) while overlooking subtler, broader trends like general anxiety. Furthermore, the models sometimes lack the external clinical context necessary to distinguish between closely related concepts, such as "empathy" versus "clinical communication."

Future work will focus on "human-in-the-loop" systems, where researchers can refine LLM outputs. Additionally, incorporating clinical guidelines directly into prompts may help bridge the "clinical context gap." Validating the pipeline across a wider range of medical conditions will be essential to ensure its generalizability across the healthcare landscape.

Summary updated

BibTeX
@inproceedings{raza2024llm,
  author = {Muhammad Zain Raza and Jiawei Xu and Terence Lim and Lily Boddy and Carlos M. Mery and Andrew Well and Ying Ding},
  title = {{LLM-TA: An LLM-Enhanced Thematic Analysis Pipeline for Transcripts from Parents of Children with Congenital Heart Disease}},
  booktitle = {GenAI4Health @ AAAI},
  year = {2024},
  url = {https://openreview.net/forum?id=6ucq2JEnZ7},
}
Figure