Deductively coding psychosocial autopsy interview data using a few-shot learning large language model

Elias Balt, Salim Salmi, Sandjai Bhulai, Stefan Vrinzen, Merijn Eikelenboom, Renske Gilissen, Daan H. M. Creemers, Arne Popma, Saskia MérelleFrontiers in Public Health 2025

Abstract

State-of-the-art LLMs show great potential to support researchers in deductively coding complex interview data, which would alleviate the investment of time and resources. Integrating models with qualitative research procedures can facilitate near real-time monitoring. Based on the findings, we recommend a collaborative model, whereby the LLM's deductive coding is complemented by review, inductive coding and further interpretation by a researcher. Future research may aim to replicate the findings in different contexts and evaluate models with a larger context size.

Introduction

Qualitative research remains the "gold standard" for understanding the complex nuances of human behavior, particularly in sensitive fields like suicide prevention. One of the most rigorous methods in this field is the "psychosocial autopsy"—a series of in-depth, semi-structured interviews with the bereaved to reconstruct the circumstances leading to a suicide. However, the manual analysis of these transcripts is a monumental task. Coding—the process of labeling text segments with specific themes—can take months of expert labor, creating a significant bottleneck that prevents public health officials from performing near real-time monitoring of suicide trends.

This study, published in Frontiers in Public Health, investigates whether Large Language Models (LLMs) can bridge this gap by automating deductive coding without sacrificing the accuracy required for such sensitive data.

Methodology

The researchers utilized Llama 3 70B Instruct, hosted on a local server to maintain strict data privacy. Rather than undergoing resource-intensive fine-tuning, the model was implemented using a few-shot learning approach. This involved providing the model with a system prompt and two labeled examples (one positive, one negative) for each specific code in the research codebook.

Table 1: General performance benchmarks for the Llama 3 70B model architecture used in the study.

The evaluation was structured into three distinct levels of complexity:

  1. Binary Classification: Determining the presence of a specific code (e.g., "History of suicide attempts") within a short text fragment.
  2. Sliding Window Identification: Scanning full transcripts using 300-word overlapping windows to locate relevant segments.
  3. Summarization: Condensing identified fragments into coherent summaries for a research matrix.

To handle the identification of relevant segments across long transcripts, the team employed a peak detection and smoothing procedure to identify where the model's "occurrence" signals were strongest.

Figure 1: Example of the peak detection and smoothing procedure used to identify relevant segments within the sliding window framework.

Data and Corpus

The study analyzed 38 full-word interview transcripts from a 2021–2022 study on railway suicides in the Netherlands. The dataset, entirely in Dutch, consisted of 2,666 manually coded fragments which served as the "gold standard" for comparison. This provided a unique test case for LLM performance in non-English qualitative research.

Key Results

The model demonstrated "substantial agreement" with human experts. In the binary classification task, it achieved a mean accuracy of 0.84 and a Cohen’s Kappa of 0.68. While accuracy dropped to 0.67 during the more difficult sliding window task, the qualitative quality of the output remained high: human raters judged 80% of the LLM-generated summaries as "adequate" or "good."

One of the most significant findings was the efficiency gain. While human researchers required approximately four months to code the 38 interviews alongside their other duties, the LLM completed the task in just eight days.

Insights and Discussion

Concrete vs. Abstract Coding

The LLM's performance varied significantly based on the nature of the code. It excelled at "concrete" codes (e.g., "Travel to site by car," 1.00 accuracy) but struggled with more "abstract" interpersonal or behavioral codes (e.g., "Changes in behavior," 0.75 accuracy), which require deeper inferential reasoning.

The "False Positive" Advantage

Interestingly, the model tended toward false positives rather than false negatives. In a qualitative workflow, this is a distinct advantage. It is significantly faster for a human researcher to discard an irrelevant model-generated segment than to search through a 30,000-word transcript for a missed theme.

Chronological Blindness and Hallucination

The primary technical hurdle was the model's 8,192-token context window. This limitation necessitated the sliding window approach, which occasionally caused the model to lose the broader narrative timeline. For instance, it might misidentify a past event as a recent one because it lacked the full temporal context of the interview. Additionally, while the hallucination rate was low (1.3%), the errors were often glaring, such as attributing statements to the wrong person.

Conclusion: The Collaborative Model

The study concludes that while LLMs are not yet ready for autonomous qualitative analysis, they are exceptional research assistants. The authors propose a Collaborative Model: the LLM handles the "heavy lifting" of initial deductive coding and summarization, while the human researcher focuses on high-level interpretation, inductive coding (identifying new, emerging themes), and quality oversight. This human-in-the-loop approach offers a viable path toward real-time suicide surveillance and more responsive public health interventions.

Summary updated

BibTeX
@inproceedings{balt2025deductively,
  author = {Elias Balt and Salim Salmi and Sandjai Bhulai and Stefan Vrinzen and Merijn Eikelenboom and Renske Gilissen and Daan H. M. Creemers and Arne Popma and Saskia Mérelle},
  title = {{Deductively coding psychosocial autopsy interview data using a few-shot learning large language model}},
  booktitle = {Frontiers in Public Health},
  year = {2025},
  doi = {10.3389/fpubh.2025.1512537},
}
Figure