Prompt stability scoring for text annotation with large language models
Researchers are increasingly using large language models (LLMs) for text annotation, typically relying on prompts that instruct the model to return a given output. LLM outputs can nonetheless be vulnerable to minor prompt variations, raising concerns about the reliability and reproducibility of classification routines. Stability is a necessary but not sufficient condition for both accuracy and reproducibility. To diagnose this, we propose the prompt stability score, an automated procedure for measuring agreement across repeated runs and semantically similar prompt variants, and provide an accompanying Python package, promptstability. Using 6 datasets and 12 outcomes, we generate tilde $\sim$ ~ 3.1 m annotations (tilde $\sim$ ~ 300 m input tokens) to characterize when prompt-based pipelines are stable versus fragile. We conclude with practical recommendations for applied research.
Authors
- Christopher Barrie (ORCID: https://orcid.org/0000-0002-9156-990X)
- Petter Törnberg (ORCID: https://orcid.org/0000-0001-8722-8646)
- Elli Palaiologou
Institutions
- New York University (US)
- University of Amsterdam (NL)
Publication Details
- Journal
- Political Science Research and Methods
- Published
- 2026-12-03
- DOI
- https://doi.org/10.1017/psrm.2026.10159
- Citations
- 47
- Primary Topic
- Computational and Text Analysis Methods
- Type
- article
- Field-Weighted Citation Impact
- 68.60