Abstract
BACKGROUND: Advance care planning (ACP) education has gained importance since Taiwan’s 2019 Patient Right to Autonomy Act, which empowers individuals to make advance medical decisions. Yet younger populations remain unfamiliar with ACP. This study examined how large language models (LLMs) can assist in qualitative thematic analysis of 1,761 reflection cards written by college students after an interactive ACP lecture. METHODS: Four LLMs—GPT-4, Gemini Advanced 2.0, DeepSeek, and Claude 3.5 (Sonnet)—were each tested under two prompting conditions: a short generic instruction and a longer role-based prompt directing the model to act as a palliative care professor. The models inductively generated codes and themes without a predefined codebook. Their outputs were compared for thematic richness, interpretive depth, alignment with Braun and Clarke’s framework, and consistency with human-derived themes from reflexive thematic analysis. RESULTS: All LLMs generated coherent thematic structures but differed in scope and depth. GPT-4 and Gemini produced concise, structured outputs closely resembling human analysis. DeepSeek provided narrative richness and cultural insight, emphasizing emotional and ethical dimensions. Claude 3.5 offered the most detailed categorization with frequency data and emotional tone analysis. Across models, recurring themes included understanding of ACP, family communication, life-and-death reflection, gratitude toward the lecture, and intentions to act. CONCLUSION: LLMs demonstrated strong potential for conducting rapid and meaningful thematic analysis of qualitative data, identifying key educational and emotional patterns comparable to human analysis. They may serve as valuable adjuncts for large-scale qualitative research and medical education evaluation. SUPPLEMENTARY INFORMATION: The online version contains supplementary material available at 10.1186/s12909-026-08851-2.