Human-in-the-loop LLM-assisted thematic analysis: A validated, reproducible tutorial for large-scale qualitative research.
Journal:
Behavior research methods
Published Date:
Oct 19, 2026
Abstract
Large language models (LLMs) are increasingly used to support qualitative research, yet clear methodological frameworks for integrating them into thematic analysis remain limited. A central challenge is how to scale qualitative coding with LLM assistance while preserving methodological rigor and reproducibility. This tutorial presents a structured, human-in-the-loop workflow for conducting large-scale thematic analysis with LLM support. Grounded in inductive and hybrid approaches to thematic analysis (Braun & Clarke, 2006), the workflow proceeds in three phases. First, researchers conduct manual thematic analysis on a subset of data to establish an initial codebook and assess relevance. Second, the same subset is analyzed using an LLM to iteratively refine prompts and evaluate alignment between human and model outputs. Third, the validated approach is applied to the full corpus using a modular four-step pipeline: key-idea extraction, chunk-level thematic coding, theme consolidation, and clustering, with iterative human verification through random sampling of outputs. We demonstrate the workflow using 2,952 publicly available Reddit posts. Structured prompt design and JSON-formatted outputs enable traceability between themes and source data and support reproducible analysis. Prompt engineering is treated as an iterative analytic process rather than a one-time instruction. Under controlled conditions, human and LLM coding showed high agreement (Cohen's κ = 0.91). All prompts, code, and reproducibility materials are openly available via an Open Science Framework repository. By providing detailed implementation guidance, embedded validation procedures, and safeguards against common failure modes such as hallucination and overgeneralization, this tutorial offers a practical and extensible framework for integrating LLMs into qualitative research across domains.
Authors
Keywords
No keywords available for this article.