Apply to my task
arXiv:2510.18456 ★ 86 Oct 21, 2025

LLMs in Qualitative Analysis: Structured Prompts + Self-Check = Methodological Rigor

Key result

The paradox: 61% of the time, experts preferred LLM codes over those from human analysts — but only when the methodology was built right into the prompt. The method lets you analyze interviews, reviews, and open-ended answers with professional rigor: find patterns, create codes, group themes — the way a qualitative analysis expert does. The trick: a self-check before output. The model gets an expert role, a research question (RQ), and quality criteria from thematic analysis. Before output it grades itself: "Is the code specific? Does it help answer the RQ?" — if not, it redoes it. Result: codes that are crisper and more specific than the human ones.

01

TL;DR

The researchers built a prompt system for qualitative data analysis (interviews, reviews, open-ended answers) with LLMs — and tested whether a model can work as rigorously as a professional analyst. Instead of simply asking "find the themes in these interviews", they baked a methodological structure right into the prompt: an expert role, a research question, quality criteria, a self-check before output, and JSON format for downstream processing. Experts compared codes from the LLM and from humans — and preferred the LLM's 61% of the time: the codes were crisper, more specific, and better structured.

Key finding: LLMs handle explicit meaning well but miss what's hidden. The model sees "the employee said the team supports him" and creates the code "Team support". But it doesn't notice that the employee twice clarified that there is support, even though no one asked→ maybe he's compensating for a lack of support at the company level. A human picks up on this latent layer (anxiety, contradiction); the LLM doesn't. Another problem is over-fragmentation: the model chops the data into pieces that are too small instead of finding broad patterns. "Flexible schedule", "Remote work", "Work-life balance" become three separate codes, even though they're one theme.

The core of the method is a multi-stage pipeline with a human as referee. Phase 1: a human reads the data. Phase 2: the LLM codes the segments, the human checks them against a rubric. Phase 3: the LLM groups codes into themes within each interview. Phases 4-5: the LLM merges themes across all interviews and refines names and boundaries — the human evaluates again. Phase 6: the human writes the final report. The key point: every prompt has a built-in self-check — the model grades its output against the "Excellent" criteria from the rubric BEFORE showing the result.


Want this for your own case? Apply this study to your task: AI adapts its method to what you are working on and writes the prompt.

02

Method Blueprint

Phase 1: Human reads the data (getting familiar with the material)

Phase 2: LLM creates codes → Human grades them against the rubric

PROMPT → "You are an expert researcher. RQ: [question]. 
Create codes: clear, specific, analytically useful.
Before output, grade yourself against: [Excellent rubric].
Format: JSON with fields: segment, codes, explanation, sensitive"

Phase 3: LLM groups codes into themes (for one interview) → Human reviews

Phases 4-5: LLM merges themes across all interviews + refines boundaries → Human grades against the rubric

Phase 6: Human writes the final report with interpretation


03

Example in Practice

Task: You're running a series of customer interviews for a startup building a freelancer-matching service for US tech companies. You have 20 recorded conversations with CTOs and team leads. You need to find patterns: what keeps them from hiring remote contractors, what they fear, what they expect. Classic qualitative analysis would take a week — you'd have to code every interview, find recurring themes, and check you didn't miss anything important.

Prompt (simplified version for a quick start):

You are an expert in qualitative data analysis for product research.

RESEARCH QUESTION: 
What factors influence whether tech companies hire freelancers or not?

TASK:
Read the CTO interview below. Create codes — short labels for important ideas that help answer the question.

CODE QUALITY CRITERIA (grade yourself before output):
- Clarity: the code is understandable, no ambiguity
- Relevance: directly tied to the research question
- Specificity: narrow focus, no overlap with other codes
- Analytical value: helps reveal a pattern, not just a paraphrase

OUTPUT FORMAT:
JSON with fields:
- segment: quote from the interview (verbatim)
- code: short label (2-5 words)
- explanation: why this segment matters for answering the question
- line_number: line number in the interview (for verification)

SELF-CHECK:
Before output, ask yourself:
1. Does this code help answer the RQ?
2. Is it specific enough?
3. Is the explanation convincing?
If not — redo it.

INTERVIEW:
[paste transcript]

Result:

The model will return structured JSON with codes such as "Distrust of remote workers", "Fear of losing control", "Bad past freelancer hire", "1099 contractor paperwork hassle". Each code is tied to a specific interview quote with a line number — so you can verify the model isn't hallucinating.

In the explanation field, the model explains why it picked that segment: "The respondent twice stressed the risk of data leaks through freelancers, pointing to a trust barrier — a key reason for not hiring".

You get a first-pass pattern map in 10 minutes instead of a day of manual work. Then you review the codes, cut the extras, and group them into themes. The LLM did the grunt work — you take it to the finish line, adding the context the model may have missed.


04

Why It Works

The LLM's weakness: The model doesn't understand the research context or methodological standards. Just ask it to "find themes" and you'll get a shallow summary or hallucinations. Without quality criteria, the LLM doesn't know what a "good code" is in qualitative analysis — it may produce labels that are too broad ("Hiring problems") or too narrow ("Respondent mentioned Upwork").

The LLM's strength: The model is excellent at following explicit instructions and structured templates. Build methodological criteria right into the prompt (as the study did with Braun and Clarke's rubrics for qualitative analysis), and the LLM starts imitating a professional analyst. It spots patterns across large volumes of text, groups similar ideas, and gives clear labels — but only if it knows exactly what's expected of it.

The method taps that strength through three levers:

  1. Role + RQ + Methodology — the model understands "who I am", "why I'm doing this", "how to do it right". Instead of an abstract "find themes", it gets a concrete frame: "You're a researcher, your job is to answer question X, use an inductive approach (from data to themes)".
  2. Self-check before output — the study's key trick. The model grades its draft against the "Excellent" criteria BEFORE showing the result. It's similar to Chain-of-Thought, but instead of "think out loud" it's "check yourself against a checklist". In the experiment this gave a jump in quality: codes got more specific, explanations more convincing.
  3. Verifiable references — the prompt requires a line/interview number for every code. That kills hallucinations: the model can't make up a quote if it has to say where it came from. A human can quickly check whether a code is real.

Prompt control levers:

  • Quality criteria → drop the self-check to go faster (but quality will drop). Or add your own criteria: "the code should apply to other interviews too".
  • Output format (JSON) → switch to a table or Markdown if you don't need automated processing.
  • Methodological orientation → switch from inductive (data-driven) to deductive (hypothesis testing) if you already have a list of themes.
  • Level of detail → say "create 3-5 codes per interview" to save tokens, or "be as detailed as possible" for deep analysis.

05

Prompt Template

You are an expert in qualitative data analysis in {domain: product research / UX / marketing}.

RESEARCH QUESTION:
{question: e.g. "Why do users cancel their paid subscription?"}

TASK:
Read the {data type: interviews / reviews / open-ended answers} below. 
Create codes — short labels for important ideas that help answer the question.

METHODOLOGY:
- Approach: {inductive (from data to themes) / deductive (hypothesis testing)}
- Level of interpretation: {semantic (explicit meaning) / latent (hidden meaning)}

CODE QUALITY CRITERIA:
- Clarity: the code is understandable without extra explanation
- Relevance: directly tied to the research question
- Specificity: narrow focus, no overlap with other codes
- Analytical value: helps reveal a pattern, not just a paraphrase of the respondent's words

OUTPUT FORMAT:
JSON with fields:
- segment: quote from the data (verbatim)
- code: short label (2-5 words, verb or noun)
- explanation: why this segment matters for answering the RQ
- source_reference: {line number / respondent ID / date} for verification

SELF-CHECK before output:
1. Does every code help answer the RQ?
2. Are the codes specific enough (not "Problems" but "High price compared with competitors")?
3. Are the explanations convincing and not just repeating the quote?
4. Are all quotes real (checkable via source_reference)?

If any answer is "no" — redo it before output.

DATA:
{paste transcript / reviews / answers}

What to fill in:

  • {domain} — the research area (product, UX, HR, marketing)
  • {question} — the main research question you're trying to answer
  • {data type} — interviews, marketplace reviews, survey answers
  • {approach} — inductive (looking for new themes) or deductive (testing hypotheses)
  • {level of interpretation} — semantic (what the person said outright) or latent (what's behind the words)
  • {source_reference} — how to cite the source: line number, ID, date — whatever lets you verify the quote

🚀 Quick start — paste into a chat:

Here is a template for qualitative data analysis with a built-in quality self-check. 
Adapt it to my task: {describe your task — e.g. "Analyze 15 interviews with customers of a SaaS product who canceled their subscription"}.

Ask me questions so you fill in the template fields correctly.

[paste the template above]

The LLM will ask: what your research question is (to focus the codes), what data you have (interviews/reviews — this shapes the coding style), which approach (look for something new or test hypotheses). It will take the structure from the template — role, RQ, quality criteria, self-check — and adapt it to your task. You'll get a working prompt with methodological rigorwithout having to master the finer points of qualitative analysis.


06

Limitations

⚠️ Latent (hidden) meaning: LLMs handle explicit statements well ("the respondent said X") but miss subtext, contradictions, and nonverbal cues. If someone says "everything's fine" sarcastically, the model won't catch it. For tasks where context and the emotional layer matter (interviews about personal experience, team conflicts), you need to review the codes by hand.

⚠️ Over-fragmentation: The model chops data into pieces that are too small. Instead of one theme, "Work flexibility", it creates three separate codes: "Remote work", "Flexible schedule", "Work-life balance". That complicates later analysis — you have to group and consolidate by hand.

⚠️ Fuzzy theme boundaries: When merging codes into themes (phases 4-5), the model sometimes creates overlapping categories. For example, a "Team support" theme and an "Organizational culture" theme may overlap. The experts recommend a final human review of the theme structure.

⚠️ Requires expert oversight: The method doesn't fully automate the analysis. Phases 1 (reading the data) and 6 (writing the report) stay human. Between phases you need rubric-based grading — otherwise the model can drift away from the RQ or produce convincing-sounding but wrong interpretations.


07

How They Tested It

The researchers took 15 real interviews about software engineers' well-being (177 pages of transcripts) — a topic where both explicit factors (pay, schedule) and hidden ones (anxiety, burnout) matter. Two experienced analysts hand-coded these interviews using the Braun and Clarke method — that became the gold standard for comparison.

Then they created three prompts for phases 2–5 of thematic analysis (coding, grouping, merging themes) and ran them through 4 LLMs: ChatGPT o3-mini, GPT-4o, Claude Sonnet 4, Gemini 2.5 Pro. Each prompt went through iterations — for example, the coding prompt was rewritten 8 times because early versions produced hallucinations (made-up quotes) and codes that were too broad. The final version added a self-check — the model grades its output against the "Excellent" criteria from the rubric BEFORE showing the result. That gave a jump in quality.

To evaluate the results, four experts (professors and PhDs with qualitative research experience) ran a blind evaluation: they were shown pairs of codes (human vs LLM) without the author — and had to pick the better one. In 61% of cases the experts chose the LLM codes, citing greater clarity, specificity, and analytical depth. But the experts also noticed weaknesses: the model fragmented the data (created too many small codes instead of broad patterns) and missed latent meaning (didn't see contradictions or subtext).

Why this particular result? The LLM codes looked more professional: short, standardized, with clear explanations. The human codes were more context-sensitive, but often longer, less uniform, and sometimes redundant. In a head-to-head comparison, the LLM codes' visual "polish" won out. But that doesn't mean the LLM understands the data better — just that its presentation is more convincing.

Surprising insight: a self-check in the prompt works as a quality amplifier. When the model grades its draft against a checklist ("Is this code specific enough? Is it relevant to the RQ?"), it rewrites the output — and the final version comes out stronger. It's like editing improving a text, except the editor is the model itself, using criteria from the prompt.

Practical takeaway: LLMs can handle the routine parts of qualitative analysis (coding, grouping) if you structure the prompt right — but the final interpretation must be human. The model doesn't replace the analyst; it speeds up the grunt work 5–10x.


08

Original from the Paper (optional)

Context: The researchers created three prompts for the phases of thematic analysis. Below is a simplified structure of the Prompt 1 (Coding)that generated codes from the interviews. The full version runs 1485 tokens; here are the key elements.

You are a world-class software engineering researcher with deep expertise 
in qualitative data analysis and reflexive thematic analysis.

STUDY GOAL:
Identify the factors that influence the well-being of software engineers.

RESEARCH QUESTION:
What factors influence the well-being of software engineers in their work?

METHODOLOGICAL ORIENTATION:
- Inductive approach (data-driven, not testing predefined themes)
- Semantic level (focus on explicit meanings, what participants said directly)
- Experiential perspective (participants' lived experiences and perceptions)

CODING PRINCIPLES:
- Succinct: Short, focused labels (2-5 words)
- Specific: Narrow focus, distinct from other codes
- Gerunds preferred: "Experiencing burnout" not "Burnout"
- Informative: Label captures essence, not just repeats words

EVALUATION CRITERIA (assess your output before finalizing):
1. Clarity: Code meaning is unambiguous
2. Relevance: Directly addresses the research question
3. Semantic accuracy: Captures what participant meant
4. Specificity: Distinct, non-overlapping
5. Theme potential: Will support meaningful theme development
6. Alignment: Reflects dataset content accurately
7. Good labels: Concise, insightful shorthand

CONTEXT:
Interview number: {N}
Interviewer's question: {question}

OUTPUT FORMAT:
Return JSON with fields:
- segment: Verbatim quote from response
- codes: Array of code labels (2-5 words each)
- explanation: Why this segment matters for answering RQ (2-3 sentences)
- sensitive: Boolean (true if mentions mental health, conflict, discrimination)
- line_number: Exact line in transcript (for verification)

RESPONSE TO BE CODED:
{participant's response}

SELF-CHECK before output:
1. Each code helps answer "What influences well-being?"
2. Codes are specific enough to distinguish from others
3. Explanations justify selection convincingly
4. All segments traceable to line numbers (no hallucinations)

If any answer is "no" → revise before returning output.

This prompt builds in methodological rigor (a clear RQ, evaluation criteria) + a self-check (the model edits itself against a checklist) + hallucination protection (a required line number). The result: codes that experts preferred over the human ones 61% of the time.


09

Adaptations and Extrapolations

💡 Adaptation for customer review analysis:

The original method was built for interviews, but it also works for reviews on marketplaces, social media, and websites. Replace "interview segment" with "review text", and the RQ with "Why are customers unhappy with delivery?". The self-check and structure stay the same.

You are an expert in customer experience analysis.

RESEARCH QUESTION:
Why do customers give low ratings to courier service X?

TASK:
Read the review below. Create codes for the drivers of dissatisfaction.

QUALITY CRITERIA:
- Clarity: the code is understandable
- Relevance: tied to the question
- Specificity: narrow focus

SELF-CHECK:
1. Does the code explain the reason for the low rating?
2. Is it specific enough (not "Bad service" but "Courier was 2 hours late with no heads-up")?

FORMAT:
JSON: {segment, code, explanation, review_id}

REVIEW:
{review text}

Effect: Instead of sorting through 500 reviews by hand over a week, you get structured codes in an hour. Then you group them into the top 5 problems and set priorities.


🔧 Technique: Drop the self-check → faster processing

If you have lots of data (1000+ reviews) and need speed over depth, remove the SELF-CHECK block from the prompt. The model will return results faster, but code quality will drop (more broad, less specific codes).

When to use it: First-pass exploration of large volumes. Then you hand-pick the interesting segments and run them through the full prompt with the self-check.


🔧 Technique: Add examples of good codes → few-shot learning

Paste 2-3 examples of great codes from your own data into the prompt:

EXAMPLES OF GOOD CODES:
Segment: "The account manager didn't answer 5 emails in a week"
Code: "Ignoring customer requests"
Explanation: Shows a systemic communication problem that hurts loyalty

Segment: "The price went up 30% in a month with no explanation"
Code: "Opaque pricing"
Explanation: The customer loses trust because of unexpected changes in terms

Effect: The model copies the style and depth of your examples. The codes get closer to how you'd write them yourself.


💡 Extrapolation: Multi-stage analysis for complex decisions

Use the study's logic (Phase 2 → Phase 3 → Phases 4-5) for decision-making. For example, choosing a business idea:

Phase 1 (human): Gather 10-15 ideas with descriptions (from brainstorming, trends, personal experience).

Phase 2 (LLM): Create codes for each idea — factors FOR and AGAINST.

You are a startup evaluation expert.

RQ: What factors determine the viability of this business idea?

Create codes for the idea below: strengths, risks, barriers to entry.
Format: JSON {aspect, code, explanation}

IDEA: {idea description}

Phase 3 (LLM): Group the codes into themes for each idea (e.g. "Market potential", "Operational risks").

Phases 4-5 (LLM): Compare themes across all 10 ideas. Rank the ideas by theme strength and frequency of supporting data.

You have themes for 10 business ideas. 
Merge and rank: which idea has the strongest themes with the lowest risks?

Phase 6 (human): Read the top 3 ideas with the LLM's rationale. Pick the final one using your intuition and the context the model can't see (your resources, personal motives).

Effect: Instead of "this feels like a good idea", you get a structured, data-backed comparison. The LLM does the analytical work; you make the final call.


10

Resources

Large Language Models in Thematic Analysis: Prompt Engineering, Evaluation, and Guidelines for Qualitative Software Engineering Research
Cristina Martinez Montes, Robert Feldt, Cristina Miguel Martos, Sofia Ouhbi, Shweta Premanandan, Daniel Graziotin
Chalmers University of Technology, University of Gothenburg, Universidad Ramon Llull, Uppsala University, University of Hohenheim

The study builds on the Braun and Clarke's Reflexive Thematic Analysis methodology — the gold standard of qualitative analysis in the social sciences and software engineering research.


Research digest

Key result

The paradox: 61% of the time, experts preferred LLM codes over those from human analysts — but only when the methodology was built right into the prompt. The method lets you analyze interviews, reviews, and open-ended answers with professional rigor: find patterns, create codes, group themes — the way a qualitative analysis expert does. The trick: a self-check before output. The model gets an expert role, a research question (RQ), and quality criteria from thematic analysis. Before output it grades itself: "Is the code specific? Does it help answer the RQ?" — if not, it redoes it. Result: codes that are crisper and more specific than the human ones.

Principle

Don't throw raw data at an LLM with a request to `find themes` — you'll get a shallow summary or hallucinations. Build a pipeline with a check at every stage: 1) A human reads the data. 2) The LLM creates codes with a self-check → the human grades them against a rubric. 3) The LLM groups codes into themes within each interview. 4-5) The LLM merges themes across all interviews + refines boundaries → the human reviews. 6) The human writes the final report. Key point: every prompt has quality criteria + a self-check built in BEFORE output. The model knows "what a good code is" in qualitative analysis — it won't produce a vague label like "Hiring problems" if the criteria demand specificity.

Why it works

The LLM's weakness: without a methodological frame, the model doesn't know what a "good code" is. It'll produce something either too broad ("Problems") or too narrow ("Mentioned Upwork"). Its strength: the model is excellent at following explicit instructions and structured templates. The method uses three levers: 1) Role + RQ + Methodology — the model understands "who I am, why I'm doing this, how to do it right". 2) Self-check before output — the model grades its draft against the "Excellent" criteria BEFORE showing the result (like Chain-of-Thought, but "check yourself against a checklist"). 3) Verifiable references — the prompt requires a line number for every code. The third lever kills hallucinations: the model can't make up a quote if it has to say where it came from. In the experiment the codes got more specific and the explanations more convincing — the experts chose the LLM 61% of the time.

When to apply

Qualitative analysis of large volumes of text → customer interviews, marketplace reviews, open-ended survey answers, especially when you need methodological rigor (for publishing research or making strategic decisions). Examples: find patterns in 20 churned-customer interviews for a SaaS product, analyze 500 reviews of a new feature, code the answers from a UX study. NOT a fit for tasks where the latent (hidden) layer is critical: sarcasm, contradictions, nonverbal cues. The LLM sees "the respondent said there is support" but won't catch "he clarified it twice even though no one asked — maybe he's compensating for a lack of support at the company level".

Mini recipe

1. Define the research question (RQ): What exactly are you looking for in the data? Not an abstract "understand the experience" but a concrete "What factors drive the decision to cancel a subscription?" 2. Build the methodology into the prompt: State the role (`expert in qualitative analysis`), the RQ, the approach (inductive, from the data, or deductive, testing hypotheses), and the code quality criteria (clarity, relevance, specificity, analytical value) 3. Add a self-check: Before output, the model should ask itself: "Does the code help answer the RQ? Is it specific enough? Is the explanation convincing?" — if not, redo it 4. Require verifiable references: For every code — line number / respondent ID / date. This kills hallucinations 5. Set the output format: JSON with the fields `segment` (quote), `code` (2-5 word label), `explanation` (why it matters for the RQ), `source_reference` (where it came from) 6. Grade against the rubric: After output, assess the codes — how specific, relevant, and analytically useful they are. Cut the extras and group fragmented ones ("Remote work" + "Flexible schedule" = one theme, "Work flexibility")

Examples

[BAD]: `Find the main themes in interviews with customers who churned` (The model doesn't know what a "good theme" is and will give you a shallow summary or hallucinations) [GOOD]: `You are an expert in qualitative analysis for product research. RQ: What factors drive SaaS subscription cancellations? Read the interview. Create codes — short labels (2-5 words) for ideas related to the RQ. Quality criteria: clarity (understandable without explanation), relevance (tied to the RQ), specificity (narrow focus), analytical value (helps reveal a pattern). JSON format: segment (quote), code (label), explanation (why it matters for the RQ), line_number (for verification). SELF-CHECK before output: 1) Does the code help answer the RQ? 2) Is it specific enough? 3) Is the explanation convincing? If not — redo it. [paste transcript]` (The model gets a role, an RQ, quality criteria, a self-check, and a format with verifiable references — the codes will be crisp and methodologically rigorous)

In plain words

The gist: LLMs can now do qualitative data analysis as well as seasoned sociologists — as long as you stop asking them to "just find the themes". The researchers proved it: the model delivers top-tier results when you hard-wire a strict methodological structureinto it. Instead of reading tea leaves, the model now works by protocol: it takes on an expert role, keeps a specific question in mind, and runs its own conclusions through a quality filter before spitting out an answer. As a result, in 61% of cases human experts agreed the AI did better: its codes were sharper, its logic more transparent, and its structure didn't sag from fatigue.

It's like hiring an intern to dig through a mountain of customer interviews, but instead of saying "eh, read through some of it" you hand them a step-by-step checklist and make them justify every word. Technically it's the same job, but the results are night and day. Without clear guardrails, the model acts like a lazy student: it either churns out obvious platitudes like "business problems"or latches onto random details and loses the point. The right prompt turns it from a chatty parrot into a meticulous analystwho doesn't miss the important patterns.

The study brought out the heavy artillery: role-playing, quality criteria and mandatory JSON output. That last one isn't just a programmer's whim — it forces the model to structure its thinking so it can be fed into any software without manual cleanup. The real trick here is the self-check. The model first analyzes the data, then critiques its own findings, and only then hands over the final list of themes. That cuts out 80% of the junk and hallucinations that usually sink automated analysis.

Although the method was tested on interviews with software engineers, the principle is universal. The same setup will tear through marketplace reviews, open-ended survey answers, or mountains of support tickets just as well. No more spending a week with a highlighter over printouts trying to figure out why customers are leaving. LLM analytics is no longer a shot in the dark — it's a rigorous tool that scales a researcher's brain across thousands of pages of text for pennies.

Bottom line: qualitative analysis has stopped being an art for the chosen few and become a production process. Build the methodology right into the prompt and the AI stops screwing up and starts seeing meaning where a human would just get tired and close the file. Beating humans 61% of the time is a death sentence for the old duct-tape way of working. Either you learn to code meaning with LLMs, or you keep drowning in endless transcripts while competitors grab the insights in five minutes.

AI lab assistant

Apply this study to your task

Describe what you're working on. AI takes the method and the measured results from this paper and adapts them to your case, or writes a ready prompt built on them.

Based on LLMs in Qualitative Analysis: Structured Prompts + Self-Check = Methodological Rigor arXiv:2510.18456

Sign in to apply this study New accounts get 50 free credits.