What an LLM eval framework should decide, not just measure
A score is not a release decision. Compare with a baseline case by case, read intervals, check flip rate, cost and latency, then pass or fail in CI.
6 min read
- Evaluation
- Release gate
- Statistics
Most eval tools end with a number. You change a prompt, run the suite, and get 0.958 where you had 0.933. The number went up. Do you ship?
A number cannot answer that. A release is a yes or a no, and an LLM eval framework is only useful if it gives you one, with the reasons written down. This post covers what that decision needs and how ModelStill makes it.
A score is a measurement, not a decision
Three things hide behind a single score.
- Noise. On 240 cases, a few answers flipping either way moves the mean by a point or two. A rise of 0.025 can be luck.
- Swaps. A new prompt can fix eight cases and break two. The mean shows a gain of six. It does not show the two customers who now get a wrong answer.
- Everything else. A prompt that scores the same but costs twice as much, or answers twice as slowly, is not the same release.
A framework that decides has to deal with all three.
Compare with the baseline, case by case
The question is not "is the new score high?" but "is the new run worse than the one we already trust?". So the candidate is compared with an accepted baseline, on the same cases, in the same order.
For each case ModelStill takes the candidate's score minus the baseline's. The mean of those differences is the paired difference. A seeded bootstrap of the per-case differences gives its interval. The verdict reads the interval, not the mean:
betterwhen the whole interval is above 0,worsewhen the whole interval is below 0,no_detectable_differenceotherwise.
Next to it you get the fixed and broken counts: cases that scored higher after the change, and cases that scored lower. Pairing matters because cases differ in difficulty far more than one prompt differs from the next. Comparing each case with itself removes that spread. The statistics reference has the details.
Runs are only compared when they ran on the same version of the set. A baseline recorded on an older set is not silently mixed with a new one.
Every number carries an interval
Every score ModelStill reports carries a 95% interval. Pass/fail scores get an exact Clopper-Pearson interval. Other scores, such as set F1 or judge scores, get a seeded percentile bootstrap, so the same scores always give the same interval.
The gate reads lower bounds. The regression check passes only when the lower bound of the paired difference is above the regression you allow. A small set cannot pass on a lucky mean, and a wide interval is an honest message: this set is too small to prove much.
Quality is not the only check
The gate in a task spec holds four checks:
regression_vs_baseline: the paired lower bound against the accepted baseline, as above. A spec can also set an absolute floor on the run's own lower bound.flip_rate, capped by the spec'smax_flip_rate.cost_ratio, the candidate's cost as a share of the baseline's, capped bymax_cost_ratio.p95_latency_ms, the slow end of response times, capped bymax_p95_latency_ms.
Flip rate, cost ratio and latency are measured outside ModelStill and passed in, so the report marks them "not sampled". A value nobody measured should be passed at a failing worst case, such as --flip-rate 1. Then the gate fails honestly instead of passing on a number nobody checked.
The decision is stored and has an exit code
A gate decision lists every check with its threshold, measured value and result. modelstill report gate prints it as Markdown for a pull request comment or as JSON to keep next to the run, so the decision can be re-read later.
It exits 0 on a pass, 2 on a fail and 1 on an error, such as an unknown run or a regression gate without a baseline. That is all a CI job needs. The CI guide wires it into GitHub Actions with one sticky comment per pull request.
See it pass and fail in three commands
No API key and no network after the install. You need uv, which fetches Python 3.12 if you do not have it. These are the commands from the quickstart:
uv tool install "git+https://github.com/modelstill/modelstill#subdirectory=python/modelstill"
modelstill quickstart demo
modelstill report gate demo/history.jsonl 2d1857f9 \
--spec demo/tasks/ticket-priority-example/spec.yaml \
--previous 248036ea \
--flip-rate 0.004 --cost-ratio 0.82 --p95-latency-ms 640modelstill quickstart demo writes a ticket-triage task with 240 generated example tickets and three recorded runs. It is example data, not real tickets or real model answers:
Wrote an example project to demo (example data: generated tickets and recorded
model answers, no API key or network needed).
demo/tasks/ticket-priority-example/ task spec, prompt and 240 example tickets
demo/history.jsonl three recorded runs, baseline accepted
248036ea prompt-v1 accuracy 0.933 [0.894, 0.961] the accepted baseline
2d1857f9 prompt-v2 accuracy 0.958 [0.925, 0.980] clearer billing rules and a shorter prompt
48c5a1b6 prompt-v3 accuracy 0.883 [0.836, 0.921] a cheaper prompt that dropped the data-at-risk ruleThe gate for prompt-v2passes and exits 0. Its mean rose by 0.025, but the paired interval starts at 0.000, so the verdict is "no detectable difference". It passes because the lower bound is above the allowed regression of -0.020, not because it proved an improvement:
<!-- modelstill-gate -->
### ModelStill gate: passed
Run `2d1857f9` (prompt-v2) on `golden@493c3e2b`, compared with `248036ea` (prompt-v1).
per-case mean 0.958 [0.925, 0.980], 240 cases.
| Check | Threshold | Measured | Interval | Result |
|---|---|---|---|---|
| regression_vs_baseline | >= -0.020 | 0.000 | [+0.000, +0.050] | pass |
| flip_rate | <= 0.010 | 0.004 | not sampled | pass |
| cost_ratio | <= 1.000 | 0.820 | not sampled | pass |
| p95_latency_ms | <= 2000 | 640 | not sampled | pass |
#### Paired comparison
Difference +0.025 [+0.000, +0.050] (no detectable difference) over 240 cases: 8 fixed, 2 broken.Now the cheaper prompt:
modelstill report gate demo/history.jsonl 48c5a1b6 \
--spec demo/tasks/ticket-priority-example/spec.yaml \
--previous 248036ea \
--flip-rate 0.004 --cost-ratio 0.55 --p95-latency-ms 590prompt-v3costs less and scores 0.883 against the baseline's 0.933. It fixed 8 tickets and broke 20. The lower bound of the paired difference, -0.092, is below -0.020, so the gate fails and exits 2:
<!-- modelstill-gate -->
### ModelStill gate: failed
Run `48c5a1b6` (prompt-v3) on `golden@493c3e2b`, compared with `248036ea` (prompt-v1).
per-case mean 0.883 [0.836, 0.921], 240 cases.
| Check | Threshold | Measured | Interval | Result |
|---|---|---|---|---|
| regression_vs_baseline | >= -0.020 | -0.092 | [-0.092, -0.008] | **fail** |
| flip_rate | <= 0.010 | 0.004 | not sampled | pass |
| cost_ratio | <= 1.000 | 0.550 | not sampled | pass |
| p95_latency_ms | <= 2000 | 590 | not sampled | pass |
#### Paired comparison
Difference -0.050 [-0.092, -0.008] (worse) over 240 cases: 8 fixed, 20 broken.Then
The demo uses a ready-made set. For your own task you need cases people have checked: see how to build a golden dataset from production traces. If your answers are open-ended, you will need a judge, and the judge needs checking too.
See a release gate pass and fail in three commands.
Get started