Manuel B. Garcia

Manuel B. Garcia serves as the Senior Director for Educational Technology and Digital Learning at FEU Institute of Technology, Manila, Philippines. Read More

Contact Info

1607, FEU Tech Building,
P. Paredes St, Sampaloc,
Manila, Philippines
mbgarcia@feutech.edu.ph

Follow Me

Can Generative AI Apply a Qualitative Research Codebook?

Generative AI can apply predefined qualitative codes to interview transcripts and other textual data, but reliable classification depends on clear definitions and appropriate validation. Learn how to prepare a codebook for AI-assisted coding, evaluate ambiguous assignments, detect coding drift, and preserve methodological consistency.

449
Can AI Apply a Qualitative Codebook? Guide 449 of 1196
01 · The Question

Can You Give AI a Codebook and Ask It to Code Your Interviews?

You have developed a qualitative research codebook containing labels, definitions, and examples. Perhaps your research team has already tested it on several interview transcripts and agreed on how the codes should be applied. You now have dozens of additional transcripts awaiting analysis.

Could you give the codebook to ChatGPT or another generative AI system, provide the transcripts, and instruct it to apply the same coding rules?

The task seems straightforward because the codes have already been defined. Unlike generating entirely new codes, the system would be selecting from an established set of categories.

However, applying a codebook involves more than recognizing keywords. The model must interpret the meaning of each passage, distinguish similar codes, respect exclusion rules, and recognize cases that do not fit the framework. An apparently consistent coding table can conceal systematic misclassification.

02 · The Short Answer

Yes, AI Can Apply a Codebook, but Its Assignments Require Validation

In Brief

Generative AI can apply a predefined qualitative research codebook by assigning established codes to interview excerpts, survey responses, or other textual material. This can support deductive coding and structured qualitative analysis, particularly when codes have clear definitions, inclusion and exclusion criteria, and examples. However, AI may misapply codes, overlook contextual meaning, confuse overlapping categories, or assign labels to passages that do not meet the coding rules.

The reliability of AI-assisted codebook application depends on the coding framework, model, instructions, data characteristics, and validation procedures. Researchers should evaluate coding performance against independently reviewed material and retain responsibility for resolving ambiguous assignments and interpreting the results.

03 · What You Need to Know

How AI Applies a Qualitative Codebook and Where Errors Arise

What Does It Mean to Apply a Qualitative Codebook?

A qualitative codebook is a structured reference that defines the codes used to classify or organize qualitative material. It may contain code names, definitions, inclusion criteria, exclusion criteria, examples, and relationships among codes.

Applying a codebook means examining a passage and determining whether its content satisfies the criteria for one or more predefined codes.

For example, a study examining barriers to online learning might use the following codes:

  • Connectivity Barrier: Participation is disrupted by internet access, network stability, or connection quality.
  • Device Access Barrier: Participation is limited by the availability, suitability, or sharing of digital devices.
  • Household Environment Barrier: Participation is affected by noise, interruptions, lack of space, or household activities.
  • Participation Anxiety: The participant describes apprehension about speaking, being evaluated, or interacting during class.

AI could examine an interview excerpt and select the code or codes that appear applicable.

This differs from asking AI to generate initial qualitative codes, where the analytical categories themselves are still being developed.

What Should a Codebook Contain Before AI Uses It?

A list of code names is usually insufficient for dependable classification. Labels such as "Access," "Engagement," or "Support" may be interpreted differently unless their boundaries are specified.

Methodological guidance from the US Centers for Disease Control and Prevention describes the value of codebooks containing definitions, examples, and guidance concerning when codes should or should not be applied. These features support more consistent coding within research teams. CDC guidance on qualitative analytical rigor discusses these practices in detail.

A practical codebook for AI-assisted classification should generally specify:

Codebook element Purpose Example
Code name Provides a consistent identifier CONNECTIVITY_BARRIER
Definition Explains the concept represented by the code Difficulty participating because of internet access or connection quality
Inclusion criteria Specifies when the code applies Disconnections, unstable bandwidth, inability to access online sessions
Exclusion criteria Clarifies superficially similar cases that should not receive the code Device malfunction unrelated to internet connectivity
Positive example Illustrates an appropriate assignment "I kept getting disconnected during the examination."
Boundary example Illustrates a potentially confusing case "My laptop stopped working during class."

The examples are hypothetical. Actual codebooks should be developed in relation to the study's research questions, theoretical framework, and data.

Clear rules make AI assignments easier to evaluate, but they do not eliminate the need for interpretation.

How Does AI Decide Which Code to Apply?

When provided with a codebook and a passage, a generative AI model produces an assignment based on the instructions, code definitions, examples, and text available in its context.

It does not necessarily follow the codebook as a deterministic rule-based program would. A model may interpret a definition broadly, prioritize a familiar phrase, or infer an unstated meaning.

Consider the statement:

"I couldn't join the discussion because my brother was using our only laptop."

The appropriate assignment under the illustrative codebook is DEVICE_ACCESS_BARRIER.

However, a model might assign CONNECTIVITY_BARRIER because the statement concerns difficulty joining an online activity. That classification would confuse access to a device with access to an internet connection.

The distinction may appear minor, but repeated misclassification can distort the study's findings, particularly when researchers compare the frequency or distribution of different barriers.

Why Inclusion and Exclusion Criteria Matter

Definitions explain what a code represents. Inclusion and exclusion criteria clarify its boundaries.

Suppose the code PARTICIPATION_ANXIETY applies when participants explicitly describe fear, embarrassment, apprehension, or concern about being judged during classroom interaction.

Now consider:

"I usually keep my microphone off during discussions."

Without further context, the statement does not establish anxiety. The participant might be experiencing background noise, technological limitations, personal preference, or a classroom rule.

An AI system that automatically assigns PARTICIPATION_ANXIETY would introduce an unsupported inference.

An exclusion rule could specify that microphone avoidance alone is insufficient unless the participant describes anxiety or another qualifying indication.

Such boundaries are particularly useful when multiple codes describe related but distinct experiences.

Can AI Apply Multiple Codes to the Same Passage?

Yes, provided the codebook permits multiple assignments.

Consider:

"I was nervous about speaking, and when I finally tried, my internet connection dropped."

Under the illustrative definitions, the passage supports both PARTICIPATION_ANXIETY and CONNECTIVITY_BARRIER.

If AI is instructed to assign exactly one code, it may discard relevant information. Conversely, if every remotely related code is allowed, the system may overcode passages.

The codebook should specify whether codes are mutually exclusive, whether multiple coding is permitted, and how overlapping concepts should be handled.

These decisions should follow the analytical purpose rather than the technical convenience of the AI system.

What Should AI Do When No Code Fits?

A well-designed coding workflow should allow the possibility that no existing code applies.

Suppose a participant says:

"I prefer studying early in the morning because I feel more productive."

If the codebook contains only the four barriers described earlier, none may apply.

Forcing the model to select the closest available code can create false classifications. The system should be permitted to return an explicit no-code result when the passage does not satisfy any definition.

It may also be useful to flag passages that appear relevant to the research question but fall outside the current coding framework. Researchers can then decide whether the codebook requires revision.

This is particularly important when a deductive coding framework encounters unexpected experiences in the data.

Can AI Handle Ambiguous or Overlapping Codes?

AI can compare code definitions and suggest which category is more appropriate, but ambiguous passages remain challenging.

For example, a participant may say, "I stopped joining online classes because I couldn't keep up."

The statement could concern connectivity, academic workload, instructional pace, or personal circumstances. Without additional context, assigning a specific barrier code would be speculative.

Rather than forcing a confident classification, the coding procedure should allow an uncertainty flag and a brief explanation of what information is missing.

Researchers should also examine whether ambiguity results from insufficient data or poorly distinguished code definitions.

When multiple codes repeatedly overlap, revising the codebook may be more appropriate than repeatedly asking AI to choose between them.

Can AI Apply a Codebook Consistently Across Hundreds of Interviews?

Potentially, but consistency should be demonstrated rather than assumed.

Large-scale coding may involve dividing transcripts into batches, processing different participants separately, or using automated workflows. These procedures introduce opportunities for inconsistency.

For example, the model might apply a code narrowly in one batch and more broadly in another. Changes to prompts, model versions, examples, or surrounding context may also influence assignments.

This phenomenon is often described as coding drift when the operational meaning or application of codes changes during analysis.

Researchers can reduce avoidable variation by maintaining a stable codebook version, using consistent instructions, preserving transcript context, and periodically examining coding decisions against a reference set.

Nevertheless, identical prompts do not necessarily guarantee identical outputs across systems or repeated runs.

How Should AI Coding Accuracy Be Evaluated?

Evaluation should match the coding task and methodological approach.

For structured classification, researchers may compare AI assignments with independently reviewed coding decisions. A validation set should include clear examples, ambiguous passages, overlapping codes, and statements that should receive no code.

Several measures may be useful:

  • Agreement: How often AI and reference coding decisions coincide.
  • Precision: Among passages assigned a particular code, the proportion that genuinely satisfy its criteria under the reference standard.
  • Recall: Among passages that satisfy a code's criteria, the proportion correctly identified by AI.
  • Code-specific error patterns: Which categories are most frequently confused or omitted.
  • Boundary-case performance: How the system handles ambiguous excerpts, overlapping categories, and no-code cases.

These measures require a clearly specified evaluation procedure. In multi-label coding, where several codes may apply to one passage, researchers should select metrics appropriate to that structure rather than relying on a single overall accuracy percentage.

Agreement coefficients such as Cohen's kappa may also be appropriate for certain designs, although their interpretation depends on the coding structure and prevalence of categories.

Importantly, human coding is not automatically an error-free gold standard. Reference assignments may require expert review and adjudication, and disagreements can reveal ambiguity in the coding framework itself.

What Does Methodological Research Recommend?

The CDC's guidance on collecting and analyzing qualitative data emphasizes repeated engagement with transcripts and the use of written code definitions and rules to reduce changes in coding practice. Its guidance on analytical rigor also discusses codebooks, examples, and collaborative refinement. The CDC Field Epidemiology Manual provides an accessible methodological reference.

A published case study on codebook development demonstrates how definitions, qualifications, exclusions, and examples can be documented to support systematic analysis. The approach is especially relevant when researchers need to explain why particular passages received particular codes.

These methodological principles provide a foundation for evaluating AI-assisted coding. They should not be interpreted as proof that a particular language model can apply any codebook accurately.

Does Codebook Application Fit Every Qualitative Methodology?

No. The appropriateness of a fixed coding framework depends on the analytical tradition.

Codebooks are commonly used in qualitative content analysis, framework analysis, and some forms of thematic analysis. They may support consistent classification when the research design calls for predefined or progressively refined categories.

However, Braun and Clarke distinguish codebook approaches from reflexive thematic analysis, which foregrounds the researcher's interpretive engagement and does not treat coding agreement as the principal measure of analytical quality.

Using AI to enforce a fixed codebook may therefore be compatible with one analytical approach but inconsistent with another if it substitutes classification reliability for the intended interpretive process.

Researchers should examine whether AI-assisted coding fits the epistemological assumptions of their study before selecting a workflow.

What About Confidentiality and Participant Consent?

Applying a codebook does not eliminate the ethical concerns associated with processing interview transcripts through AI.

Even when the model's task is limited to classification, the underlying data may contain personal experiences, sensitive disclosures, or indirect identifiers.

Researchers should verify whether the intended AI service and processing arrangements comply with ethics approval, participant consent, institutional policy, contractual restrictions, and applicable privacy law.

Where appropriate, institutionally approved or locally controlled processing environments may reduce some risks. Their suitability must still be assessed rather than assumed.

04 · A Practical Example

Testing Whether AI Applies a Codebook Correctly

Hypothetical Example

Coding Barriers to Online Learning Participation

A researcher conducts interviews about university students' participation in online classes. The study uses a structured qualitative coding approach and has developed four codes with explicit definitions.

For illustration, the researcher uses the following simplified codebook:

Code Include when Do not include when
CONNECTIVITY Internet availability or connection quality prevents or disrupts participation The problem concerns a device without evidence of network difficulty
DEVICE_ACCESS Device availability, sharing, or suitability limits participation The only problem is internet connectivity
HOME_ENVIRONMENT Household noise, interruptions, or space constraints affect participation The participant merely mentions studying at home without a barrier
PARTICIPATION_ANXIETY Fear, embarrassment, or apprehension affects classroom interaction The participant avoids speaking for reasons unrelated to anxiety

Applying the Codebook to Interview Excerpts

The researcher asks AI to apply only the specified codes and permit multiple assignments when supported.

Interview excerpt Appropriate code Reason
"My connection disappears whenever it rains." CONNECTIVITY The statement explicitly describes internet disruption.
"I have to wait until my sister finishes using our laptop." DEVICE_ACCESS Participation is limited by device sharing.
"I cannot concentrate because everyone is talking in the same room." HOME_ENVIRONMENT Household noise interferes with participation.
"I'm afraid my classmates will laugh if I answer incorrectly." PARTICIPATION_ANXIETY The participant explicitly describes fear of negative evaluation.
"I'm nervous about speaking, and my internet keeps disconnecting." PARTICIPATION_ANXIETY; CONNECTIVITY Both criteria are satisfied.
"I prefer reading the lesson before class." No code None of the specified barriers is established.

The assignments above represent the intended interpretation of the hypothetical codebook. They are not empirical evidence of any particular AI system's performance.

What if AI Misclassifies a Passage?

Suppose AI assigns CONNECTIVITY to the statement about sharing a laptop. The researcher should not simply correct that individual row and move on.

The error may indicate that the model is treating all difficulties accessing online classes as connectivity problems.

The researcher should inspect other passages involving device access, clarify the distinction if necessary, and test whether the system consistently follows the exclusion criteria.

Likewise, if the model assigns PARTICIPATION_ANXIETY whenever someone keeps a camera or microphone off, it may be inferring an emotional state that the participant did not report.

A Validation Workflow

1. Finalize a working codebook version. Define the codes, inclusion and exclusion rules, examples, and treatment of overlapping assignments.
2. Prepare a human-reviewed validation set. Select representative passages, including clear examples, boundary cases, multiple-code cases, and no-code cases.
3. Apply the codebook using AI. Provide stable instructions and request a code assignment linked to each transcript passage.
4. Compare assignments with the validation set. Identify false positives, missed codes, confused categories, and unsupported inferences.
5. Investigate systematic errors. Determine whether problems arise from ambiguous definitions, insufficient context, or model behavior.
6. Revise and retest when necessary. Document codebook or prompt changes and evaluate the revised procedure on material not used to develop those changes.
7. Apply the validated procedure with ongoing review. Check coding quality across batches and examine uncertain or consequential assignments.

A procedure that performs well on a small validation set may still encounter difficulties with different participants, language varieties, or interview contexts. Validation should therefore be treated as an ongoing quality-control activity rather than a one-time certification.

05 · What Researchers Often Get Wrong

Common Mistakes in AI-Assisted Codebook Application

Misconception

Providing Code Names Is Enough for Accurate Coding

Labels alone often leave important boundaries unspecified. AI may interpret broad terms differently from the researcher. Definitions, inclusion criteria, exclusions, and examples make coding decisions more explicit and easier to validate.

Misconception

AI Must Assign a Code to Every Passage

Some excerpts do not satisfy any code definition. Forcing an assignment can produce false positives and distort the analysis. A no-code option is appropriate when permitted by the coding procedure.

Misconception

One Passage Can Receive Only One Code

Multiple coding may be appropriate when a passage satisfies several definitions. Whether overlapping codes are allowed should be specified in the codebook rather than decided arbitrarily by the model.

Misconception

Consistent AI Output Automatically Means Correct Coding

A model may consistently apply an incorrect interpretation of a code. Repeated agreement with itself does not establish validity. Coding decisions must be evaluated against the intended definitions and the original data.

Misconception

High Overall Accuracy Means Every Code Performs Well

Overall accuracy can conceal poor performance on rare or difficult categories. Researchers should examine code-specific errors, false positives, false negatives, and boundary cases rather than relying on a single summary statistic.

Misconception

A Fixed Codebook Is Appropriate for Every Qualitative Methodology

Structured codebooks fit some qualitative approaches better than others. Applying coding reliability procedures to reflexive thematic analysis without methodological justification may create inconsistency between the study's assumptions and analytical practices.

06 · What This Means for You

How to Apply a Qualitative Codebook With AI Responsibly

AI-assisted codebook application is most defensible when the task is clearly defined, the coding rules are sufficiently explicit, and the researcher can evaluate the resulting assignments.

The objective should not be to make the model classify every passage as quickly as possible. It should be to determine whether AI can apply the intended analytical distinctions with an acceptable level of error for the research purpose.

Choose a Coding and Validation Strategy

If code definitions are vague or overlapping
Clarify the codebook and test boundary examples before large-scale AI coding.
If the task uses predefined categories
Use structured instructions, stable code identifiers, and independently reviewed validation material.
If excerpts can contain multiple meanings
Specify whether multiple codes are permitted and require evidence for each assignment.
If the model encounters ambiguous passages
Allow uncertainty flags and researcher review rather than forcing unsupported classifications.
If the coding procedure changes during analysis
Record the new codebook version, assess whether earlier material requires recoding, and retest performance.

Use a Prompt That Enforces the Codebook Boundaries

A practical instruction might be:

"Apply only the codes defined in the supplied qualitative codebook. Follow each code's definition, inclusion criteria, exclusion criteria, and examples. For every transcript segment, return its identifier, the applicable code or codes, the exact supporting text, and a brief explanation linked to the coding rules. Use NO_CODE when no definition is satisfied and FLAG_FOR_REVIEW when the available context is insufficient. Do not invent codes, infer unstated participant experiences, or modify quotations."

This instruction makes the intended behavior explicit, but it does not guarantee that the model will comply. The resulting assignments still require validation.

Keep the Codebook and Coding Records Versioned

When definitions change, record what changed and why. A revised exclusion criterion may alter how previously coded passages should be classified.

Maintain stable identifiers for transcripts and coded segments. Preserve the codebook version, relevant model information, prompts, coding outputs, researcher corrections, and validation results.

These records make it possible to distinguish changes in the coding framework from changes in the model's behavior.

Separate Coding Consistency From Interpretation

Even when AI applies a codebook accurately, the resulting classifications do not automatically establish the study's findings.

Researchers must still examine relationships among coded passages, contextual differences, contradictions, and the substantive meaning of the material.

Depending on the methodology, this may contribute to developing themes from interview transcripts or another form of qualitative interpretation.

Document the AI contribution and follow applicable requirements for reporting AI use in qualitative data analysis. Responsibility for the final analytical claims remains with the researchers.

07 · A Quick Checklist

Before Using AI to Apply a Qualitative Codebook

Verify the codebook and coding procedure:
Confirm that the coding framework is appropriate for the study's qualitative methodology.
Provide clear code names, definitions, inclusion criteria, exclusions, and examples.
Specify the coding unit and whether multiple codes may be assigned to one passage.
Allow no-code and uncertainty outcomes when appropriate.
Prepare a human-reviewed validation set containing clear and difficult examples.
Examine code-specific errors rather than relying only on overall agreement.
Check that assigned codes are supported by authentic transcript passages.
Maintain stable instructions and document codebook or model changes.
Verify ethical permissions and data protection requirements before processing participant material.
Retain records of validation, corrections, and researcher decisions.
08 · Frequently Asked Questions

Frequently Asked Questions About AI Qualitative Codebook Application

Can ChatGPT apply an existing qualitative codebook to interviews?

Yes. ChatGPT can assign predefined codes to interview passages when supplied with the codebook and appropriate instructions. However, researchers must verify whether assignments follow the intended definitions and account for context, ambiguity, and exclusions.

Can AI perform deductive qualitative coding?

AI can support deductive coding by classifying passages according to categories informed by theory, prior research, or a predefined framework. Its performance should be evaluated using a validation procedure appropriate to the coding task.

Does a codebook guarantee consistent AI coding?

No. A clear codebook can reduce ambiguity, but AI may still misinterpret definitions or behave differently across prompts and batches. Consistency should be evaluated empirically rather than assumed.

Can AI assign multiple codes to the same excerpt?

Yes. Multiple assignments may be appropriate when an excerpt satisfies several code definitions. The codebook should specify whether overlapping codes are allowed and how such cases should be handled.

What happens if an interview excerpt does not match any code?

The coding procedure should permit a no-code result when appropriate. Forcing an assignment may introduce false positives. Researchers may separately flag relevant passages that suggest the codebook needs revision.

How can I measure agreement between AI and human coding?

Depending on the coding design, researchers may calculate agreement rates, precision, recall, or suitable agreement coefficients. Multi-label coding requires measures that accommodate multiple assignments. The reference coding and evaluation procedure should be documented.

Can AI replace human coders in a large qualitative project?

AI may reduce manual classification work in a structured project, but whether it can perform a substantial coding role depends on demonstrated accuracy, error tolerance, methodological fit, and oversight arrangements. Researchers remain responsible for validation and interpretation.

Should I revise my codebook when AI repeatedly misclassifies a category?

Investigate the cause first. Repeated errors may indicate ambiguous definitions, insufficient context, overlapping categories, or model limitations. Revise the codebook only when the change improves the intended analytical framework, and retest the procedure afterward.

09 · The Bottom Line

AI Can Apply a Codebook, but Coding Accuracy Must Be Demonstrated

The Bottom Line

Generative AI can apply a qualitative research codebook by classifying textual passages according to predefined codes. Its usefulness depends on clear coding definitions, explicit boundaries, appropriate handling of ambiguous cases, and independent validation. A model's ability to produce a complete coding table does not establish that the assignments are correct or methodologically appropriate.

Use AI-assisted codebook application where structured classification genuinely serves the research design. Evaluate its errors, preserve the connection between codes and original evidence, and ensure that efficiency does not replace the analytical judgment required to interpret the findings.

10 · Sources and Further Reading

Methodological Sources on Qualitative Codebooks and Coding Consistency

11 · Cite this Guide

How to Cite This Guide

This guide is intended to be read, shared, and used in research, teaching, and academic work. If you draw on its ideas, explanations, or other content, please acknowledge the source by citing the guide. Doing so gives appropriate credit and helps your readers locate the original resource.

Has the Field Guide helped your research?

If a guide helped clarify a question, inform a research decision, or move your work forward, I would love to hear about your experience. Your story may also help other researchers discover the Field Guide.

Share Your Experience
Takes only a few minutes