[Paper Review] Towards Coding Social Science Datasets with Language Models
GPT-3 can act as a synthetic coder for social science text coding, matching human coders and competing with supervised ML, with high efficiency using few-shot prompts across diverse tasks.
Researchers often rely on humans to code (label, annotate, etc.) large sets of texts. This kind of human coding forms an important part of social science research, yet the coding process is both resource intensive and highly variable from application to application. In some cases, efforts to automate this process have achieved human-level accuracies, but to achieve this, these attempts frequently rely on thousands of hand-labeled training examples, which makes them inapplicable to small-scale research studies and costly for large ones. Recent advances in a specific kind of artificial intelligence tool - language models (LMs) - provide a solution to this problem. Work in computer science makes it clear that LMs are able to classify text, without the cost (in financial terms and human effort) of alternative methods. To demonstrate the possibilities of LMs in this area of political science, we use GPT-3, one of the most advanced LMs, as a synthetic coder and compare it to human coders. We find that GPT-3 can match the performance of typical human coders and offers benefits over other machine learning methods of coding text. We find this across a variety of domains using very different coding procedures. This provides exciting evidence that language models can serve as a critical advance in the coding of open-ended texts in a variety of applications.
Motivation & Objective
- Motivate replacing or augmenting human coding with language models to reduce cost and variability in social science text coding.
- Demonstrate GPT-3’s ability to code across diverse datasets and coding schemes without fine-tuning.
- Compare GPT-3 coding performance to human coders and to traditional supervised ML approaches.
- Assess reliability (intercoder agreement) and efficiency (time/cost) of GPT-3 coding across tasks.
Proposed method
- Provide task-specific prompts to GPT-3 with two to three exemplars to teach the coding task.
- Convert GPT-3 outputs into categorical or ordinal codes and compare with human coders using intercoder reliability metrics.
- Use four datasets (PP, CAP-Congress, CAP-NYT, TGP) to test coding across domains, data structures, and measurement types.
- Compute intraclass correlation (ICC), joint probability of agreement, and Fleiss’ kappa to quantify agreement between GPT-3 and humans.
- Calibrate GPT-3 category probabilities to account for model bias when multiple categories are possible (optional, modest gains).

Experimental results
Research questions
- RQ1Can GPT-3 code social science texts with performance comparable to human coders using few-shot prompts without fine-tuning?
- RQ2How does GPT-3’s coding reliability (ICC, kappa, joint agreement) compare to human coders and to supervised machine learning baselines across diverse datasets?
- RQ3Do prompt design and exemplar selection meaningfully affect GPT-3’s coding accuracy and reliability?
- RQ4What are the efficiency and cost implications of using GPT-3 for large-scale text coding versus traditional human or ML approaches?
- RQ5Are there domain-specific or category-specific patterns in GPT-3’s coding performance compared to humans?
Key findings
- GPT-3 can match human coder performance on average across ordinal and categorical coding tasks with only 2–3 exemplars.
- GPT-3 often increases intercoder reliability (ICC) relative to human-only coding in several attributes, though not uniformly across all categories.
- GPT-3’s performance is competitive with supervised ML baselines, achieving substantial accuracy with far fewer labeled examples (e.g., 4 exemplars vs thousands).
- Across four datasets (PP, CAP-Congress, CAP-NYT, TGP), GPT-3’s agreement with humans is on par with human-human agreement in many cases, with some variability by task and category.
- Calibration of GPT-3 probabilities can yield modest accuracy gains (≈4–5%).
- In the Guardian Populism data, GPT-3 achieves around 0.77 ICC with humans (vs 0.81 for humans) and about 79% of human coding accuracy using 4 exemplars, while a bag-of-words ML approach reaches ~86% with thousands of labeled examples.

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.