CASPER-Change-Aware Slice Prioritization for Efficient Regression Testing of LLM-based systems
This paper proposes CASPER, a change-aware slice prioritization framework that improves the efficiency of regression testing for LLM-based systems by identifying semantically consistent test slices and prioritizing them based on behavioral information from execution logs.
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
Imagine you are the captain of a massive, high-tech spaceship crewed by a super-smart, but slightly unpredictable, AI navigator. This AI is brilliant at solving problems, like fixing broken engines or plotting new courses, but it's not perfect. Sometimes it makes a tiny mistake, other times it gets it completely right. Now, imagine you want to upgrade the AI's brain or change the instructions you give it. Before you launch the ship, you need to make sure the new version doesn't break anything it used to do. This is called "regression testing."
In the old days of software, testing was like checking a light switch: if it didn't turn on, it was broken. But with AI, it's more like checking a weather forecast. If the AI predicts rain for one city but gets it wrong, does that mean the whole system is broken? Or is it just a fluke? If you check every single city on the planet, it takes forever. But if you only check the big cities, you might miss a storm in a small town. The problem is finding the perfect middle ground: grouping similar cities together so you can check a few representative ones and know what's happening with the whole group. This paper tackles exactly that puzzle for AI systems.
The Problem: The "Needle in a Haystack" of AI Mistakes
When developers tweak an AI system—maybe they change the model's brain, update the instructions (prompts), or swap out a tool—it can cause "regressions." These are moments where the AI starts doing something worse than before. The tricky part is that AI is probabilistic; it might get a task right 90% of the time, but that 10% failure rate can be annoying.
If you test every single possible scenario after a change, it's too slow and expensive. If you just look at the "average" score, you might miss the fact that the AI is now terrible at a specific type of task, even if it's great at others. The authors realized that the solution lies in slicing. Imagine cutting a giant pizza (your test suite) into slices. Each slice should contain pieces of pizza that are very similar to each other (like all the pepperoni slices). If the pepperoni slice tastes bad after the oven upgrade, you know the problem is with the pepperoni, not the cheese.
The Solution: CASPER, the Smart Pizza Cutter
The paper introduces a new framework called CASPER (Change-Aware Slice Prioritization). Think of CASPER as a super-smart robot chef that does two main things:
It cuts the pizza perfectly (Slice Identification):
Instead of just guessing how to group the test cases, CASPER uses a clever evolutionary search (like a digital version of natural selection) to find the best groups. It looks at how the AI behaves during its "thought process" (its conversation logs) to see which tasks are similar. It groups tasks that share the same behavioral patterns and, crucially, tasks where the AI either consistently succeeds or consistently fails. This ensures that if one task in the group fails, the others likely will too.It picks the most important slices to taste first (Slice Prioritization):
Once the pizza is sliced, CASPER doesn't just taste them in random order. It uses a "failure prediction model" trained on the AI's past behavior. When a change happens, CASPER looks at a few representative tasks from each slice and asks: "Based on how the AI was thinking before, does this new change look like it's going to break this specific slice?" It then ranks the slices, putting the ones most likely to be broken at the very top of the list.
How They Tested It: The Software Fixer Challenge
To see if CASPER actually works, the researchers tested it in the world of software issue resolution. Imagine an AI that is given a bug report and a bunch of code, and its job is to write a fix (a "patch"). They used a famous dataset called SWE-bench Verified, which contains 500 real-world coding problems.
They simulated different kinds of changes:
- Model Changes: Swapping the AI's brain for a newer version (e.g., from one Claude model to another, or from a "Devstral" model to a "Kimi" model).
- Prompt Changes: Changing the instructions given to the AI (e.g., telling it to be more careful or to use different tools).
They compared CASPER against two other methods:
- Random Ranking: Just picking slices to test in a random order (like picking pizza slices with your eyes closed).
- Clustering Baselines: Using standard math tools (GMM and HDBSCAN) to group the slices, which are common methods but not specifically designed for this AI regression problem.
The Results: Finding the Broken Slices Faster
The results were quite clear. When it came to cutting the pizza (identifying the slices), CASPER did a much better job than the standard clustering methods.
- Consistency: The slices created by CASPER had a 97% to 98% output consistency. This means that within a single slice, the AI either got almost all the tasks right or almost all of them wrong. The standard methods only managed about 74% to 84% consistency.
- Coherence: CASPER also kept the slices "coherent," meaning the tasks inside them were truly similar in how the AI approached them.
When it came to picking the slices to test (prioritization), CASPER was a game-changer.
- In a scenario where developers only have time to test a small fraction of the slices (a limited budget), CASPER found the broken slices much faster than random guessing.
- For some prompt changes, CASPER improved the ability to find regressions by nearly 50% compared to random ranking.
- Even for model changes, where the differences were subtler, CASPER still outperformed the random baseline by a significant margin (up to 46% improvement).
What This Means
The paper suggests that by looking at how an AI thinks (its behavioral signals) rather than just what it outputs, we can group its tasks into meaningful buckets. This allows developers to test AI systems much more efficiently. Instead of running thousands of tests, they can run a few smartly chosen ones and be confident they've caught the problems.
The authors note that while CASPER worked very well in this specific domain (fixing software bugs), the method is flexible. It doesn't rely on specific types of data or pre-written descriptions, meaning it could potentially be adapted for other AI tasks, like generating summaries or answering questions. However, they also point out that the method works best when the changes to the AI are significant enough to cause noticeable shifts in behavior; if the changes are tiny, it's harder to distinguish the impact.
In short, CASPER is a tool that helps developers stop guessing which parts of their AI system might break after an update, saving time and ensuring that the AI stays reliable even as it evolves.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.