[Paper Review] Codebook LLMs: Evaluating LLMs as Measurement Tools for Political Science Concepts
This paper proposes a codebook-construct label assumption to improve LLM-based measurement in political science, arguing that LLMs must strictly follow detailed codebook definitions rather than relying on universal label meanings. Using Mistral 7B Instruct, it finds that instruction-tuning significantly boosts performance (F1 0.76 vs. 0.53) over zero-shot classification, while codebook restructuring offers only modest gains, highlighting the need for LLM compliance checks and semi-structured codebook formats.
Codebooks -- documents that operationalize concepts and outline annotation procedures -- are used almost universally by social scientists when coding political texts. To code these texts automatically, researchers are increasing turning to generative large language models (LLMs). However, there is limited empirical evidence on whether "off-the-shelf" LLMs faithfully follow real-world codebook operationalizations and measure complex political constructs with sufficient accuracy. To address this, we gather and curate three real-world political science codebooks -- covering protest events, political violence and manifestos -- along with their unstructured texts and human labels. We also propose a five-stage framework for codebook-LLM measurement: preparing a codebook for both humans and LLMs, testing LLMs' basic capabilities on a codebook, evaluating zero-shot measurement accuracy (i.e. off-the-shelf performance), analyzing errors, and further (parameter-efficient) supervised training of LLMs. We provide an empirical demonstration of this framework using our three codebook datasets and several pretrained 7-12 billion open-weight LLMs. We find current open-weight LLMs have limitations in following codebooks zero-shot, but that supervised instruction tuning can substantially improve performance. Rather than suggesting the "best" LLM, our contribution lies in our codebook datasets, evaluation framework, and guidance for applied researchers who wish to implement their own codebook-LLM measurement projects.
Motivation & Objective
- To address the limitations of zero-shot LLM classification in political science by replacing the universal label assumption with a codebook-construct label assumption.
- To evaluate whether restructuring political science codebooks improves LLM zero-shot performance.
- To assess whether instruction-tuning LLMs on codebook-document-label triples enhances classification accuracy over zero-shot inference.
- To develop a semi-structured LLM-friendly codebook format that supports both human and machine annotation.
- To establish diagnostic tools for measuring LLM compliance with codebook instructions in social science applications.
Proposed method
- The authors curated three real-world political science datasets with their original codebooks, ensuring data isolation to prevent contamination in LLM training.
- They restructured the original codebooks into a semi-structured, LLM-readable format to improve model understanding.
- Zero-shot classification was performed using Mistral 7B Instruct with both original and restructured codebooks as prompts.
- Instruction-tuning was applied using parameter-efficient fine-tuning (PEFT) on codebook-document-label triples to improve compliance.
- Performance was evaluated using micro-F1 scores across all datasets, with error analysis to identify model failures and codebook ambiguities.
- A compliance metric was developed to detect hallucinated or incorrect label predictions, especially in cases of high model deviation from codebook rules.
Experimental results
Research questions
- RQ1Does providing a full codebook, either in original or restructured form, significantly improve zero-shot LLM classification performance on political science text?
- RQ2Can rewriting codebooks into a semi-structured, LLM-optimized format improve zero-shot LLM performance?
- RQ3Does instruction-tuning LLMs on codebook-document-label triples lead to significant performance gains over zero-shot inference?
- RQ4To what extent do LLMs comply with complex codebook constraints, such as exclusion criteria and hierarchical label rules?
- RQ5Can LLMs be used to identify gaps or inconsistencies in codebooks during iterative development?
Key findings
- Instruction-tuning Mistral 7B Instruct on codebook-document-label triples increased micro-F1 from 0.53 to 0.76 on one dataset, indicating substantial performance gains.
- Restructuring codebooks led to only modest improvements in zero-shot performance, suggesting that structural clarity alone is insufficient for LLM compliance.
- The LLM exhibited significant non-compliance on the Manifesto dataset, hallucinating labels for nearly half of the documents, indicating poor adherence to codebook rules.
- Despite using detailed codebooks, the LLM struggled to follow exclusion criteria and hierarchical label distinctions, revealing limitations in zero-shot reasoning.
- Manual error analysis revealed ambiguous codebook language and potential labeling errors, suggesting LLMs can help refine codebooks during development.
- The semi-structured codebook format improved model interpretability and provided a foundation for future LLM training and compliance testing.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.