Regression when the model or prompt changes: eval, LLM-as-judge, A/B
Changing the model or prompt changes product behaviour even without code changes. So the golden set is run on the old and the new configuration and compared with a baseline per category, not just by the average. A release gate: a threshold, a margin in every category and no new failures among critical cases. The model version is pinned, an LLM judge is calibrated on humans, and rollout goes through A/B.
AI for QA · AI features
The team "improved" the prompt, the average score on the set rose, yet Ukrainian answers got worse. How could you not miss that?
Changing the model version, prompt text or retrieval settings changes product behaviour even if no code was touched. An improvement in one place easily breaks another, and users find out first. So QA requires an eval before release and a comparison with a baseline, not a general impression from a few examples.
How it works and why. The same golden set is run on the old and the new configuration and the results are compared. The key is comparing per category (languages, request types, risk level), not just the average: the overall score can grow while a critical category falls.
Average or categories
Only the average score
It was 88%, now 90%: "better". But Ukrainian requests fell from 92% to 78% while English rose, so the average hid it.
Score per category
Languages, request types and risk levels are compared separately. A failure in a critical category blocks the release even though the average rose.
Example: a release gate. A gate: not below the threshold, not worse than the baseline by an allowed margin in each category, no new failure among critical ones. Pin the model version: an alias that points to the "latest" model changes without your knowledge and breaks reproducibility.
type Scores = Record<string, number>; // category → pass share
function gate(base: Scores, next: Scores, critical: string[]) {
const problems: string[] = [];
for (const [cat, was] of Object.entries(base)) {
const now = next[cat] ?? 0;
if (now < was - 0.03) problems.push(`${cat}: ${was} -> ${now}`);
}
for (const cat of critical)
if ((next[cat] ?? 0) < 1) problems.push(`critical failed: ${cat}`);
return problems; // an empty array: the release is allowed
}
// pin the model by a version, not by an alias that changes silently
const CONFIG = { model: 'provider-model-2026-10-15', promptVersion: 'v14' };
LLM-as-judge. Another model scores answers against a rubric when there are not enough people for the whole set. This is convenient, but a judge has its own weaknesses: it favours longer answers, the first in a pair and the style of its own model, gives unstable scores and has blind spots. So the judge is calibrated on a sample with human scores (share of agreement, analysis of disagreements), given a clear scale and asked for an explanation, while critical and disputed cases are checked by a human. Deterministic checks (a schema, a regex, presence of a fact) are more reliable than a judge wherever they suffice.
// judge calibration: agreement with human labels on a sample
const labelled = loadHumanLabels(); // [{ id, human: 'pass' | 'fail' }]
let agree = 0;
for (const { id, human } of labelled) {
const verdict = await judge(answers[id], rubric); // the same rubric, temperature 0
if (verdict === human) agree++;
}
const agreement = agree / labelled.length;
expect(agreement).toBeGreaterThanOrEqual(0.85); // agree the threshold in advance
A/B and feature flags. An offline set does not cover everything, so the new version is first switched on for a small share of traffic. Compare more than "likes": quality by eval on live traffic, refusals, latency, cost per request and a business metric. You need guardrail metrics that must not get worse and an automatic rollback condition. The flag also gives a kill switch.
The path of a change to users
Limits and alternatives. On a small set a difference of a few percent is noise: before drawing a conclusion repeat the run and look at the spread. An A/B on little traffic takes long to gather statistics, and for rare but critical events (legal, medical requests) A/B is not suitable: an offline eval and human review are mandatory there. A judge from the same family as the model being scored tends to inflate its score.
Typical mistakes.
- Looking only at the average score and missing a failure of one language or category.
- Taking the model by a "latest" alias and not pinning the version.
- Trusting a judge without calibration on human scores.
- Concluding from one run on non-deterministic output.
- Running an A/B without guardrail metrics and a rollback plan.
Check yourself
The average score rose from 88% to 90%. Why is that not enough for a release?
Answer
The average can hide a drop in one category (a language, a critical request type). Compare per category and require no new failures in critical ones.
How is an LLM judge calibrated?
Answer
Take a sample of answers with human scores, run the judge with the same rubric and measure the agreement share, analysing disagreements. Critical and disputed cases stay with a human.
Why is the model version pinned rather than taken by alias?
Answer
An alias can change the model without your knowledge, so eval results become irreproducible and a regression appears with no change in your code.