Prompt Stability Scoring for Text Annotation with Large Language Models
This paper addresses the vulnerability of large language model text annotation to prompt variations by proposing a general framework called the Prompt Stability Score (PSS), which adapts traditional reliability metrics to diagnose stability issues and includes a Python package for practical implementation.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
The Big Idea: Is Your AI "Fickle"?
Imagine you hire a very smart, but slightly nervous, assistant to sort a pile of letters into "Yes" and "No" envelopes. You give them a specific instruction: "If the letter mentions money, put it in the 'Yes' pile."
You ask them to do this 30 times.
- Scenario A: They put the same letters in the same piles every single time.
- Scenario B: On the 1st try, they put a letter about "savings" in the "Yes" pile. On the 2nd try, they put that same letter in the "No" pile. On the 3rd try, they put it in "Yes" again.
Even if the assistant is usually right, Scenario B is a problem. It means their decision-making is unstable. If you can't trust them to be consistent with the exact same instructions, you certainly can't trust them if you change the wording slightly (e.g., "If the letter talks about cash...").
This paper is about building a test to see if your AI assistant is stable (Scenario A) or fickle (Scenario B) before you let it do any real work.
The Problem: AI is Sensitive to "Word Salad"
The authors explain that Large Language Models (AI) don't work like a calculator. They don't look up a fixed answer in a book. Instead, they predict the next word one by one, like a person guessing what comes next in a sentence.
Because of this, two things can mess up their consistency:
- The "Same Prompt" Problem: Even if you type the exact same instructions twice, the AI might give a slightly different answer because of tiny, invisible random factors in its computer brain (like a coin flip happening in the background).
- The "Rephrasing" Problem: If you change your instructions just a little bit—like saying "Classify this" instead of "Sort this"—the AI might get confused and give a totally different answer.
The paper argues that accuracy isn't enough. An AI might get the right answer 90% of the time, but if it flips its answer every time you tweak the prompt, your research results are unreliable.
The Solution: The "Prompt Stability Score" (PSS)
The authors created a tool (a Python package called promptstability) that acts like a stress test for your AI instructions.
Think of it like testing a bridge:
- Intra-Prompt Stability (The "Repetition" Test): You run the exact same instruction 30 times on the same data. The tool checks: Did the AI give the same answer every time? If the answers jump around, the bridge is shaky.
- Inter-Prompt Stability (The "Rephrasing" Test): You take your instruction and ask a different AI to rewrite it in 10 different ways (e.g., "Sort these," "Categorize these," "Label these"). Then you run all 10 versions on the same data. The tool checks: Did the AI still agree with itself, even though the words changed?
The tool gives you a score (called Krippendorff's alpha, which is just a fancy way of saying "agreement score").
- High Score (Close to 1.0): Great! Your instructions are robust. The AI is consistent.
- Low Score (Below 0.8): Warning! Your instructions are too fragile. A tiny change in wording breaks the system.
What They Found (The "Stress Test" Results)
The researchers tested this on six different real-world datasets (like US political tweets, UK party manifestos, and news articles). Here is what they discovered:
- Simple is Stable: When the task was easy and the data was clear (like identifying if a tweet was from a Republican or Democrat), the AI was very stable. It didn't matter if you rephrased the prompt; it gave the same answer.
- Complex is Fragile: When the task was hard or the data was messy (like deciding if a tweet uses "populist" language, or sorting survey answers into 12 very similar categories), the AI became unstable. Small changes in the prompt caused the AI to flip-flop.
- The "Format" Trap: Sometimes the AI wasn't actually confused; it just forgot to follow the formatting rules (like writing a paragraph instead of a number). When the researchers filtered out these "sloppy" answers, the stability scores went up. This taught them that sometimes the problem isn't the AI's brain, but its inability to follow strict formatting rules.
- Model Matters: They compared a powerful AI (GPT-4) with a smaller, open-source one. The powerful one was much more stable. This means the "fickleness" isn't always your fault; sometimes you just need a smarter AI.
The "Playbook": What Should You Do?
The paper gives a simple guide for researchers:
- Step 1: Run the Stability Test. Before you spend money or time validating your results, run the
promptstabilitytool. - Step 2: Check the Score.
- If the score is high: You are good to go. Your pipeline is robust.
- If the score is low: Stop! Do not trust your results yet.
- Step 3: Fix the Problem.
- Is the AI ignoring formatting? Fix the prompt to be stricter.
- Is the task too vague? Make your instructions clearer.
- Is the data too messy? Maybe this specific task is too hard for an AI to handle consistently.
- Is the AI too weak? Try a more powerful model.
The Bottom Line
You cannot assume that just because an AI gives you an answer, that answer is reliable. This paper provides a checklist to ensure that your AI isn't just guessing randomly or reacting too sensitively to how you phrase your questions.
Stability is the foundation of trust. If your AI can't agree with itself when you ask the same question in slightly different ways, you can't trust the results it gives you for your research.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.