# Decide on an LLM Model Upgrade with Paired, Per-Slice Evidence

> A candidate model can win the aggregate by 5.1 points and still fail a high-risk refusal floor, and one run cannot show either fact reliably. This part freezes arm manifests, shows how far a single run moves when nothing changed, tests paired differences with McNemar's exact test and a paired bootstrap cross-checked in SciPy, and measures how many runs and cases the decision needs. It then writes budgets for quality, cost, p95 latency and refusal rate, replays traffic in shadow, explains why a canary barely sees a 3% slice, and reads the vendors' pinning and deprecation rules.

- Author: [Shashank Rawlani](https://shashank.rawlani.com)

- Published: 2026-11-11T13:30:00.000Z

- Updated: 2026-11-11T13:30:00.000Z

- Category: AI in Testing

- Canonical source: https://automationtester.in/blog/ai-in-testing/evaluate-llm-model-upgrades-multi-objective

- Tags: llm-evaluation, model-upgrade, paired-bootstrap, mcnemar-test, regression-gates, canary-release, ai-testing

**Quick answer:** Compare the candidate with the current model on the same cases, several runs each, and read the result slice by slice against budgets written before anything ran. Pair the data: McNemar's exact test, or a bootstrap over per-case differences. In the lab below a candidate beat the aggregate by 5.1 points and still failed a high-risk refusal floor, and one run could not have shown either fact reliably. Then shadow replayed traffic, plan the canary for rare slices, and keep the pinned current model until rollback is off the table.

Here is a report from the lab built for this article. One run, 240 cases, current model 81.7%, candidate 84.2%. The summaries slice rose 17 points, so the change looks like an easy yes. The report does not say that the 40 cases where the assistant must refuse a request it is not authorised to answer went from 97.5% to 90.0%. It also does not say that a second run of the same two models would have printed a different headline, and a different slice story.

That is the failure this part is about: an upgrade decision made from one aggregate number. The cases come from [the dataset part of this series](/blog/ai-in-testing/build-llm-eval-dataset-product-risks), and the grader's trustworthiness is the subject of [the judge calibration part](/blog/ai-in-testing/calibrate-llm-as-judge-scores). When a slice does regress, [the failure localisation part](/blog/ai-in-testing/debug-rag-retrieval-vs-generation-failures) says where to look. What is left is the decision itself: how to compare two versions fairly, how much evidence a small case set can give, what to write down before looking, and how to roll out and back out. Chunking, abstention, red-teaming and turning production failures into regression evals have their own later parts.

**What produced the output below, checked 2026-11-03:** Node.js v26.12.1 ran every lab listing. Python 3.14.5 with SciPy 1.18.1 and statsmodels 0.15.0 was used only to cross-check the statistics. No model and no API was called: both "models" are parametric simulators with per-slice success rates, refusal behaviour, latency and token cost that this article's author set. The prices are invented, not any vendor's. So the numbers show how the statistics and the gates behave, not how often real upgrades regress. promptfoo 0.125.1 (npm) and Inspect AI 0.3.287 (PyPI) were the latest releases on that date and are described from their documentation, not run. Vendor deprecation pages were read on the same date and will change.

## What has to stay frozen for a comparison to mean anything?

Everything except the one thing under test. Write each side down as an arm manifest, and diff the two manifests before you run anything. If the diff has more than one line, you are not evaluating a model.

```
{
  "arm": "candidate",
  "model": "<pinned id from the vendor's model table, not an alias>",
  "promptVersion": "p2",
  "promptSha256": "<hash>",
  "sampling": "same as production",
  "toolSchemaSha256": "<hash>",
  "retrieval": { "k": 4, "contextBudgetTokens": 3000 },
  "datasetVersion": "<hash of the sorted case ids>",
  "judge": "<frozen judge model + rubric hash>",
  "runs": 5,
  "seeds": [300, 301, 302, 303, 304]
}
```

The pitfall the manifest exists to catch is changing the prompt and the model together, because the new model often needs a prompt edit and the two arrive in one pull request. In the lab the candidate shipped as new model plus new prompt. Running the two single-change arms as well, five runs per case, gives a model-by-prompt grid:

| Arm (5 runs) | summaries | extraction | authz refusal | hindi | long context | all |
| --- | --- | --- | --- | --- | --- | --- |
| Old model, old prompt (current) | 76.6 | 83.2 | 96.5 | 69.3 | 64.0 | 79.3 |
| New model, old prompt | 87.8 | 85.2 | 96.5 | 72.0 | 71.0 | 85.3 |
| Old model, new prompt | 76.2 | 85.2 | 90.0 | 68.7 | 61.0 | 78.2 |
| New model, new prompt (shipped together) | 88.2 | 83.6 | 91.5 | 75.3 | 67.0 | 84.4 |

Read the authz column. The model change alone costs nothing there, and the prompt change alone costs 6.5 points. Shipped together, the report says "the new model regressed refusals", which sends the work to the wrong owner. The grid also shows the model carrying all the summaries gain. The lab's simulator has no interaction between prompt and model, which a real system will, so the grid is a first split and not a proof of independence. Any arm that names a model alias instead of a pinned ID has a further problem, covered in the versioning section below.

## How wrong can a single run be?

Measure it before you trust any comparison, by comparing the current model with itself. Same 240 cases, same configuration, two different run seeds, a thousand times:

```
const cases = makeCases();                       // 240 cases, fixed
for (let t = 0; t < 1000; t++) {
  const x = runAll("cur", cases, 5000 + 2 * t).map((r) => (r.pass ? 1 : 0));
  const y = runAll("cur", cases, 5001 + 2 * t).map((r) => (r.pass ? 1 : 0));
  let b = 0, c = 0;                              // discordant pairs
  for (let i = 0; i < x.length; i++) { if (x[i] && !y[i]) b++; if (!x[i] && y[i]) c++; }
  const gap = Math.abs(mean(y) - mean(x));       // what a one-run report would call "a change"
  // tally gap >= 1 point, gap >= 2 points, mcnemarExact(b, c).p < 0.05
}
```

```
A/A, current model vs itself, 1000 repeats:
  aggregate differs by >=1 point in 73.4% of pairs, >=2 points in 54.4%, largest seen 10.8 points
  McNemar p<0.05 in 4.1% of pairs
  authz-refusal slice (n=40) differs by >=5 points in 16.9% of pairs
  hindi-support (n=30) differs by >=10 points in 29.7% of pairs
cases whose outcome changed at least once across 10 runs of the same model: 150 of 240
```

Nothing changed between those runs, and an unlucky pair still moved the aggregate by 10.8 points. A +2.5 headline sits well inside that noise. The p-value column behaves, at 4.1% against a nominal 5%, which is the point: the test is fine, and the failure is reading a single difference as if it carried an error bar. Ten runs of one model gave aggregates between 72.9% and 83.3%, and the 20-case long-context slice ranged from 50% to 85%.

The same noise decides what a first run tells you about the real comparison. Repeating the whole current-versus-candidate experiment 1,000 times with fresh run seeds:

```
aggregate diff (candidate - current): median +4.6, 2.5th percentile -1.7, 97.5th percentile +10.4
candidate looks better on the aggregate in 91.7% of repeats; McNemar-significant improvement in 25.3%
authz point estimate below the 95% floor in 87.9% of repeats; McNemar-significant authz drop in 9.8%
hindi-support looks >=10 points worse in 7.4% of repeats (its configured gap is 4 points in the candidate's favour)
```

Three different one-run mistakes sit in those four lines. A real gain is "not significant" three times out of four. A real high-risk drop is below its floor almost every time and yet almost never statistically proven. And the first run in this lab showed Hindi support down 20 points with a paired interval excluding zero, for a slice where the configured truth is a small gain. All three come from the same single sample.

Variance in real systems is documented, not only simulated. A 2024 study of five models configured to be deterministic, run ten times on eight tasks, saw accuracy vary by up to 15% across naturally occurring runs, and none of the models gave repeatable accuracy on every task (Atil and colleagues, arXiv 2408.04667). OpenAI's reproducibility recipe describes the `seed` parameter as best effort, with a `system_fingerprint` that changes when the serving configuration does, and the recipe is marked archived. Anthropic's versioning page says weights are fixed for a model ID but the router, safety classifiers and sampling logic around them can change, and that an infrastructure update is the most likely cause of a behaviour change on a stable ID.

The tempting fix is to lower the sampling temperature until runs agree. Miller's "Adding Error Bars to Evals" argues against it unless temperature itself is what you are studying: it changes the behaviour you are measuring, and it can move variance from the within-case part, which repeated runs average away, to the between-case part, which they cannot. Keep production sampling and spend runs instead.

## How do you test a paired difference on a small case set?

Keep each case's two outcomes together. Most cases are passed by both models or failed by both, and those tell you nothing about which is better. The evidence is in the discordant pairs: `b` cases the current model passes and the candidate fails, and `c` the other way round. For one run per case, McNemar's exact test asks whether `b` and `c` are consistent with a fair coin. McNemar's 1947 note presents formulas for judging the difference between correlated proportions, and statsmodels documents the exact form as a binomial test on the discordant cells, with its statistic reported as `min(b, c)`. For anything that is not binary, such as a K-run mean, latency or cost, resample the cases and keep each pair together. SciPy's `bootstrap` does that when `paired=True`, by drawing one set of indices for every array.

```
// binomPmf(k, n) is the Binomial(n, 0.5) mass function.
export function mcnemarExact(b, c) {
  const n = b + c;
  if (n === 0) return { b, c, n, p: 1 };
  const k = Math.min(b, c);
  let tail = 0;
  for (let i = 0; i <= k; i++) tail += binomPmf(i, n);
  return { b, c, n, p: Math.min(1, 2 * tail) };
}

// d[i] = score_candidate[i] - score_current[i]; resample CASES, never the two arms separately.
export function pairedBootstrap(d, rng, nResamples = 10000, level = 0.95) {
  const n = d.length;
  const means = new Float64Array(nResamples);
  for (let r = 0; r < nResamples; r++) {
    let s = 0;
    for (let i = 0; i < n; i++) s += d[(rng() * n) | 0];
    means[r] = s / n;
  }
  const sorted = Array.from(means).sort((x, y) => x - y);
  const alpha = (1 - level) / 2;
  return { est: mean(d), lo: quantile(sorted, alpha), hi: quantile(sorted, 1 - alpha) };
}
```

Applied to the single run from the opening, one run per case, per slice:

| Slice (n) | Current | Candidate | Change, paired 95% interval | b / c | McNemar exact p |
| --- | --- | --- | --- | --- | --- |
| All (240) | 81.7% | 84.2% | +2.5 [-3.3, +8.3] | 22 / 28 | 0.4799 |
| summaries (100) | 74.0% | 91.0% | +17.0 [+8.0, +26.0] | 4 / 21 | 0.0009 |
| structured-extraction (50) | 92.0% | 88.0% | -4.0 [-14.0, +6.0] | 4 / 2 | 0.6875 |
| authz-refusal (40) | 97.5% | 90.0% | -7.5 [-17.5, 0.0] | 3 / 0 | 0.2500 |
| hindi-support (30) | 83.3% | 63.3% | -20.0 [-36.7, -3.3] | 7 / 1 | 0.0703 |
| long-context (20) | 60.0% | 60.0% | 0.0 [-25.0, +25.0] | 4 / 4 | 1.0000 |

Four things in that table are easy to misread. First, the authz row has three discordant pairs, all against the candidate, and its p-value is 0.25. With three discordant pairs the smallest value the exact test can produce is 2 x 0.5^3 = 0.25, so the test cannot say anything stronger however bad the regression is. That is the limit of the data, not evidence of safety. Second, the Hindi row has an interval excluding zero and a McNemar p of 0.07. At 30 cases the two methods disagree, and neither is the authority; the repeated-runs experiment above is what shows the slice was fine. Third, the cross-check in Python, with 10,000 resamples:

```
from scipy import stats
from statsmodels.stats.contingency_tables import mcnemar

p = mcnemar(table, exact=True).pvalue
p_check = stats.binomtest(min(b, c), b + c, 0.5).pvalue
ci = stats.bootstrap((y - x,), np.mean, n_resamples=10000, method="percentile", confidence_level=0.95)
ci_bca = stats.bootstrap((y - x,), np.mean, n_resamples=10000, method="BCa", confidence_level=0.95)
```

```
python 3.14.5 numpy 2.5.4 scipy 1.18.1 statsmodels 0.15.0
ALL            b=22 c=28  statsmodels exact p=0.4799  scipy binomtest p=0.4799  percentile CI=[-3.3, +8.3]   BCa CI=[-3.3, +8.3]
authz-refusal  b=3 c=0    statsmodels exact p=0.2500  scipy binomtest p=0.2500  percentile CI=[-17.5, +0.0]  BCa CI=[-20.0, -2.5]
hindi-support  b=7 c=1    statsmodels exact p=0.0703  scipy binomtest p=0.0703  percentile CI=[-36.7, -3.3]  BCa CI=[-40.0, -3.3]
```

The p-values and the percentile intervals match the lab's own code to the printed digit. The BCa interval, SciPy's default method, differs on the authz slice: `[-20.0, -2.5]` excludes zero and the percentile interval touches it. On 40 binary cases a bootstrap interval is rough, so choose the method before looking and report which one it was. Fourth, pairing helps in proportion to how correlated the two models' per-case scores are. Here the correlation was 0.27 and the aggregate interval narrowed from 13.4 points wide (independent resampling, `[-4.2, +9.2]`) to 11.6 (paired). Miller's paper gives the algebra, and recommends reporting the pairwise differences and score correlations whenever two models are compared.

Two cautions. Cases that are paraphrases of one source are not independent, and counting them as separate cases overstates `n`; Miller recommends clustered standard errors for related groups, which in a bootstrap means resampling cluster IDs. And five slices means five tests. Some will cross 0.05 by chance, so the budgets below use effect-size thresholds with intervals as context, not slice-level p-values as pass or fail.

## How many runs and how many cases does the decision need?

It depends on two different kinds of noise, and runs only buy down one of them. Run-to-run noise on a fixed case is what repeated runs average away. Case-to-case noise, because your 240 cases are a sample of what users send, shrinks only with more distinct cases. Miller's sample-size formula separates them: the number of independent questions needed is proportional to `(omega^2 + sigmaA^2/K + sigmaB^2/K) / delta^2`, where `omega^2` is the variance of the true per-case difference, `sigma^2` the within-case run variance of each arm, `K` the runs per case and `delta` the smallest difference you want to detect. In the lab those components can be measured directly from 400 runs of each arm: `omega^2` 0.0226, `sigmaA^2` 0.1132 and `sigmaB^2` 0.1019.

The empirical check: 300 simulated experiments per cell, each a paired bootstrap on per-case means over K runs, counting how often the 95% interval excludes zero on the correct side. The true aggregate gain is about 4.6 points and the true authz drop about 8.

| Cases (authz cases) | K=1 | K=2 | K=5 | K=10 | K=20 |
| --- | --- | --- | --- | --- | --- |
| 240 (40): aggregate gain detected | 28% | 48% | 82% | 97% | 100% |
| 240 (40): authz drop detected | 29% | 56% | 92% | 100% | 100% |
| 480 (80): aggregate gain detected | 51% | 76% | 98% | 100% | 100% |
| 480 (80): authz drop detected | 52% | 87% | 99% | 100% | 100% |
| 960 (160): aggregate gain detected | 82% | 98% | 100% | 100% | 100% |
| 960 (160): authz drop detected | 87% | 99% | 100% | 100% | 100% |

The formula and the experiment agree. At 240 cases and K=5 the formula's minimum detectable difference at 80% power is 4.6 points, the true gain is 4.6, and the table shows 82%. At K=1 the same 240 cases can only see differences of about 8.8 points; at K=20, 3.3. The floor is the `omega^2` term: no number of runs gets 240 cases below about `sqrt(0.0226/240)` times 2.8, roughly 2.7 points, because the case sample itself is the limit. Past that point, add distinct cases.

Two practical readings. Five runs per case is the smallest setting here that catches a large regression on a 40-case slice most of the time, and it costs 2,400 calls for 240 cases and two arms, which is cheap against a rollback. And the authz detection rates describe these 40 cases resampled, so a clean result is evidence about those cases and a reason to keep adding real ones. For scale, Miller's own worked example, with different and fictional variances, needs about 969 independent questions to detect a 3-point difference at 80% power, and he suggests new evals hold at least 1,000.

## What does a written budget look like, and what did it decide?

One line per objective, each with the comparison and the rule fixed before the candidate runs. In the lab:

```
export const BUDGETS = {
  highRiskFloor:   { slice: "authz-refusal", minPassRate: 0.95, maxDropVsCurrent: 0.03 },
  sliceRegression: { maxDropVsCurrent: 0.05 },   // every other slice, point estimate on the K-run mean
  aggregate:       { minDiff: 0.0 },
  costCeiling:     { maxRatioVsCurrent: 1.0 },
  latencyP95:      { maxRatioVsCurrent: 1.15 },
  refusalBand:     { maxAbsDiff: 0.02 },         // benign over-refusal rate, absolute points
  schemaErrors:    { maxIncrease: 0.01 },        // structured-extraction schema-invalid rate
};
```

The shape follows from what each objective is. The high-risk slice gets an absolute floor and a limit on the drop, because an average can hide it, as the dataset part showed. Cost and latency are ceilings against the current model. The refusal band is two-sided, since a model that refuses more benign requests has regressed as surely as one that refuses fewer dangerous ones. Structured-output validity is its own line, because a schema break is an operational failure that a quality score may not register. The same gates, five runs per case, applied to the candidate that shipped model and prompt together, and to the new model with the old prompt:

| Gate | Budget | New model, new prompt | New model, old prompt |
| --- | --- | --- | --- |
| High-risk floor, authz refusal | >= 95% and drop <= 3 points | **FAIL** 91.5% (current 96.5%, change interval -8.5 to -2.0) | PASS 96.5% (interval -4.0 to +3.5) |
| Aggregate quality | >= 0 points | PASS +5.1 (2.5 to 7.7) | PASS +6.0 (3.2 to 8.9) |
| Worst other slice | drop <= 5 points | PASS extraction +0.4 (-5.2 to +6.0) | PASS extraction +2.0 (-4.8 to +9.2) |
| Cost per request | <= current | PASS -10.6% | PASS -11.3% |
| Latency p95 | <= +15% | PASS +6.4% (8,225 vs 7,731 ms) | PASS +7.2% (8,284 ms) |
| Benign refusal rate | within 2 points | PASS 2.60% (current 2.10%) | PASS 3.50% (+1.4 points) |
| Schema-invalid rate, extraction | rise <= 1 point | PASS 2.00% (current 3.20%) | PASS 1.20% |
| Decision |  | Do not roll out: high-risk floor | Proceed to shadow |

The decision is the one the brief's artifact predicts: quality up, a critical refusal down, latency and cost inside their budgets, so no rollout until the refusal repair. Here the repair is a revert of the prompt change, and the grid from the first section is what made that obvious. Two details are worth reading. The passing arm's refusal rate rose 1.4 points, inside the band but the first number to watch in shadow. And the schema line compares 3.2% with 2.0% on 250 calls per arm, where one standard error of a 3% rate is about a point, so that gate is itself noisy at this size and should be backed by a count of schema errors on the replayed traffic.

Budgets belong to the people accountable for the feature and are approved before the results exist; a threshold edited after the table is a rationalisation. A model can summarise the cases where the two arms disagreed, to speed up the human reading of them. It should not set a floor or decide a trade-off.

## Does passing the offline gates justify a rollout?

No, because the eval set is not the traffic. Take the same five-run slice results and weight them two ways. With the eval set's mix the candidate gains 5.1 points (79.3 to 84.4). With a replayed traffic mix, in which authz-tagged requests are 3.0% of 5,000 requests where the eval set has 16.7%, it gains 7.4 (76.5 to 84.0). The headline moves because the weights moved, and a 3% slice contributes almost nothing to an aggregate whatever happens to it.

Shadow mode sends each replayed request to both models, shows users only the current answer, and compares the pairs. Without labels you can still count what logs carry: refusal flags, schema validity, latency, tokens, and a risk tag. For tagged high-risk traffic, a refusal that the current model gave and the candidate did not is a paired discordance, and the same exact test applies:

```
let lost = 0, gained = 0;        // lost: production refused, candidate answered
for (const i of authzTagged) {
  if (prod[i].refused && !shadow[i].refused) lost++;
  if (!prod[i].refused && shadow[i].refused) gained++;
}
const { p } = mcnemarExact(lost, gained);
```

```
Shadow, label-free, 5,000 replayed requests (150 authz-tagged):
  authz-tagged: production refused and candidate answered 18; the reverse 3; McNemar exact p=0.0015
  cost per 1k requests: -10.0%
  latency p95: 7566 ms vs 8530 ms (+12.7%)
  benign refusal rate: 2.06% vs 2.82%
  schema-invalid on extraction: 17/1000 vs 18/1000
  repeated 1000 times: >=1 lost refusal in 100% of replays; McNemar p<0.05 in 80%
```

This is the candidate that shipped model and prompt together, so the shadow result agrees with the offline failure. Shadow has a cost: you pay for a second model's calls on all the mirrored traffic for the length of the window. And with 150 tagged requests and one call each, it detects this drop significantly in 80% of replays, which is a reminder that a shadow window is also an experiment with a power.

A canary exposes real users, and the Google SRE workbook's definition fits: a partial, time-limited deployment of a change, evaluated against a control that stays on the old version. Its arithmetic of a 5% canary turning a 20% failure rate into a 1% overall one is about error budget, and it is the right frame for latency and errors. It does not help a rare slice. At 5% of 5,000 requests a day, the lab's canary sees about 7.5 authz-tagged requests per day, a 1,000-request window averages 1.52 of them, 22% of windows contain none, and none of 2,000 simulated windows contains ten. Reaching the 150 tagged requests the shadow run used would take about 20 days. The SRE chapter warns that ending a canary after a handful of queries gives no useful signal for diverse traffic; for a rare high-risk slice the sample is a handful by construction. So the offline gate and shadow own the rare slice, and the canary owns what it can see in volume: latency, cost, refusal rate on common traffic, schema errors.

Rollback criteria are written alongside the budgets, not after the incident. A workable set: any tagged high-risk refusal loss beyond the budgeted rate in a window, p95 latency beyond its ratio for two consecutive windows, benign refusals leaving the band, or any rise in schema-invalid responses beyond the budget. The action is a one-line change of the manifest back to the previous pinned model ID. That is only an action if the old ID is still served, which brings in the part vendors control.

## Which model IDs can you pin, and for how long?

The three vendors' pages, read on 2026-11-03, differ in exactly the ways that matter for an evaluation plan.

| Vendor | What the ID means | Notice before retirement | A dated example from the page |
| --- | --- | --- | --- |
| Anthropic | Every model ID is a pinned snapshot; the dateless IDs used from the 4.6 generation are snapshots, not evergreen pointers. For earlier models a short alias points at the latest dated snapshot of that minor version. Weights are fixed per ID, but the surrounding serving infrastructure can change. | At least 60 days for publicly released models | `claude-sonnet-4-5-20250929`: deprecated 2026-09-30, retirement 2026-11-30, replacement `claude-sonnet-5-5`. That is 27 days after this check. |
| OpenAI | Dated snapshots and shorter names are listed together, for example `gpt-5` and `gpt-5-2025-08-07` in one row. Each model object has an optional `shutdown_date` on the List models endpoint. | At least 6 months for generally available models, 3 months for specialised variants, and as little as about 2 weeks for models with `preview` in the name | GPT-5 and o3 snapshots: notified 2026-06-11, shutdown 2026-12-11 |
| Google | Stable names point at a specific model that usually does not change. A `-latest` alias is hot-swapped with each release. Preview models can be deprecated on short notice. | 2 weeks by email before the model behind a `latest` alias changes; preview deprecation with at least 2 weeks | `gemini-2.5-pro`: from 2026-12-01, requests are routed automatically to `gemini-3.8-flash` |

Several consequences follow. An arm manifest holds the ID the vendor documents as a fixed snapshot, never an alias, or the comparison you ran may not be the model you ship. A `latest`-style alias is a candidate that changes under you, with notice measured in weeks. The Google routing line is the case where the replacement is chosen for you: if the model string is not changed, traffic moves to a model your eval never scored, so score the replacement before the date. Put every ID in production and its retirement date in a calendar, and start the replacement eval early enough that a failed budget still leaves time for the repair, the shadow window and the canary. A rollback also expires, because reverting to the old ID stops working on the retirement date. And since the same ID can behave a little differently after an infrastructure update, as Anthropic's page says, a small frozen subset of the eval run on a schedule is the cheap way to notice drift before users do.

## What do eval frameworks supply here, and what is left to write?

The versions checked were promptfoo 0.125.1 and Inspect AI 0.3.287. Neither was run for this article, so this is what their documentation says. promptfoo's CLI has `--repeat` to run each test several times, and its caching page says each repeat index uses its own cache namespace, with `--no-cache` needed if every run must make fresh calls instead of replaying cached ones. That is a trap for anyone measuring variance: with the cache on, a re-run can reproduce the previous run's answers and report a variance of zero. It also has `--filter-sample-seed` for a repeatable random subset, and its documentation lists a compare-providers example for side-by-side runs. Inspect AI has `--epochs` to repeat each sample, with reducers including mean, median, mode, max, `at_least_n`, `pass_at_k` and `pass_k_k`, and its scorers report accuracy and a standard error. The reference pages for both list no paired significance test and no per-slice budget gate, which is why the lab's 40 lines of statistics and the gate function are code you write on top of whichever harness produces the per-case results.

## Apply this now

- Write an arm manifest for the model you run today and for the next candidate, and diff them. If more than one field differs, split the change into single-change arms.

- Run the current model against itself five times on your eval set and record the spread of the aggregate and of each risk slice. That is your noise floor, and no later difference smaller than it counts as a finding. Turn the response cache off for this step.

- Choose K from the spread and the slice sizes: five runs is the starting point, and a slice under 50 cases needs more cases before it can carry a gate.

- Write the budgets as a file with an owner's name and a date, before the candidate runs: a floor for each high-risk slice, a cost ceiling, a p95 latency ratio, a refusal-rate band and a schema-error limit.

- Compute paired per-slice results with an exact test or a paired bootstrap, stating which interval method you used.

- List every model ID in production with its retirement or shutdown date, using the vendor pages or `shutdown_date` where an API exposes it.

Capture as evidence: the A/A spread table, the committed budgets file, the per-slice paired table, the gate table with FAIL lines kept, and the dated retirement calendar. Part 8 of this series, on production failures becoming regression evals, uses the same machinery for the cases that arrive after launch.

## FAQ

### Can an LLM judge score the two arms?

Yes, with the judge frozen in the manifest and checked as [the calibration part](/blog/ai-in-testing/calibrate-llm-as-judge-scores) describes. The judge adds its own run-to-run noise to every case, so it raises `sigma^2` in the sample-size formula. Re-scoring the same saved outputs with a different judge version is a second change layered on the first.

### McNemar or the bootstrap?

McNemar for binary pass or fail with one run per case, because it needs only the discordant counts and is exact. The paired bootstrap when you have K-run means, continuous scores, or ratios such as cost and latency. Run both when the case set is small. In this lab they disagreed on two slices, and the disagreement is the signal to collect more data and not to pick whichever agrees with your hope.

### What if the candidate is clearly better and a budget says no?

Find which change caused the failed gate, as the grid did, and repair that one. Or route only the slices that pass to the candidate, which needs task-level routing and means two pinned models to monitor and retire. Changing the budget is a decision for the owner who set it, made on its merits and not on the day the result arrives.

### How many cases does a high-risk slice need?

Enough that its budget can be tested. In the lab, 40 cases at K=5 detected an 8-point drop 92% of the time, and 80 cases did it 99% of the time, but a 3-point tolerance is a much smaller target. Use the formula with your own measured `omega^2` and `sigma^2`, treat a slice that cannot reach 80% power for its budget as unmeasured, and grow it from real incidents.

## Primary references

- [Miller, Adding Error Bars to Evals: A Statistical Approach to Language Model Evaluations (arXiv:2411.00640)](https://arxiv.org/abs/2411.00640): paired differences, clustered standard errors, resampling answers, the advice not to change sampling temperature to reduce variance, and the sample-size formula with its 969-question example.

- [Atil and colleagues, Non-Determinism of "Deterministic" LLM Settings (arXiv:2408.04667)](https://arxiv.org/abs/2408.04667): five models, eight tasks, ten runs, accuracy variation of up to 15% across runs under settings meant to be deterministic.

- [McNemar, Note on the sampling error of the difference between correlated proportions or percentages (Psychometrika, 1947)](https://link.springer.com/article/10.1007/BF02295996): the original note on testing the difference between correlated proportions.

- [statsmodels 0.15.0, contingency_tables.mcnemar](https://www.statsmodels.org/stable/generated/statsmodels.stats.contingency_tables.mcnemar.html): the exact option as a binomial test, with `min(n1, n2)` as the reported statistic.

- [SciPy, scipy.stats.binomtest](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.binomtest.html): the two-sided exact binomial test used to cross-check the McNemar p-values.

- [SciPy, scipy.stats.bootstrap](https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.bootstrap.html): `paired=True` reusing one index set across arrays, and BCa as the default interval method.

- [Anthropic, Model IDs and versioning](https://platform.claude.com/docs/en/about-claude/models/model-ids-and-versions): every ID is a pinned snapshot, dateless IDs are not evergreen, weights are fixed but serving infrastructure can change behaviour.

- [Anthropic, Model deprecations](https://platform.claude.com/docs/en/about-claude/model-deprecations): lifecycle terms, at least 60 days' notice, and the claude-sonnet-4-5-20250929 retirement row.

- [OpenAI, Deprecations](https://developers.openai.com/api/docs/deprecations): notice periods by model class, the `shutdown_date` field, and the June 2026 GPT-5 and o3 snapshot shutdown.

- [OpenAI Cookbook, Reproducible outputs with the seed parameter](https://developers.openai.com/cookbook/examples/reproducible_outputs_with_the_seed_parameter): archived recipe describing best-effort determinism and `system_fingerprint`.

- [Google, Gemini models](https://ai.google.dev/gemini-api/docs/models): stable, preview, latest and experimental naming, the two-week notice on `latest` aliases, and the 2026-12-01 automatic routing of `gemini-2.5-pro`.

- [promptfoo, Command line](https://www.promptfoo.dev/docs/usage/command-line/): `--repeat`, `--no-cache` and `--filter-sample-seed`.

- [promptfoo, Caching](https://www.promptfoo.dev/docs/configuration/caching/): per-repeat cache namespaces and the advice to use `--no-cache` with `--repeat`.

- [Inspect AI, Eval options](https://inspect.aisi.org.uk/options.html): `--epochs` and the built-in epoch reducers.

- [Inspect AI, Scorers](https://inspect.aisi.org.uk/scorers.html): built-in scorers and their accuracy and standard-error metrics.

- [Google SRE Workbook, Canarying Releases](https://sre.google/workbook/canarying-releases/): the canary and control definitions, representativeness of size and duration, and the 5% canary arithmetic.

## Continue reading on AutomationTester.in

- [Use AI for Performance Diagnosis Without Inventing Causes](https://automationtester.in/blog/ai-in-testing/ai-performance-diagnosis-evidence-boundaries)
- [Review AI-Generated JUnit Tests Before They Raise Coverage](https://automationtester.in/blog/ai-in-testing/review-ai-generated-junit-tests-before-coverage)
- [Price an AI Agent's CI Runs Before the Monthly Bill Does](https://automationtester.in/blog/tools-reviews/price-ai-agent-ci-runs-before-the-bill)
- [Find the Tool Call That Dominates an Agent Run's OpenTelemetry Trace](https://automationtester.in/blog/tools-reviews/find-tool-call-dominating-agent-trace)
- [Catch promptfoo Config Mistakes That validate Lets Through](https://automationtester.in/blog/tools-reviews/catch-promptfoo-config-mistakes-before-eval)

Source: [Decide on an LLM Model Upgrade with Paired, Per-Slice Evidence](https://automationtester.in/blog/ai-in-testing/evaluate-llm-model-upgrades-multi-objective) by Shashank Rawlani.
