Skip to main content
QUICK REVIEW

[Paper Review] Prompt Stability Scoring for Text Annotation with Large Language Models

Christopher Barrie, Elli Palaiologou|arXiv (Cornell University)|Jul 2, 2024
Natural Language Processing TechniquesComputer Science3 citations
TL;DR

This paper introduces the Prompt Stability Score (PSS), an automated diagnostic framework that measures consistency in large language model (LLM)-based text annotation across repeated prompt runs and semantically similar prompt variants. Using a Python package called promptstability, the authors analyze six datasets and twelve outcomes, finding that even minor prompt variations can cause significant label instability, highlighting the need for stability checks before accuracy validation.

ABSTRACT

Researchers are increasingly using language models (LMs) for text annotation. These approaches rely only on a prompt telling the model to return a given output according to a set of instructions. The reproducibility of LM outputs may nonetheless be vulnerable to small changes in the prompt design. This calls into question the replicability of classification routines. To tackle this problem, researchers have typically tested a variety of semantically similar prompts to determine what we call ``prompt stability." These approaches remain ad-hoc and task specific. In this article, we propose a general framework for diagnosing prompt stability by adapting traditional approaches to intra- and inter-coder reliability scoring. We call the resulting metric the Prompt Stability Score (PSS) and provide a Python package exttt{promptstability} for its estimation. Using six different datasets and twelve outcomes, we classify $\sim$3.1m rows of data and $\sim$300m input tokens to: a) diagnose when prompt stability is low; and b) demonstrate the functionality of the package. We conclude by providing best practice recommendations for applied researchers.

Motivation & Objective

  • To address the lack of reliability checks in LLM-based text annotation pipelines, which often assume stability from a single prompt without testing robustness.
  • To diagnose whether LLM annotation pipelines are fragile to minor prompt variations or run-to-run stochasticity, which undermines reproducibility.
  • To provide a practical, automated diagnostic tool that can be used before costly manual validation to ensure internal consistency.
  • To empirically characterize when and why LLM-based annotation pipelines fail to maintain stable outputs under minor perturbations.
  • To demonstrate that high accuracy from a single prompt does not guarantee reproducibility, especially when outputs shift under slight rewordings.

Proposed method

  • The authors generate controlled paraphrases of a baseline prompt using an automated paraphrasing engine, preserving semantic equivalence while varying wording.
  • For each prompt variant and repeated run of the baseline, the LLM is applied to the same input texts to collect label outputs.
  • Inter-prompt and intra-prompt stability scores are computed using a reliability coefficient (e.g., Fleiss’ kappa or similar) treating each prompt variant or repeated run as a rater.
  • The method quantifies agreement across repeated runs (intra-PSS) and across semantically similar prompt variants (inter-PSS), serving as a diagnostic for pipeline robustness.
  • The promptstability Python package automates the entire pipeline, including prompt generation, LLM inference, and stability score computation with configurable decoding parameters.
  • The framework supports manual review and editing of generated variants to maintain interpretability and transparency.

Experimental results

Research questions

  • RQ1To what extent do minor, semantically equivalent prompt variations cause significant shifts in LLM-generated labels across different datasets and outcomes?
  • RQ2How does run-to-run stochasticity in LLM inference affect label consistency, even with fixed decoding parameters?
  • RQ3Can automated prompt variation detect fragility in LLM-based annotation pipelines before manual validation is conducted?
  • RQ4How do different decoding hyperparameters (e.g., temperature, top-p) influence the stability of LLM annotations?
  • RQ5What is the computational cost of performing stability diagnostics at scale, and is it feasible as a pre-validation step?

Key findings

  • The study generated approximately 3.1 million annotations across six datasets and twelve outcomes, involving roughly 300 million input tokens, to assess stability.
  • Even with low-temperature decoding, repeated runs of the same prompt produced inconsistent labels in borderline cases, indicating intra-prompt instability.
  • Inter-prompt stability scores declined significantly when prompt variants were generated at higher temperatures, suggesting sensitivity to semantic rephrasing.
  • Stability patterns were recoverable on small subsamples, with full analysis costing approximately $158 using gpt-3.5-turbo, making the diagnostic feasible as a pre-validation step.
  • The framework successfully identified fragile pipelines where small prompt changes led to label shifts, even when the baseline prompt appeared accurate.
  • The promptstability package enables researchers to inspect all generated variants and associated stability scores, supporting transparency and auditability.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.