Apply to my task
arXiv:2608.22417 ★ 83 Aug 23, 2026

Two-stage LLM survey coding: turning hundreds of open-ended answers into categories and themes without a predefined scheme

Key result

The finding: GPT-5 agrees with itself more strongly than two human researchers agree with each other on the same survey. The four-prompt method lets you turn hundreds of open-ended answers into categories and themes without a predefined coding scheme: the model derives the structure from the text itself, the way a researcher does in qualitative analysis. The trick is to split "come up with categories" and "sort into categories" into two separate requests, so the model doesn't juggle creation and application at once. But the higher the level of generalization (from specific categories to big themes), the more the result diverges from human logic.

01

TL;DR

The method takes raw text answers (from a survey, interviews, reviews) and turns them into structured categories through four sequential prompts: first the model invents categories from the texts itself, then sorts each answer into those categories, then merges the categories into larger themes, and finally assigns the categories to themes. This isn't pre-made labeling: the model derives the structure from the data itself, the way a human researcher does in qualitative analysis.

The key finding: the LLM agrees with humans fairly well when it comes to sorting answers into specific categories; agreement is medium-to-high. But when it comes to generalizing categories into themes (a higher level of abstraction), agreement with humans drops noticeably. Here the model agrees with itself even more strongly than humans agree with each other, but that's its "own internal logic," which doesn't always match human logic. Plus, the model tends to find meaning where an answer is actually empty or unclear ("signal from noise").

The core of the method is splitting a complex qualitative analysis task into two levels (codes → themes), and at each level first asking the model to generate the structure and then, in a separate prompt, apply that structure to the data. Separating "come up with categories" from "sort into categories" is the key move: it reduces confusion and gives you a verifiable intermediate 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

STEP 1a: Give the model all the answers → it generates a list of primary categories with descriptions (separate prompt)
STEP 1b: Give the model the same answers + the category list from step 1a → it assigns each answer one or more categories with an explanation (separate prompt)
STEP 2a: Give the model the list of primary categories from step 1a → it groups them into larger themes with descriptions (separate prompt)
STEP 2b: Give the model the category list + the theme list → it assigns each category to a theme with an explanation (separate prompt)

All four steps are separate requests; the output of each step is copied into the next prompt as input.

03

Example

Task: HR ran a survey of 300 employees with the open question "Why would you consider leaving the company?" They need to understand the main reasons without a predefined category list.

Prompt (step 1a):

You are an experienced researcher specializing in qualitative text analysis.
Your task is to analyze employee survey answers and identify suitable categories.
Study the answers below and find recurring themes, motives or intentions.
At the end, output a table listing the categories you found with a short description (1-2 sentences) for each.

Here are the employee answers:
1. [answer 1]
2. [answer 2]
...
n. [answer n]

Output the table in Markdown, one row per category.
First column: category name; second column: category description.

Result: The model produces a table of 5-10 categories (e.g., "low pay," "no career growth," "conflicts with management") with descriptions. Then this list goes into the step 1b prompt, where the model sorts all 300 answers into these categories with a short explanation for each. After that, steps 2a and 2b merge the categories into 2-3 big themes (e.g., "financial dissatisfaction" and "management problems").

04

Why it works

An LLM does poorly if you ask it to produce a final classification of hundreds of answers in one go: it gets confused, repeats similar categories in different words, loses consistency over a long list. That's the weakness: the model doesn't hold a single "registry" of categories in its head unless you give it one explicitly.

But the model is excellent at spotting patterns in text and applying a ready-made category list to new text; that's essentially a classification task, where it's stable. Splitting into "come up with categories" (creation) and "sort into categories" (application) uses exactly this strength: at each step the model does one simple thing instead of juggling creation and application at once.

Control levers: - Number of answers per request → if there are many (500+), split them into batches and after each one ask the model to add new categories only if the old ones don't fit (as in the original: "priority is to use the categories already created") - Asking for an explanation ("in 1-2 sentences, why") → drop it if you only need the result without justification; it will speed up and shorten the answer - Abstraction level of themes in step 2a → explicitly ask for "not too narrow, not too broad"; agreement with human logic depends heavily on this

05

Prompt template

STEP 1a — Generating categories:
You are an experienced researcher specializing in {analysis_type, e.g. "qualitative analysis of customer reviews"}.
Your task is to analyze the texts below and identify suitable categories.
Find recurring themes, motives or intentions.
Output a Markdown table: a "Category" column and a "Category description" column (1-2 sentences).

Here are the texts:
{text_list}

STEP 1b — Assigning categories:
Your task is to assign each text to one or more categories from the list below.
Explain in 1-2 sentences why that particular category was chosen.

Here are the texts:
{text_list}

Here are the categories:
{category_list_from_step_1a}

Output a Markdown table: "Text number" | "Category(ies), separated by semicolons" | "Explanation".

STEP 2a — Generating themes:
Your task is to analyze the list of primary categories and identify broader, unifying themes.
Choose an appropriate level of generalization — not too narrow, but not too broad either.
Output a Markdown table: "Theme" | "Theme description".

Here are the primary categories:
{category_list_from_step_1a}

STEP 2b — Assigning categories to themes:
Your task is to assign each primary category to the most fitting theme.
Explain your choice in 1-2 sentences.

Here are the primary categories:
{category_list_from_step_1a}

Here are the themes:
{theme_list_from_step_2a}

Output a Markdown table: "Category" | "Theme" | "Explanation".

Put your own data into {analysis_type} and {text_list}: it can be a survey, reviews, interviews, comments.

🚀 Quick start — paste into the chat:

Here is the four-step template for analyzing open-ended texts. Adapt it to my task: {your task}.
Ask me questions to fill in the fields.

[paste the template above]

The LLM will ask how much text you have, how granular the categories should be and what language you need the output in, because that determines how to split the texts into batches and what abstraction level to set for the themes.

06

Limitations

⚠️ Abstraction hurts accuracy: at the level of specific categories the LLM agrees with humans fairly well, but when generalizing categories into themes, agreement drops: the model generalizes its own way, not the way a human does.

⚠️ False signal from noise: the model tends to find meaning even in unclear or effectively empty answers, where a human would write "unclear." Check short and odd answers by hand.

⚠️ There's no single right answer: the method was compared against humans, not against a "correct" gold standard, and the humans disagree with each other almost as much as with the model. That's not a model error, it's the nature of qualitative analysis.

⚠️ Results depend heavily on the question type: for emotionally charged or vague topics (e.g., "how to improve your financial situation") agreement is lower than for concrete questions (e.g., about mobility barriers).

07

How it was studied

The researchers took a real survey of almost 3000 doctoral students across Europe and selected 10% of the answers (903 of them) to six open questions: about access to education, finances, well-being, mobility and overall impressions. Five human coders hand-coded these answers using a standard qualitative analysis method, while GPT-5 was run in parallel through the same four-step prompting process.

Agreement was measured with the Adjusted Rand Index, essentially a metric that checks whether the same pairs of answers land in the same group for both the human and the model, regardless of what the group is called. The agreement came out moderate: 0.61 at the category level and 0.54 at the theme level. Meanwhile, the humans agreed with each other at 0.68, and the model with itself (between coding and themes) at 0.76.

A curious detail: wherever the coders themselves (both humans and the model) were internally inconsistent, human-model agreement dropped too. So the problem isn't always the model; it's often the ambiguous data itself. At the end, the researchers simply showed the humans the LLM's results and asked their opinion: all five coders said the result reflected their own logic and that they would trust the model with it.

08

Resources

Bergmann, L., Gheorghiu, R., Gvritishvili, A., Mican, A., Stewart, C., Tolonen-Weckström, T. — LLMs for Survey Text Analysis: A Performance Comparison Between Humans and GPT-5 on Inductive Content Analysis. The data and analysis code are open: osf.io/rgkeh. The method is based on the procedure from Bergmann et al. (2025).

Research digest

Key result

The finding: GPT-5 agrees with itself more strongly than two human researchers agree with each other on the same survey. The four-prompt method lets you turn hundreds of open-ended answers into categories and themes without a predefined coding scheme: the model derives the structure from the text itself, the way a researcher does in qualitative analysis. The trick is to split "come up with categories" and "sort into categories" into two separate requests, so the model doesn't juggle creation and application at once. But the higher the level of generalization (from specific categories to big themes), the more the result diverges from human logic.

Principle

Don't ask the model to produce a final classification of hundreds of answers in a single prompt: it gets confused and stamps out similar categories in different words. Do this instead: one prompt where the model generates the category list, a second where it applies that list to each answer. The same scheme repeats when moving from categories to themes (steps 2a and 2b). An assembly line instead of one giant request: at each step the model solves just one simple task.

Why it works

An LLM doesn't keep a single category list in its head when it chews through hundreds of answers in one pass: it mixes up similar wording and duplicates categories. But sorting text against a ready list is its strength, and there it's stable. At the level of specific categories, agreement with humans is medium-to-high, but at the theme level it drops sharply: generalizing requires not pattern matching but a subjective choice of abstraction level, and here the model has its own internal logic. Plus, the model sees meaning even in empty or odd answers: where a human would write "unclear," it finds a category.

When to apply

Surveys and qualitative text analysis → for fast first-pass coding of hundreds of open-ended answers (interviews, reviews, surveys with open questions), especially when there's no predefined category scheme and you need a draft for human review. Not suited as a final result without manual checking, especially at the theme level and for emotionally charged, vaguely worded questions.

Mini recipe

1. Collect the answers: put the whole set of open-ended answers into one numbered list. 2. Step 1a: invent categories: in a separate prompt, ask the model to find recurring motives and output a "Category | Description" table. 3. Step 1b: sort into categories: in a new prompt, give the same answers plus the category list from step 1a, and ask it to assign each answer with a short explanation. 4. Step 2a: group into themes: give only the category list (no answers), ask it to merge them into 2-5 big themes, explicitly stating the generalization level: "not too narrow, not too broad." 5. Step 2b: link categories to themes: give the categories and themes, ask it to assign each category to a theme with an explanation. 6. Check by hand: skim the short and odd answers; the model loves finding meaning where there is none.

Examples

[BAD]: `Here are 300 employee answers to "why did you quit" — classify them and give me the final themes right away` [GOOD]: `Step 1: find recurring categories in these 300 answers, output a category-description table. [after the model's answer] Step 2: now assign each of the 300 answers to these categories with an explanation of why that category was chosen`

In plain words

A model can't do inductive content analysis off the cuff. Dump 300 open-ended answers to "why do you want to quit?" into it and demand categories, and you're headed for a total flop. The model will quickly forget its own wording, spawn a pile of synonyms and spit out meaningless mush. It simply doesn't have the bandwidth to keep a single taxonomy in focus while thoughtfully reading hundreds of different complaints.

It's like trying to clean out a hopelessly cluttered garage in one sitting. If you try to immediately arrange hundreds of little bits of hardware neatly on perfect shelves, you'll lose your mind and quit halfway. The sane approach is to dump the junk on the floor first, sort similar stuff into piles (bolts with bolts, drill bits with drill bits), and only then label the big boxes. Cramming it all into one request is pure busywork.

The solution is a strict four-prompt pipeline. First the model reads the raw pile and, bottom-up, writes a list of primary categories. In the second step it methodically tags each answer strictly against that registry. In the third it merges the small categories into big cross-cutting themes, and in the fourth prompt it assembles the final hierarchy. The division of labor removes duplicates and keeps the model from hallucinating.

It was tested on survey responses, but the principle is universal. The pattern digests any unstructured text perfectly: App Store reviews, in-depth interview transcripts, support tickets or hundreds of customer comments. Any pile of qualitative paperwork turns into clean quantitative analytics in three minutes instead of two weeks of manual slog.

Bottom line: stop feeding the model walls of text through one-shot requests; you'll get garbage out. A step-by-step inductive chain delivers solid-analyst-level results for a couple of cents in API costs. Whoever rebuilds their feedback processing around this scheme will save hundreds of hours; everyone else will keep drowning in raw, unreadable data.

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 Two-stage LLM survey coding: turning hundreds of open-ended answers into categories and themes without a predefined scheme arXiv:2608.22417

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