Automated Thematic Analysis for Clinical Qualitative Data: Iterative Codebook Refinement with Full Provenance
Authors: Seungjun Yi, Joakim Nguyen, Huimin Xu, Terence Lim, Joseph Skrovan, Mehak Beri, Hitakshi Modi, Andrew Well, +4 more
Organizations: Department of Biomedical Engineering, University of Texas at Austin, Austin, TX, USA · Department of Computer Science, University of Texas at Austin, Austin, TX, USA · School of Information, University of Texas at Austin, Austin, TX, USA · College of Natural Sciences, University of Texas at Austin, Austin, TX, USA · Graphen, Inc., New York, NY, USA · Department of Pediatrics, University of Texas at Austin, Austin, TX, USA · Department of Cardiac Surgery, Division of Pediatric Cardiac Surgery, Vanderbilt University School of Medicine, Nashville, TN, USA · Pediatric Heart Institute, Monroe Carell Jr. Children’s Hospital at Vanderbilt, Nashville, TN, USA · Department of Population Health, Dell Medical School, University of Texas at Austin, Austin, TX, USA
Thematic analysis (TA) is widely used in health research to extract patterns from patient interviews, yet manual TA faces challenges in scalability and reproducibility. LLM-based automation can help, but existing approaches produce codebooks with limited generalizability and lack analytic auditability. We present an automated TA framework combining iterative codebook refinement with full provenance tracking. Evaluated on five corpora spanning clinical interviews, social media, and public transcripts, the framework achieves the highest composite quality score on four of five datasets compared to six baselines. Iterative refinement yields statistically significant improvements on four datasets with large effect sizes, driven by gains in code reusability and distributional consistency while preserving descriptive quality. On two clinical corpora (pediatric cardiology), generated themes align with expert-annotated themes.
Figures & tables
Figure 1: The Traceable Thematic Analysis Framework
AAOCA 11
SV-CHD 11
Ali
Dreaddit 17
Sheffield
Method
Score
Δ
Score
Δ
Score
Δ
Score
Δ
Score
Δ
OpenCoding 16
0.493
0.450
0.473
0.428
0.516
LLOOM 9
0.476
0.495
0.491
0.458
0.484
GraphRAG 7
0.433
0.391
0.431
0.382
0.467
LightRAG 8
0.415
0.501
0.504
0.368
0.505
Thematic-LM 14
0.485
0.473
0.395
0.375
0.629
Table 1: Comparative performance across methods. Scores report the composite quality metric (mean of Reusability, Fitness, Coverage, Parsimony, and Consistency). LOGOS (Iter-1) and LOGOS (Best) report means over n=5 independent replicates. Δ denotes improvement from iterative refinement. Statistical significance is assessed via paired t -tests: *** p<0.01 .
Figure 2: Average quality metric scores across five datasets. Error bars indicate ±σ across datasets.
Figure 3: Quality metric trajectories across iterative refinement for all five datasets ( n=5 replicates each). Solid lines show the mean; shaded bands denote 95% confidence intervals. Metrics shown: Reusability , Fitness , Coverage , Parsimony , Consistency , and Overall (dashed grey; unweighted mean). Iteration 0 is the initial codebook before refinement. Gains emerge within 2–4 iterations and plateau thereafter.
Generated Theme
Closest Human Theme
Sim.
AAOCA (8 generated; mean = .487)
Parental fears & protective instincts
Feeling that my child is safe
.587
Balancing caregiving & prof. responsibilities
Partnership with the care team
.558
Child’s engagement & understanding
Feeling that my child is safe
.515
Emotional & psychological impacts
Coping with stress, anxiety, depression
.504
Communication complexities in health mgmt.
Communicating risks appropriately
.496
Table 2: Comparison of framework-generated themes with human-annotated themes 11 , matched by cosine similarity (all-MiniLM-L6-v2). Rows sorted by descending similarity.
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
Dataset
Metric
Iter-1
Best
Δ
t
p
Sig.
d / Effect
AAOCA
Reusability
.119
.140
+.021
− 4.98
.008
2.23 / L
Fitness
.702
.791
+.089
− 4.00
.016
**
1.79 / L
Coverage
.600
.760
+.160
− 6.47
.003
2.89 / L
Parsimony
.569
.608
+.039
− 15.92
< .001
7.12 / L
Consistency
.362
.362
.000
—
—
—
—
Overall
.471
.509
+.039
− 6.23
.003
2.78 / L
Appendix
Table 3: Per-metric statistical analysis of iterative refinement (Iter-1 vs. Best). All values are means over n=5 independent replicates. Δ : improvement from refinement. t : paired t -statistic (df = 4). d : Cohen’s d (paired). ** p<0.05 ; *** p<0.01 . Effect sizes: S = small ( ∣d∣<0.5 ), M = medium ( ∣d∣<0.8 ), L = large ( ∣d∣≥0.8 ).
Thematic analysis (TA) is a widely used qualitative approach for uncovering latent meanings in unstructured text data. TA provides valuable insights in healthcare but is resource-intensive. Large Language Models (LLMs) have been introduced to perform TA, yet their applications in high-stakes healthcare settings, particularly for qualitative clinical interview analysis, remain limited. Here, we propose TAMA: A Human-AI Collaborative Thematic Analysis framework using Multi-Agent LLMs for clinical interviews. We leverage the scalability and coherence of multi-agent systems through structured conversations between agents and coordinate the expertise of cardiac experts in TA. Using interview transcripts from parents of children with Anomalous Aortic Origin of a Coronary Artery (AAOCA), a rare congenital heart disease, we demonstrate that TAMA outperforms single-agent LLM TA approaches, achieving higher thematic hit rate, coverage, and distinctiveness. TAMA demonstrates strong potential for automated TA in clinical settings by leveraging multi-agent LLM systems with human-in-the-loop integration by enhancing quality while significantly reducing manual workload. The full implementation is publicly available at https://github.com/Charlie-Yi-SJ/TAMA.
Huimin Xu, Seungjun Yi, Terence Lim +9
Department of Biomedical Engineering, University of Texas at Austin, USA · McCombs School of Business, University of Texas at Austin, USA · School of Information, University of Texas at Austin, Austin, TX, USA and Dell Medical School, University of Texas at Austin, Austin, TX, USA
Large Language Models (LLMs) offer new possibilities for scaling qualitative analysis, but existing applications often provide limited methodological transparency regarding how qualitative methods are translated into computational procedures. This paper presents an auditable and privacy-preserving computational operationalization of inductive and latent Thematic Analysis (TA). This paper first derives five design principles from the methodological requirements of TA and the conditions introduced by LLM-based inference: preserving interpretative context, maintaining traceable relationships between empirical material and analytical outputs, representing analytical constructs and reasoning explicitly, constraining LLM inference to interpretative tasks, and enabling privacy-preserving local deployment. Second, it presents a proof-of-concept for a two-phase workflow that operationalizes these principles by combining interpretative LLM inference with deterministic procedural control to generate codes, analytical justifications, themes, and theme descriptions while preserving explicit links to the source material. Third, it proposes an evaluation framework combining structural comparison with human-led TA and independent expert assessment of analytical quality. The evaluation is conducted on semi-structured Danish interview transcripts. and the results shows that the workflow produces code-level outputs with coverage broadly comparable to human annotations and highly rated analytical justifications, while generating a more compressed thematic structure characterized by fewer and broader themes. The findings demonstrate the feasibility of auditable LLM-supported TA through a modular workflow designed to scale to larger datasets, accommodate different LLMs, and support transfer across research domains, with domain adaptation primarily requiring adjustments to the prompting strategy.
Nadia Jul Jeldtoft, Tariq Yousef
Department of Culture and Language 2Department of Mathematics and Computer Science University of Southern Denmark
Thematic analysis is difficult to scale: manual workflows are labor-intensive, while fully automated pipelines often lack controllability and transparent evaluation. We present CentaurTA Studio, a web-based system for self-improving human--agent collaboration in open coding and theme construction. The system integrates (1) a two-stage human feedback pipeline separating simulator drafting and expert validation, (2) persistent prompt optimization that distills validated feedback into reusable alignment principles, and (3) rubric-based evaluation with early stopping for process control. Across three domains, CentaurTA achieves the strongest performance in both Open Coding and Theme Construction, reaching up to 92.12% accuracy and consistently outperforming baseline systems. Agreement between the rubric-based LLM judge and human annotators reaches substantial reliability (average κ=0.68). Ablation studies show that removing the feedback loop reduces performance from 90% to 81%, while eliminating the Critic or early stopping degrades accuracy or increases interaction cost. The full system reaches peak performance within 10 iterative rounds (about 25 minutes), demonstrating improved efficiency over expert-only refinement.