Reading reports¶
Who this page is for: everyone who reads what an eval found and decides what to do next: product managers, QA engineers, technical analysts and developers. It also sets up the gate CI applies.
A report is what one eval run found. A comparison is two reports over the same cases, side by side. This page explains every number both print, what to do about each, and the commands around them: continuing a run, regrading it, its cost and budget, and gates in CI.
- You will be able to: read a pass rate and the range it likely lies in, tell solid, flaky and failing cases apart, act on each of the four comparison verdicts, finish an unfinished run, answer reviews, rescore a run after changing criteria, keep a run within a budget, and fail a CI job on a report.
- Read first: Your first eval.
- Time: about 20 minutes.
From trials to a verdict¶
flowchart LR
trials["Trials<br/>each passed, failed<br/>or not judged"]
cases["Cases<br/>solid, flaky, failing"]
rate["Pass rate<br/>likely between X and Y"]
report["Report"]
other["Another report<br/>same cases"]
verdict["Verdict<br/>better, about the same,<br/>worse, not enough data"]
gate["Gate<br/>at least 90% passed?"]
trials --> cases --> rate --> report
report --> verdict
other --> verdict
report --> gate
Every number starts from the trials. Each trial passed, failed, or was not judged (a review nobody answered yet, a judge that could not tell). The trials of a case make that case solid, flaky or failing. The cases make the pass rate. Two reports make a comparison, and a report alone can be held to a gate.
The case, not the trial, is what is counted. The two trials of one case are the same question asked twice, so they are not two independent pieces of evidence; twenty cases run twice are twenty pieces of evidence, not forty. That is why the likely range narrows with more cases far more than with more trials.
Reading a report¶
gvn eval run prints the report when the run ends, and gvn eval show RUN prints it again:
support on baseline: 24 of 40 trials passed, 60% (likely between 40% and 80%)
Cases: 12 solid (passed every time), 0 flaky (passed some of the time), 8 failing (never passed)
Criteria:
must pass: a person is brought in exactly when needed: 65% (likely between 45% and 85%); 65% of cases passed every time, 65% passed at least once
must pass: the case is closed, by an answer or a ticket: 100% (likely between 84% and 100%); 100% of cases passed every time, 100% passed at least once
must pass: the reply states the key fact: 95% (likely between 85% and 100%); 95% of cases passed every time, 95% passed at least once
measured: stays within 12000 tokens: 100% (likely between 84% and 100%); 100% of cases passed every time, 100% passed at least once
measured: the reply sticks to the articles: 100% (likely between 84% and 100%); 100% of cases passed every time, 100% passed at least once
Cost: 0.012 USD
The headline: pass rate and likely range¶
support on baseline is the eval and the version. 24 of 40 trials passed counts trials that passed every must-pass criterion.
60% is the pass rate: for each case, the share of its trials that passed, averaged over the cases. Every case weighs the same. When every case was judged the same number of times, it equals the share of trials that passed.
Likely between 40% and 80% is how sure that number is. The pass rate was measured on these twenty cases; on other, similar cases it would come out somewhat different. The true pass rate lies in that range with 95% confidence (a 95% interval). The web page and the command line both write it this way. Read it like this:
- A wide range means few cases. Three cases give ranges 50 or more points wide; twenty give about 40 points; a hundred about 20. To narrow it, add cases.
- Two versions whose ranges overlap may still differ. Do not compare two reports by eye;
compare them with
gvn eval compare, which pairs them case by case and is much more sensitive (below). - 100% still has a range. 20 cases that all passed read 100% (likely between 84% and 100%): twenty successes cannot rule out a true rate of 84%.
When not every trial was judged¶
The pass rate counts only the trials that have a result. When that is fewer than the run asked for, the headline says how many, and why the others are missing:
support on baseline: 20 of 36 judged trials passed, 56% (likely between 33% and 78%); only 36 of 40 trials were judged (4 could not run)
Read only 36 of 40 trials were judged before the percentage. The brackets name what keeps the rest out: trials that could not run, trials that have not run yet and trials that are not judged yet (a review waiting for a reviewer, a judge to ask again). A rate over part of a run is not the run's rate: one judged trial that passed reads 1 of 1 judged trials passed, 100%, and the gate and the comparison below do not count it as one. Finish the run first (see The lines that may follow).
Cases: solid, flaky, failing¶
Per case, over its trials:
| Word | Means | What to do |
|---|---|---|
| solid | passed every time it ran | nothing; it guards against regressions |
| flaky | passed some of the time | the version can do it but does not reliably: read a passing and a failing trial side by side in the web page, and tighten the instructions or the tools |
| failing | never passed | the version cannot do it, or the case or a criterion is wrong: read the failing criterion's explanation on the trial first |
| not judged yet | its trials ran, but none has a result yet | answer the reviews waiting for a reviewer, or run the same command again |
| with no trial run yet | none of its trials has run (the run was stopped, by its budget or otherwise) | run the same command again |
| whose trials could not run | every trial of the case could not run | read why with gvn eval show RUN, fix the cause and run the same command again |
Flaky cases are only visible with two or more trials per case.
One line per criterion¶
Each criterion's pass rate and likely range, must-pass criteria first, then measured ones (each group alphabetically). With two or more trials per case, two more numbers follow:
- 65% of cases passed every time: the share of cases whose every trial passed this criterion: what a customer can count on.
- 65% passed at least once: the share of cases where at least one trial passed: what the version can do when things go its way.
A large gap between the two is the flaky cases. A criterion with no result in any trial yet reads no trial judged yet.
The lines that may follow¶
The run has trials whose reviews are not answered yet. Answer them in the web page or with
gvn eval review (below); the report updates at once.
The run stopped before the end (its budget, Ctrl-C, a crash). Give the same command again to continue it.
Trials that could not run: something outside the harness stopped them (the environment could not be
opened, the model vendor had an outage, the budget). Each was tried again before being recorded
this way, and running the same command again tries it again. They count neither as a pass nor
as a fail, so the pass rate rests on fewer trials and
the headline says so. gvn eval show RUN lists each with its reason, after the report, and the
web page shows it on the trial:
Could not run (case, trial, why):
delivery-abroad, trial 1: the environment could not be opened: ConnectionError: the shop's test server did not answer
delivery-abroad, trial 2: the environment could not be opened: ConnectionError: the shop's test server did not answer
tracking, trial 1: the environment could not be opened: ConnectionError: the shop's test server did not answer
tracking, trial 2: the environment could not be opened: ConnectionError: the shop's test server did not answer
A gate fails while any trial could not run, unless you allow some (see Gates in CI), and a comparison with a case none of whose trials could run says there is not enough data to tell.
A judge gave no verdict that could be read for two trials. Their judgements are missing, the run is not finished, and the same command asks for exactly those again.
What every trial's model calls and every judge's calls cost, at the project's prices, in its currency. It counts every attempt: a trial tried again after it could not run, or after the process stopped half way, still counts what the earlier attempts spent. It never goes down: a judge asked again, or a criterion replaced, still counts what it spent.
Reading a comparison¶
gvn eval compare CANDIDATE BASELINE compares the run of a new version (the candidate) with
the run of the version you have (the baseline):
'support.plain_spoken' is better than 'support.baseline'.
'support.plain_spoken' is a run of the version plain_spoken and cost 0.01158 USD.
'support.baseline' is a run of the version baseline and cost 0.012 USD.
passed overall: +35 percentage points (likely between +15 and +55) over 20 cases; 7 did better, 0 did worse
a person is brought in exactly when needed: +35 percentage points (likely between +15 and +55) over 20 cases; 7 did better, 0 did worse
the case is closed, by an answer or a ticket: 0 percentage points (likely between 0 and 0) over 20 cases; 0 did better, 0 did worse
...
What to do next: Adopt the newer version if its cost is acceptable. If any case did worse, read it first.
The difference is taken case by case: for each case, the candidate's pass rate minus the baseline's, averaged over the cases both runs judged. +35 percentage points is that average; likely between +15 and +55 is how sure it is; 7 did better, 0 did worse counts the cases whose pass rate rose and fell. The criteria follow in the report's order, must-pass ones first. Because each case is compared with itself, a difference that two overlapping report ranges would hide still shows. The last line, What to do next, says what the verdict asks of you, as the table below does.
The four verdicts¶
The verdict is read from the likely range of passed overall:
| Verdict | When | What to do |
|---|---|---|
| better | the whole range is above zero (or above the margin) | adopt the candidate, if its cost is acceptable; read the cases that did worse, if any, before you do |
| about the same | the whole range is within the margin | the change neither helps nor harms by more than the margin; choose on cost, speed or simplicity |
| worse | the whole range is below zero (or below minus the margin) | do not adopt it; open the cases that did worse in the web page's Compare view and read their trials |
| not enough data to tell | a case was not judged in one of the runs, fewer than 6 cases were judged in both, or the range reaches both sides | the first line says which; finish the runs, add cases (best) or trials, or accept that the change is too small to matter |
The margin says how small a difference does not matter to you: gvn eval compare NEW OLD
--margin 5 treats differences under 5 percentage points as none. Without a margin, about the
same means every case did exactly as well in both runs, so set one when you want to know
whether a cheaper version is "as good".
When there is not enough data to tell¶
A verdict other than not enough data to tell needs two things before the range is even read.
Every case judged in both runs. A case with no judged trial in one run (its trials could not run, have not run yet, or wait for a reviewer) is a case the comparison cannot pair, and leaving it out could hide exactly the case that got worse. The first line names the run to finish, and What to do next says how:
There is not enough data to tell whether 'support.plain_spoken' is better than 'support.baseline', because 2 of 20 cases were not judged in the baseline; run it again to finish them.
...
What to do next: Finish the run the first line names: answer its reviews waiting for a reviewer (gvn eval review), run its gvn eval run command again for trials not run yet or not judged yet, and read why trials could not run with gvn eval show. Then compare again.
At least 6 cases judged in both. With fewer, even a version that did better on every case cannot be told from luck: six is the fewest cases for which "all of them moved the same way, better or worse" happens by chance less than one time in twenty. The smoke runs of Your first eval, three cases each, compare like this:
There is not enough data to tell whether 'support.plain_spoken.only-smoke.1-trial' is better than 'support.baseline.only-smoke.1-trial', because only 3 cases were judged in both runs, and telling needs at least 6; add cases and run both versions again.
...
What to do next: Add cases, so that at least 6 are judged in both runs, and run both versions again.
--min-cases N sets that number for one comparison (gvn eval compare NEW OLD --min-cases 20
for a decision you want to rest on more cases). Each criterion's line follows the same rule; a
criterion with a reason of its own (a review some cases are still waiting for) ends with not
enough data to tell, because ....
When every case changed by the same amount, the range is read from how many cases there are, as for a pass rate of 100%: twenty cases that all went from failing to passing read +100 percentage points (likely between +68 and +100), three such cases reach below zero. When no case changed at all, the range is exactly 0 and 0, and two identical runs read about the same.
What else differs¶
When more than the version changed between the two runs, the comparison says so before the numbers, under the line These also differ between the two runs, so part of the difference may come from them, one line each:
- the judge model: judge-a in the baseline, judge-b in the candidate
- criterion 'polite' changed, so it is left out of the comparison
The number of trials, the environment, the stand-in, a model, the currency or a criterion may appear here. A criterion whose definition changed is left out, because its two numbers measure different things. Read the list before trusting the verdict; to remove a difference, run the baseline again under the same conditions.
Runs that cannot be compared¶
Two runs compare when they measured the same thing:
- the same cases: the same content, whatever the order of the rows;
- the same must-pass criteria, each with the same identity. A criterion's identity is
what decides its verdict: a judge's statement, its examples and the model that judges; a
review's question and verdicts; a
spendscriterion's limits; the code of a criterion written in Python. Renaming a criterion, or editing the type hints, comments, docstrings or layout of its code, does not change it; editing what the code does, a word of the statement or the judge model does.
A measured criterion whose identity changed is left out of the comparison and named under What else differs. A changed must-pass criterion changes what passed means, so the two runs cannot be compared until both are scored with the same criteria. The message gives the command that does it, for the run that is behind the eval file:
'support.plain_spoken' and 'support.baseline' cannot be compared: the two eval runs decide whether a trial passed by different must-pass criteria. Score it again with the eval file's criteria, running no trial: gvn eval regrade examples/support_evals/support.eval.toml --version plain_spoken (for 'support.plain_spoken'); then compare again.
Runs over different cases cannot be made comparable this way; run both versions over the same cases:
'support.plain_spoken' and 'support.baseline.only-smoke.1-trial' cannot be compared: the two eval runs ran different cases: the cases file changed between them, or one ran only some of the cases (--only). Run the older version again on the same cases as the newer one, under a new name, then compare.
Continuing a run, and missing judgements¶
An eval run is recorded as it goes, one trial at a time. Running the same gvn eval run
command again, with the same eval file, --version, --only and --trials, continues it:
- trials already recorded are kept and never run again;
- trials not recorded yet are run, and trials that could not run are tried again;
- missing judgements are asked for again, and reviews answered meanwhile are read;
- scores that wait to be scored again (see Regrading after changing criteria) are given again.
Two people, or two CI jobs, can give the same command at the same time. Each trial is taken by
one of them and runs once; the other leaves it alone, and its report counts it as being run
or scored by another gvn eval run right now until it is recorded. gvn eval show lists those
trials, and showing the run again later shows their results.
So the answer to an interrupted run, a run stopped by its budget, or a report that says not finished is always the same command again. Running under the same name after the cases, the criteria, the version, the number of trials or the models changed is refused, because the run would no longer be one thing. The message names what changed and gives the way out, with a free name ready to paste:
$ gvn eval run examples/support_evals/support.eval.toml --version baseline --only smoke --name support.baseline
Since the eval run 'support.baseline' was started, these changed: the cases. A run keeps the cases, criteria, version, trials and models it started with. gvn eval regrade helps only when nothing but the criteria changed, so start a new run under a free name: gvn eval run examples/support_evals/support.eval.toml --version baseline --only smoke --name support.baseline.2.
After changing cases, start new runs under new names (one per version you want to compare).
When only the criteria changed, the message names them and gives the gvn eval regrade
command instead (next section):
$ gvn eval run examples/support_evals/support.eval.toml --version baseline
Since the eval run 'support.baseline' was started, these changed: the criteria ('the reply sticks to the articles' changed). A run keeps the cases, criteria, version, trials and models it started with. As only the criteria changed, score its recorded trials again with the new criteria, running no trial: gvn eval regrade examples/support_evals/support.eval.toml --version baseline. Or start a new run under a free name: gvn eval run examples/support_evals/support.eval.toml --version baseline --name support.baseline.2.
Answering reviews from the command line¶
A criterion written as review = "..." waits for a person in every trial (see
Criteria). The web page's Reviews view is one way to answer; gvn eval review is
the other, for a terminal or a script. With no arguments it lists what waits, in every recorded
run (give a run's name to list only that run):
$ gvn eval review
12 reviews waiting for a reviewer:
quiz.careful, case case1, trial 1: clear
Is the answer clear?
Answer: gvn eval review quiz.careful case1 1 clear VERDICT --by NAME
VERDICT is one of: pass, fail, cannot_tell
...
Trials are counted from 1, as gvn eval show lists them under Waiting for a reviewer. Record
one verdict by giving the run, the case, the trial, the criterion and the verdict, with who you
are and, if you like, a note:
$ gvn eval review quiz.careful case1 1 clear pass --by Ana --note "short and right"
Recorded 'pass' by Ana for 'clear', trial 1 of the case 'case1' in 'quiz.careful'. 11 reviews still wait in this run.
The verdict is recorded exactly as the web page records it, and the report updates at once. A verdict the review does not offer, a trial or case that does not exist, or a review already answered is refused with a sentence that says which, and nothing is recorded.
Regrading after changing criteria¶
regrade scores every recorded trial of the run again with the eval file's current criteria
and prints the new report. No trial runs again. A new or changed judge is asked about each
trial, and only those calls cost anything; criteria written in code are scored again for
nothing. The run must have the same cases, version and number of trials as the eval file
describes; --name, --only and --trials find it as run named it.
To compare two versions after changing a criterion, regrade both runs. A comparison between a regraded run and one that was not leaves a changed measured criterion out and says so, and refuses when a must-pass criterion changed (see Runs that cannot be compared).
A score belongs to the criterion that gave it. Every record keeps the identity each of its scores was given under, so a score given under other criteria than the run's (a regrade that was stopped half way, a run recorded before the criteria changed) is never counted: the report reads it as not judged (its headline counts those trials as wait to be scored again) and says how to finish, with the command for that run:
Not finished: 40 trials wait to be scored again because the criteria changed since (gvn eval regrade examples/support_evals/support.eval.toml --version baseline scores them, running no trial)
The same applies to reviews: a review asked under criteria that changed since is refused with that command, because its answer would be scored under criteria the run no longer has. Regrade first, then answer the review it asks.
Cost and budget¶
The project's developers give gvn the prices of their models, so every report states its cost
in their currency. --budget puts a ceiling on a run:
Once the run has spent 2 (in the project's currency, counting trials and judges), it starts no
more trials. The trials already started finish, so a run can end a little above its budget.
Then the report so far is printed (its cases with no trial run yet counted apart), followed by
what happened; for the support desk's run given --budget 0.005:
23 of 40 trials did not run: the budget of 0.005 USD ran out (0.0051 USD spent). Run the same command with a larger --budget to continue.
and the command exits with status 1. The budget counts what the whole run has spent, so
continuing it needs a budget above what it has spent already: --budget 3 allows about one
more.
To estimate a full run before paying for it, run the smoke cases once (--only smoke --trials
1) and scale the cost by cases times trials.
Gates in CI¶
A gate is a minimum a report must reach. --at-least CRITERION=RATE sets one; the rate is
written 0.9 or 90%, and the criterion is passed (the trial as a whole) or any criterion's
name as reports show it. Repeat it for several:
$ gvn eval gate support.baseline --at-least passed=90% --at-least "the reply states the key fact=0.8"
The gate failed for 'support.baseline':
- passed: 60% passed, below the required 90%
A gate holds when every named criterion's pass rate is at least its minimum and that criterion was judged in every trial that ran, no trial could not run, and the run is finished: every trial recorded, no review waiting, no judgement missing. It compares the pass rate itself, not its likely range, so set the minimum with the range of a typical run in mind.
A trial that could not run fails the gate, because the pass rate then rests on fewer trials than the run asked for:
$ gvn eval gate support.baseline --at-least passed=50%
The gate failed for 'support.baseline':
- 4 of 40 trials could not run; the gate allows 0. Read why with gvn eval show support.baseline, fix it and run the same command again, or allow some with --allow-could-not-run N
When some failures of the environment or the vendor are expected and acceptable, allow them
with --allow-could-not-run N, on gvn eval gate and on gvn eval run ... --at-least:
$ gvn eval gate support.baseline --at-least passed=50% --allow-could-not-run 4
The gate holds for 'support.baseline': passed at least 50%, and the run is complete. 4 of 40 trials could not run, within the 4 allowed.
Three ways to use it in CI:
gvn eval run FILE --version NAME --at-least passed=90%runs the eval and applies the gate.gvn eval gate RUN --at-least passed=90%applies it to a run recorded earlier.gvn eval run ... --junit results.xmlalso writes a JUnit XML file, which CI systems show as test results: one test per case, named by itscase_id; a failing or flaky case is a failed test whose message names the failing criteria, with each trial's explanation (and the trials that could not run, with why); a case whose trials could not run is an error; a case not judged yet is skipped.
gvn eval compare NEW OLD --fail-if-worse fails the job when the new version is worse.
A job in CI needs the model key in its environment, like a live run:
- name: Evals
run: |
gvn eval run evals/support.eval.toml --version candidate --budget 5 \
--at-least passed=90% --junit eval-results.xml
Exit status, for every gvn eval command:
| Status | Means |
|---|---|
| 0 | done; the gate, if any, holds |
| 1 | a gate failed, the comparison is worse under --fail-if-worse, or the run stopped at its budget |
| 2 | the command or a file is wrong: a misspelt option, a name the project does not offer, a cases or eval file that cannot be used, a run that does not exist. The message says what to change. |
Recap¶
- The pass rate is the average over cases of each case's share of passing trials; the range it likely lies in narrows with more cases. Solid, flaky and failing say how each case did over its trials. When not every trial was judged, the headline says how many were and why.
gvn eval comparepairs runs case by case and gives one of four verdicts, and a verdict only once every case was judged in both runs and at least 6 cases (--min-cases) were;--marginsays what difference does not matter; read what else differs before trusting it.- A gate fails when a trial could not run, unless
--allow-could-not-run Nallows it. - The same
runcommand continues a run and asks again for missing judgements;regraderescores with changed criteria;gvn eval reviewanswers reviews;--budgetcaps the cost;--at-least,gate,--junitand--fail-if-worseserve CI.
Next: The web page.