arXiv:2610.35179cs.CLOct 2026

Manuscript Offprint

arXiv:2610.35179

High Scores, Hidden Failures: Evaluating Codebook-Based LLM Content Analysis

Elena Senger, Yuri Campbell, Rob van der Goot, Barbara Plank

Abstract

Large language models (LLMs) are increasingly used for codebook-based content analysis in computational social science, where codebooks translate theoretical concepts into labeling schemes. While prior work reports strong predictive performance, it remains unclear whether these systems produce reliable and robust text annotations. We conduct a large-scale empirical failure-mode analysis of LLM-based coding pipelines across four datasets and five models by systematically evaluating their stability, robustness, and conceptual validity under controlled perturbations, domain shifts, and optimization procedures. We uncover multiple failure modes that are largely invisible under standard metrics, showing that high aggregate scores frequently coexist with severe label-level disparities, instability across runs, domain sensitivity, and shifts in label interpretation. Importantly, these failure modes persist under widely used optimization strategies and remain largely invisible under standard metrics such as accuracy and micro-F1. Our results demonstrate that current LLM-based coding pipelines cannot be treated as stable measurement tools without targeted validation beyond aggregate performance.

1 Introduction

Large language models (LLMs) are increasingly used to annotate text data using natural language instructions, enabling scalable labeling for tasks such as dataset construction, qualitative coding, and content analysis (Törnberg, 2024; Abraham et al., 2025; Rytting et al., 2023; Xiao et al., 2023). In computational social science (CSS), these instructions are typically formalized as codebooks, structured annotation guidelines that map theoretical concepts onto predefined labels. For example, a codebook for analysing news coverage of minimum wage policies might define labels such as Prices, Government, Welfare, and Justice to classify the different concepts through which minimum

Accuracy & Micro-F1 Look Strong

Figure

Figure 1: Illustrative examples of LLM failure modes in inference and optimization hidden beneath metrics.

wage policies are discussed in each text. By incorporating the codebook’s labels and their definitions directly into prompts, recent studies report strong predictive performance and substantial agreement between human and LLM annotations, suggesting that LLMs could serve as scalable substitutes for human coders (Rytting et al., 2023; Ramanathan et al., 2025; Ruckdeschel, 2025; Farjam et al., 2025).

However, the use of LLMs for codebook-based annotation introduces two sources of potential failure. First, LLMs may fail to apply codebook instructions consistently during inference. A growing body of NLP research highlights prompt sensitivity (Shu et al., 2024; Mizrahi et al., 2024; Gu et al., 2023), where model predictions change under seemingly minor prompt variations, such as formatting choices, label ordering, or wording differences. Beyond prompt sensitivity, LLM-based coding pipelines may also exhibit broader robust-ness issues, including instability across repeated runs, inconsistent adherence to codebook definitions, and large disparities in performance across individual labels. Second, LLMs are increasingly used not only to apply annotation instructions but also to refine or optimize the prompts themselves. Recent approaches employ automatic prompt optimization or multi-agent prompting frameworks to iteratively modify prompts in order to improve predictive performance (Abraham et al., 2025; Zhao et al., 2025). While these methods can yield improvements on standard evaluation metrics, they also introduce additional risks. For instance, modifying prompts that encode coding schemes can implicitly alter label definitions, amplify disparities in label-level performance, or shift the conceptual meaning of the constructs being measured (see Section 5). These issues are consequential in content analysis, where annotations function as measurements (Krippendorff, 2018). They feed downstream statistical analyses (frequency comparisons, regressions, hypothesis testing), as well as qualitative interpretation, including conceptual and relational analysis. This requires that performance is balanced across labels for frequency-based claims to hold (Egami et al., 2023), results are comparable across runs, models, and corpora for findings to replicate, and the labels must retain the theoretical constructs the codebook was designed to measure (Halterman and Keith, 2025).

In this paper, we operationalize the risks around faithful LLM coding by defining controlled experiments and complementary metrics. Then, we empirically demonstrate that current LLM-based codebook methods systematically fail in predictable ways. We organize our study around a set of failure modes, spanning two stages of practical CSS pipelines: (1) inference failure modes, which arise when an LLM applies a fixed codebook (see Section 4), and (2) optimization-induced failure modes, which arise when an LLM is used to refine a codebook prior to inference (see Section 5). Our main contributions are:

• A framework for systematic failure-mode analysis for LLM content analysis, identifying predictable breakdowns at both the inference and optimization stages.

• Evidence across four datasets and five models that commonly reported performance metrics can misrepresent coding reliability by masking these failures, along with a minimal validation protocol (see Section 6) to uncover such failure modes.

• Two new expert-annotated datasets sharing a single codebook, enabling controlled domain-transfer evaluation, as well as code and evaluation pipeline to support reproducibility. 1^{1}