Concepts / Regression Testing for Prompt Changes

Regression Testing for Prompt Changes

An eval set is a living artifact that must change as the team learns more about the customer's domain.

  • Programming

A Passing Score That Stopped Meaning Much

Imagine a team that builds an evaluation set for an AI feature in its first week. The cases reflect what the team expects users to ask and what a good answer should look like. Every prompt change is then run against that set, and the team watches the score. For a while, the score tells them something useful. Then, a few months later, the feature has met real users, the questions have shifted, and the team understands its customer much better than it did at the start. The score still goes up and down, but it increasingly measures a product that no longer exists in practice.

This article is about that problem and its remedy. The central claim is that an evaluation set is a living artifact. It has to change as the team learns more about the customer's domain, and it should be maintained the way you maintain code, not finished once and filed away.

Why an Evaluation Set Cannot Be Finished

Definition

An evaluation set is a living artifact that must change as the team learns more about the customer's domain.

When a team first builds an evaluation set, the set usually reflects what the team knows at that moment. Its cases are drawn from early expectations about what users will ask and what a good answer looks like. Those expectations are rarely complete. As the feature meets real users, gaps in the original set become visible. A set that was accurate in the first week can quietly stop measuring what matters by the third month.

The reasoning is simple. An evaluation set is only useful if it tests for the things the customer cares about right now. Customer needs shift, new kinds of input appear, and some failure modes that once mattered stop occurring or stop being important to the business. If the set stays fixed, it keeps measuring an older version of the product, and a passing score tells you less and less.

Static Set Versus Living Set

The difference between the two approaches is easiest to see side by side. A static set is built once and then left alone, so its contents stay tied to the early expectations. A living set is revised as evidence arrives: new edge cases are added, obsolete cases are retired or down-weighted, and the set continues to describe present needs.

Notice that the living set is not defined by being bigger. Its value comes from the fact that each case still corresponds to something the team currently needs to check.

Where New Edge Cases Come From

As the team learns more about the domain, new edge cases will surface. These are inputs the original set did not anticipate, or situations where the product behaves in a way the team had not considered. When one appears, the correct response is to add it to the evaluation set so that future changes are checked against it. The set should grow to cover what the team has learned.

How you record an edge case matters. Good sources of evidence include the following:

  • Real user inputs that produced poor answers
  • Support tickets that describe a failure
  • Reviewer notes from people who understand the domain
  • Reports from the team when they notice something unexpected during development

Each of these is evidence about a situation the evaluation set should be able to judge. An edge case is therefore not just a tricky input; it is a recorded situation with a clear reason for being in the set.

Lifecycle of a Single Eval Case

Evolution works in both directions. A case enters the set when new evidence reveals a need, it can stay central while it keeps testing something the customer cares about, and it can later be down-weighted or retired when it stops mattering. The diagram follows one case through these states.

Retiring an eval removes it from the set. Down-weighting keeps it in the set but reduces how much it counts in the overall picture. Down-weighting is useful when a case is no longer central but still has some historical value. The transition from active to down-weighted is therefore a judgment that the case still informs the team while no longer driving decisions.

Why Stale Cases Distort Decisions

The reason to remove or de-emphasize old cases is that a stale eval can distort decisions. If a large share of the set checks behavior that no longer matters, a team may hesitate to ship an improvement that helps current customers, because the improvement appears to hurt a case nobody cares about anymore. Keeping the set focused on present needs keeps the signal clean.

Tracing a Small Set Across Versions

The following example is an illustrative sketch, not taken from the source. It uses a set of six case labels, A through F, to show how the contents change over three versions. Each version records the change that produced it, so you can trace what was added, retired, or down-weighted at every step.

Worked example

Three Versions of a Small Eval Set

Version 1 starts with cases A, B, C, and D. New customer behavior reveals a need that case E covers, and case C no longer tests anything the business cares about. Later, case B is no longer central but still has historical value, and case F is added for a newly observed failure. What does the set contain at each version?

  1. 1
    Start at version 1

    The set holds cases A, B, C, and D. Every case counts fully.

  2. 2
    Apply the version 2 update

    Case C is retired because it no longer tests a customer need, so it is removed from the set. Case E is added because customer behavior revealed a new need. The set is now A, B, D, and E.

  3. 3
    Apply the version 3 update

    Case B is down-weighted rather than retired, because it is no longer central but still has historical value. Case F is added for a newly observed failure. The set is now A, B (down-weighted), D, E, and F.

  4. 4
    Check what each case corresponds to

    Every case in the final set matches something the team currently needs to check. The total size of the set is not what matters.

Result

Version 3 holds five active cases and one down-weighted case. The set changed twice, and each change was driven by a recorded reason.

Read the timeline carefully. The set never grew without bound and never shrank into irrelevance. Each version changed only the cases whose status had shifted, and the set at every version can be explained by the sequence of decisions that led to it.

Deriving Assertions from Revision History

The same principle can be pushed one step further. Every time a prompt is revised, the revision is usually a response to an observed problem. Someone saw an output that was wrong, unhelpful, or unsafe, and changed the prompt so the system would avoid it next time. That revision carries information. It encodes a lesson about what bad outputs look like for this product.

That lesson should not be lost once the prompt is fixed. It should become an eval. Instead of relying on memory or on a careful reviewer to remember why a prompt changed, the team records the failure the revision addressed as a check that future changes must pass. A data-quality assertion is one form such a check can take: a rule that outputs of a given kind must satisfy.

The revision history can also be mined more systematically. Rather than writing every assertion by hand, the team can treat the sequence of revisions and the failures behind them as material from which candidate assertions are generated. A person still reviews the candidates to decide which are sound. The revision history then becomes an automatic source of checks that accumulates as the product changes.

Mistakes Teams Make When Maintaining Eval Sets

  • Common mistake

    Treating the eval set as finished after launch

    Why it fails

    The source explains that early expectations are rarely complete, and a set accurate in the first week can stop measuring what matters later.

    Do this instead

    Schedule regular reviews of the set against what the customer currently cares about.

  • Common mistake

    Adding edge cases without recording why they were added

    Why it fails

    Each edge case is evidence about a situation, and the reason is what lets the team judge whether the case still matters later.

    Do this instead

    Record the source of each new case, such as a support ticket, a reviewer note, or a user input that produced a poor answer.

  • Common mistake

    Deleting old cases that still have some value

    Why it fails

    Retiring removes a case entirely, but a case that is no longer central may still carry historical value.

    Do this instead

    Down-weight the case so it stays in the set but counts less in the overall picture.

  • Common mistake

    Keeping stale cases because the set feels safer when it is larger

    Why it fails

    A stale eval can make a helpful improvement look harmful, which distorts shipping decisions.

    Do this instead

    Keep the set focused so that every case corresponds to a present need.

  • Common mistake

    Writing every data-quality assertion by hand when the revision history already holds the lessons

Practice Tracing a Set Update

MEDIUM

Using the three-version example, suppose version 4 adds case G for a newly reported support-ticket failure and retires case D because the business no longer cares about that behavior. Write out the contents of version 4. Then say whether case B, which is already down-weighted, should be kept or retired, and justify your answer using the idea of historical value.

Hints
  • Start from the version 3 set: A, B (down-weighted), D, E, F.
  • Remove D, then add G.
  • Retire a case when it no longer has historical value; keep it down-weighted when it still informs the team.

Key Takeaways

  • An evaluation set is a living artifact that must change as the team learns more about the customer's domain, rather than a one-time deliverable.
  • New edge cases should be added so future changes are checked against them, and evidence for them can come from real user inputs, support tickets, reviewer notes, and team observations.
  • Obsolete cases are either retired, which removes them from the set, or down-weighted, which keeps them while reducing their influence on the overall picture.
  • Every prompt revision encodes a lesson about bad outputs, and that lesson can become an eval, including candidate data-quality assertions generated from revision history that a person reviews before use.