Human-in-the-loop LLM-assisted thematic analysis: A validated, reproducible tutorial for large-scale qualitative research.

IF 5 2区 心理学 Q1 PSYCHOLOGY, EXPERIMENTAL
Mandana Jafarian
{"title":"Human-in-the-loop LLM-assisted thematic analysis: A validated, reproducible tutorial for large-scale qualitative research.","authors":"Mandana Jafarian","doi":"10.3758/s13428-026-03207-6","DOIUrl":null,"url":null,"abstract":"<p><p>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.</p>","PeriodicalId":8717,"journal":{"name":"Behavior Research Methods","volume":"58 11","pages":""},"PeriodicalIF":5.0000,"publicationDate":"2026-10-19","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Behavior Research Methods","FirstCategoryId":"102","ListUrlMain":"https://doi.org/10.3758/s13428-026-03207-6","RegionNum":2,"RegionCategory":"心理学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q1","JCRName":"PSYCHOLOGY, EXPERIMENTAL","Score":null,"Total":0}
引用次数: 0

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.

人在循环法学硕士辅助专题分析:大规模定性研究的验证,可复制的教程。
大型语言模型(llm)越来越多地用于支持定性研究,但将它们整合到主题分析中的明确方法框架仍然有限。一个核心挑战是如何在LLM的帮助下进行定性编码,同时保持方法的严谨性和可重复性。本教程介绍了一个结构化的、人在循环的工作流,用于在LLM支持下进行大规模主题分析。基于主题分析的归纳和混合方法(Braun & Clarke, 2006),工作流程分为三个阶段。首先,研究人员对数据子集进行手动主题分析,以建立初始代码本并评估相关性。其次,使用LLM对相同的子集进行分析,以迭代地改进提示并评估人类和模型输出之间的一致性。第三,将经过验证的方法应用于完整的语料库,采用模块化的四步管道:关键思想提取、块级主题编码、主题整合和聚类,并通过随机抽样的输出进行迭代的人工验证。我们使用2,952个公开可用的Reddit帖子来演示工作流。结构化的提示设计和json格式的输出支持主题和源数据之间的可跟踪性,并支持可再现的分析。提示工程被视为一个迭代的分析过程,而不是一次性的指令。在控制条件下,人类和LLM编码表现出高度一致性(Cohen’s κ = 0.91)。所有提示、代码和再现性材料都可以通过开放科学框架存储库公开获得。通过提供详细的实现指导、嵌入式验证过程和防止常见失败模式(如幻觉和过度概括)的措施,本教程为将法学硕士集成到跨领域的定性研究中提供了一个实用且可扩展的框架。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
CiteScore
10.30
自引率
9.30%
发文量
266
期刊介绍: Behavior Research Methods publishes articles concerned with the methods, techniques, and instrumentation of research in experimental psychology. The journal focuses particularly on the use of computer technology in psychological research. An annual special issue is devoted to this field.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信
小红书