ealeng

Episode 02 of 15 · How many test cases?

Sample size: what a margin costs

A request to measure an assistant's accuracy to ±0.4% works out to 21,609 hand-labeled test cases, 540 hours of labeling and $21,739. How to turn a margin into a number of test cases and a budget, why comparing two versions is a different question (100 cases each noticed a real 2-point gain about 6 times in 100), why 'not significant' isn't 'no difference', and how running both versions on the same cases, and keeping the labels, cut 10 comparisons from $66,828 to $2,583.

Lab 03 · The ±0.4% Problem14 min read
Video transcript7:09

0:00Cold open

0:01

My manager asked me for one number before launch: our AI assistant’s accuracy, to plus or minus zero point four percent.

0:10

So I worked out what it takes.

0:12

Twenty-one thousand, six hundred and nine test cases. Each answer checked by a person.

0:20

Five hundred and forty hours of checking. That’s over three months of full-time work, before the first result.

0:28

Is that decimal point worth it? And what do I tell my manager?

0:33Intro

0:34

Hands-on AI evals: how many test cases? Part two.

0:39

Today: what a margin costs, comparing two versions, and what I told my manager.

0:45Meet Maya

0:47

I’m Maya, an ML engineer. First, three words, in case you’re new.

0:52

A test case is a question for the assistant, plus its right answer. A person has to check that answer. That’s called labeling.

1:00

The score is the share of test cases the assistant gets right.

1:05

In part one, we saw that a score wobbles. Test on different cases, and you get a slightly different score.

1:12

So a score comes with a margin, like a poll: ninety percent, plus or minus three points. The truth is probably within that margin.

1:22

Plus or minus zero point four is a very thin margin. Measure ninety percent, and the truth is probably between eighty-nine point six and ninety point four.

1:33

Everything here is planning math and a simulation. Nothing calls a real AI. The request is a made-up example, but the math is the same for real ones.

1:4501 · What a margin costs

1:46

So how many test cases does a margin cost? I’ll assume the assistant gets about ninety percent right. If it scores lower, closer to fifty percent, every margin costs more cases.

1:59

Each row is a margin. The blue bar shows where the truth could be. The yellow bar shows how many cases it takes.

2:06

Plus or minus two points: eight hundred and sixty-five cases.

2:12

Plus or minus one: about thirty-five hundred.

2:16

So, for plus or minus zero point four, how many do you think?

2:23

Twenty-one thousand, six hundred and nine.

2:27

From plus or minus two to zero point four, the margin got five times thinner. The cases went up twenty-five times.

2:36

That’s the rule from part one: half the wobble takes four times the cases. The margin is squared in the formula, so five times thinner costs five times five.

2:4702 · Is the new version better?

2:49

But that’s usually not the real question. The real question is: is the new version better than the old one?

2:56

Say the old version gets eighty percent right, and the new one truly gets eighty-two. Two points better, for real.

3:04

I simulated that comparison two thousand times, each with a hundred test cases per version.

3:10

How often does the test show the new version clearly ahead, bigger than noise?

3:17

About six times in a hundred.

3:21

How often a test notices a real difference is called its power. This test almost always misses.

3:28

The usual goal is eighty percent power: noticing a real difference four times in five.

3:3403 · “Not significant”

3:36

Here’s one such test. Both versions got eighty-five of a hundred. Luck lifted the old one: eighty-five, not eighty. Plus zero points. The verdict: “not significant”, the test’s word for “not clearly bigger than noise”.

3:51

It’s tempting to write “the new version made no difference”. But that’s not what it means.

3:57

Look at the range for the improvement. It runs from a ten-point loss to a ten-point gain. The real gain of two points sits right inside it.

4:08

Not significant just means the test couldn’t tell. So report the range, not “no difference”.

4:1504 · The same test cases

4:16

So how do you catch two points without a mountain of labeled cases? Think of two students. Who’s better?

4:23

Give them different exams, and one might just get the easier exam. Give them the same exam, and that luck is gone.

4:31

Test cases work the same way. Run both versions on the same cases. Here’s a typical hundred: old version on top, new one below.

4:41

Most cases, both get right. Some, both get wrong. Those say nothing about which version is better.

4:48

Only the cases where they disagree count. Here, about one in eight.

4:53

So, to catch our two-point gain with eighty percent power: on different cases, you need about twelve thousand labeled cases.

5:02

On the same cases: about twenty-four hundred. Five times fewer.

5:07

How much it saves depends on how often the two versions agree. I assumed they agree a lot, as two versions of one assistant often do. A small pilot tells you how much.

5:1905 · Labels you keep

5:21

And pairing saves a second time. The expensive part is the labels: about a dollar each, for a minute and a half of a person’s time. Running the AI costs under a cent.

5:32

With the same cases, I label them once. Every later version just runs on them.

5:38

With different cases, every new version needs thousands of freshly labeled ones.

5:44

Over ten changes: almost sixty-seven thousand dollars, against about twenty-six hundred.

5:51

A labeled set you keep is an asset. That’s what a golden dataset is for.

5:5706 · My reply

5:58

So, back to plus or minus zero point four. I didn’t say no.

6:03

First, I asked: what decision does this number support?

6:08

Then I gave three options. A: exactly as asked. Five hundred and forty hours of labeling.

6:15

B: plus or minus one point. Six times cheaper, and enough to report a quality number. It gives up small changes: two such scores can’t be told apart if they’re less than about one point four apart.

6:29

C: plus or minus two, and paired checks on the same labeled cases. At our ninety percent, the versions disagree less, so it takes fewer cases. Each new version costs about nine dollars to check, and it gives up drops smaller than two points.

6:45

Each option says what it costs and what it gives up. Then my manager picks.Maya: Price first, then pick.

6:51Summary

6:52

Half the margin costs four times the cases. Ask what decision it serves. Compare versions on the same cases, and keep your labels.

7:01

Next time: why a random sample can miss the rare cases that matter most.Maya: Thanks!

Key takeaways

  • ✓Test cases for a margin: about z² × p(1−p) ÷ margin², with z = 1.96 for 95% confidence and p the score you expect. At about 90% right: ±3 points takes 385 cases, ±2 takes 865, ±1 takes 3,458, ±0.4 takes 21,609. The margin is squared, so half the margin costs 4× the cases and a 5× thinner one 25×.
  • ✓Price a margin in labeling time, not model calls. At the lab's example costs ($1 a label, $0.006 a model + judge run), ±0.4 points costs $21,739, of which $130 is model calls, and 540 hours of a person's time: over three months of full-time work.
  • ✓Plan with the score you expect, and know what a wrong guess costs. 50% is the safe guess (scores vary most there): ±2 points takes 2,401 cases instead of 865. A plan made for 90% that meets a system at 70% gives ±3.1 points, not ±2.
  • ✓'Is the new version better?' is a different question with a different size. Power is how often a test notices a real difference. With 100 cases per version, a real gain from 80% to 82% was noticed in 6.1% of 2,000 simulated comparisons; 80% power takes 12,078 labeled cases on different cases.
  • ✓'Not significant' means the test couldn't tell. One 100-case comparison of that real +2 gave 85 vs 85, a range of −10.1 to +10.1 points. Report the range, not 'no difference'.
  • ✓Run both versions on the same cases (a paired comparison). Cases both get right or both get wrong carry no information; only disagreements count, about 1 case in 8 here. That took 80% power from 12,078 labeled cases to 2,423, when the versions behave alike case by case (ρ = 0.6).
  • ✓Keep the labels. Later versions run on the same labeled cases for the price of model calls ($15 a check), so 10 changes cost $2,583 instead of $66,828. Answer a precision request with its price, the decision it serves, and cheaper options that say what they give up.

"Can we measure the assistant's accuracy to ±0.4%?" sounds like a reasonable request before a launch. Worked out, it is 21,609 test cases, each answer checked by a person: 540 hours of labeling and $21,739 before the first result. This chapter turns a margin into a number of test cases and a budget, shows why "is the new version better?" needs a different plan, and how comparing versions on the same test cases, and keeping the labels, makes the second question cheap. It ends with a reply to the ±0.4% request.

The examples come from Lab 03 (The ±0.4% Problem) of the AI evaluation labs: 01_sample_size.py (from a margin to a number of test cases), 02_comparisons.py (sizing a comparison of two versions, checked by simulation) and 03_cost.py (dollars and labeling hours, and the reply), with the lab's planning functions in evalkit/planning.py. Everything here is planning math and simulation; nothing calls a real AI system. The ±0.4% request is a made-up example, and the costs are the lab's example unit costs (in data/costs.json; change them for yours). The lab's command-line planner (04_plan.py) and its two plotting exercises aren't covered; the finite population correction and the pilot get a short section each.

Three words, and a margin

  • A test case is a question for the assistant plus its right answer. A person has to check the answer the assistant gives; that check is a label.
  • The score is the share of test cases the assistant gets right.
  • A score measured on a sample wobbles: test on different cases and you get a slightly different score. Chapter 1 put a confidence interval around it, the range the true score probably lies in (95% of the time). The margin is half its width: "90%, ±3 points", like a poll.

±0.4 is a very thin margin. Measure 90% and the truth is probably between 89.6% and 90.4%.

What a margin costs

Chapter 1 went from cases to a margin. Turn the same formula around and you get the cases for a margin:

test cases ≈ z² × p(1 − p) ÷ margin²
z = 1.96 for 95% confidence, p = the score you expect, margin as a share (0.02 for 2 points)
1.96² × 0.9 × 0.1 ÷ 0.02² = 864.4, rounded up to 865
Margin (95% confidence) At about 90% right At 50% (the safe guess)
±3 points 385 1,068
±2 points 865 2,401
±1 point 3,458 9,604
±0.4 points 21,609 60,023

From ±2 to ±0.4 the margin got 5× thinner and the cases went up 25×. The margin is squared in the formula, so half the margin costs 4× the cases: the same rule as Chapter 1's "half the wobble takes four times the cases". The confidence level matters much less: at 90% right and ±2 points, 99% confidence takes 1,493 cases instead of 865, 1.7×.

Try it · What a margin costsLab 03 · 01_sample_size.py + 03_cost.py · planning math

Pick a margin: how far the true score may be from the measured one (95% of the time). The left bar is where the truth could be; the right bar is how many hand-labeled test cases it takes.

Margin

True score could be (86.5–93.5%)

Test cases (log scale)

Test cases
21,609
vs. ± 2 points
25.0×
Labeling time
540 h
Total cost
$21,739

At about 90% right, ± 0.4 points needs 21,609 labeled cases: 540 hours of a person's time, about 14 weeks of full-time work, before the first result. A 5× thinner margin than ± 2 points, and 25× the cases.

Case counts: the lab's n_for_margin at 95% confidence. Cost: the lab's example unit costs, a label at $1 (1.5 minutes at $40 an hour) plus $0.006 of model and judge calls per case. Change them for yours.

The formula needs the score you're trying to measure. p(1 − p) is largest at 50%, so planning for 50% always meets the target, at up to 2.8× the cases of a 90% plan (2,401 against 865 for ±2 points). Plan for 90% and get it wrong, and the margin is wider than promised: the 865-case plan gives

The system really scores 97% 95% 90% 85% 80% 70% 50%
Margin from 865 cases ±1.1 ±1.5 ±2.0 ±2.4 ±2.7 ±3.1 ±3.3

The middle path: plan with the lowest score you'd believe, or run a small pilot first and top up the sample. This is planning math (the normal approximation); for reporting a measured score, use a Wilson interval from Chapter 1, which stays sensible near 0% and 100%.

One case where you need fewer: a small, fixed population. If the question is about last month's 2,000 support tickets, not all future traffic, ±2 points takes 604 tickets instead of 865 (the lab's finite population correction), and ±0.4 takes 1,831, 92% of them: label them all. For 100,000 requests it barely matters (857 instead of 865).

What ±0.4 costs

A label costs the lab's example $1: a minute and a half of a person's time at $40 an hour. Running the model and a judge on a case costs $0.006 together.

Margin, at about 90% right Test cases Labeling time Model + judge Total
±3 points 385 10 h $2 $387
±2 points 865 22 h $5 $870
±1 point 3,458 86 h $21 $3,479
±0.4 points 21,609 540 h $130 $21,739

Model calls are a rounding error; labeling is the cost. 540 hours is over three months of one person's full-time work before a single number comes out. Seen the other way (the lab's Exercise 4 of 03_cost.py), $1,000 buys a ±1.9-point margin and $25,000 buys ±0.4.

Is the new version better?

That is usually not the real question. The real one is: is the new version better than the old one? It's a different question, and it is sized differently.

  • The minimum detectable effect is the smallest real difference you want to be able to see. It should come from the decision: "we'd ship the new prompt for +2 points".
  • Power is how often a test notices a real difference of that size. The usual goal is 80%: four times in five.
  • A test "notices" when the difference it measures is clearly bigger than noise; the usual word is significant (at the 95% level, here). "Not significant" means "not clearly bigger than noise".

The lab's example: the old version gets 80% right, the new one truly 82%. 02_comparisons.py simulated that comparison 2,000 times per design and counted how often the new version came out clearly ahead:

Design Labeled cases Noticed (simulated) Power (formula)
100 cases per version, different cases 200 6.1% 5%
500 cases per version, different cases 1,000 12% 12%
500 shared cases, both versions on each 500 21% 25%
6,039 per version, different cases 12,078 80%
2,423 shared cases, both versions on each 2,423 80%

With 100 cases each, the test notices a real 2-point gain about 6 times in 100: it almost always misses. Halving the gain you want to see costs about 4× the cases, as with margins: +1 point takes 49,282 labeled cases on different cases.

Try it · Would you notice a real 2-point gain?Lab 03 · 02_comparisons.py · simulated

The old version gets 80% right; the new one truly gets 82%. Pick how the comparison is run.

Of 100 such tests (simulated)

lit = noticed the gain

One such test: the range for new minus old (points)

−10−50+5+10true +2

Old: 85 of 100. New: 85 of 100. Measured +0.0 points, range −10.1 to +10.1: not significant. The test couldn't tell; the real +2 is inside the range.

Labeled cases
200
Noticed (simulated)
6.1%
Power (formula)
5%

Simulated: 2,000 made-up comparisons per design, not a real AI. "Noticed" means the test showed the new version clearly ahead at the 95% level. The single test is one separate draw (the lab's Exercise 3); its range is a Newcombe interval for different cases and a paired interval for shared ones. The 2,400-case paired test has no simulated rate: its formula power is 80%, the same as the lab's 2,423-case plan.

"Not significant" isn't "no difference"

02_comparisons.py then draws one test per design, each facing the same real +2 points:

Design Measured (new − old) Range for the difference (95%) Significant?
100 per version, different cases +0.0 (85 vs 85 of 100) −10.1 to +10.1 no
500 per version, different cases −1.0 −5.9 to +3.9 no
500 shared cases +1.0 −2.1 to +4.1 no
2,400 shared cases +1.8 +0.4 to +3.2 yes

In the first row luck lifted the old version to 85 instead of 80, and the two tied. It's tempting to write "the new version made no difference". But the range runs from a ten-point loss to a ten-point gain, and the real +2 sits inside it. The test couldn't tell. (For different cases the range is a Newcombe interval, built from the two scores' Wilson intervals; for shared cases it comes from the disagreements alone.)

So report the range, not "no difference". A change is shown to be harmless only when the whole range sits inside what you'd accept, for example "no worse than −1 point".

Two students, one exam

How do you catch two points without a mountain of labeled cases? Think of two students. Give them different exams and one might just get the easier exam. Give them the same exam and that luck is gone.

Test cases work the same way. A paired comparison runs both versions on the same test cases. Most cases both get right, some both get wrong, and those say nothing about which is better. Only the cases where they disagree count (McNemar's test, the standard test for this, uses only those). In the lab's model, a typical 100 shared cases are 75 both right, 13 both wrong, 5 right only for the old version and 7 only for the new: about 1 case in 8 disagrees, and the 2-point gain is the 7 against the 5.

How many disagree depends on how alike the two versions behave case by case: the correlation ρ (rho), from 0 (unrelated) to 1 (they always get the same cases right). Two versions of one assistant are usually alike, because a prompt tweak rarely changes which questions are hard. For the 2-point gain at 80% power:

Design Cases that disagree Labeled cases
Different cases for each version 12,078 (6,039 each)
Same cases, ρ = 0.3 21.6% 4,233
Same cases, ρ = 0.6 12.4% 2,423
Same cases, ρ = 0.8 6.2% 1,217

The lab's examples use ρ = 0.6: five times fewer labeled cases. (Some combinations can't exist: 80% and 90% right can't be as alike as ρ = 0.8, because the better version has to get 10 extra cases in 100 right on its own.)

Try it · Two students, one examLab 03 · 02_comparisons.py + 03_cost.py · expected mix, not data

Which student is better? Give them different exams and one may just get the easier exam. Give them the same exam and that luck cancels. Here the students are the old version (80% right) and the new one (truly 82%), and the exam is 100 test cases.

How alike the versions are, case by case (ρ):
old version right (top row) new version right (bottom row) wrong they disagree: the only cases that count
Both right / both wrong
75 / 13
Old only / new only
5 / 7
Cases that disagree
12.4%
Labeled for 80% power
2,423

Cases both get right or both get wrong say nothing about which is better. Only the 12 in 100 where they disagree do, and the new one wins 7 of them to the old one's 5. To catch the 2-point gain 4 times in 5: 2,423 shared labeled cases, against 12,078 on different cases (5.0× fewer).

Labels you keep · total cost after 10 changes

Different cases: fresh labels every time$66,828
Same cases (ρ = 0.6): label once, reuse$2,583

The lab's cost arithmetic at its example unit costs: the first paired comparison labels 2,423 cases and runs both versions ($2,452); each later change runs only the new version on the same labels ($15). Without pairing, the first comparison labels 12,078 cases ($12,150) and each later change 6,039 fresh ones ($6,075). The grid above is the lab model's expected mix per 100 shared cases, rounded to whole cases and placed at random positions; it is not a measured run.

You don't know ρ in advance. Run both versions on a small pilot and count the disagreements. In the lab's Exercise 4, five 200-case pilots estimated a disagreement rate of 12–15%, giving plans of 2,353 to 2,941 cases against 2,423 with the true rate; round up. Use the pilot only for the disagreement rate, never for the effect: one of those pilots had the old version ahead, 17 disagreements to 9, although the new one is truly better.

Labels you keep

Pairing saves a second time. Labels are the expensive part. With the same cases, you label them once, and every later version just runs on them. With different cases, every new version needs thousands of freshly labeled ones. 03_cost.py prices 10 changes, each checked for a 2-point gain at 80% power:

First comparison Each later change 10 changes
Different cases $12,150 (12,078 labels) $6,075 (6,039 new labels) $66,828
Same cases, labels reused $2,452 (2,423 labels, both versions run) $15 (model calls only) $2,583

A labeled set you keep is an asset; it pays for itself on the second comparison. That's what a golden dataset is: a fixed, labeled set of test cases every version is checked on.

The reply to "we need ±0.4%"

Don't say no. Ask first what decision the number supports; a figure like ±0.4% is usually copied from somewhere, not derived from a decision. Then price options, each with what it gives up. From 03_cost.py's Exercise 3, at about 90% right:

Option Test cases Labeling Total What it gives up
A. ±0.4 points, as asked 21,609 540 h $21,739 Nothing; three months of labeling
B. ±1 point, to report a quality number 3,458 86 h $3,479 (6× cheaper) Two such scores can't be told apart if they're less than about 1.4 points apart
C. ±2 points, plus paired checks on the same labeled cases 1,549 39 h $1,558, then about $9 per new version Won't reliably see drops smaller than 2 points

Option C needs fewer cases than the 2,423 above because it's planned at about 90% right, catching a drop from 90 to 88: at 90% the versions disagree less (7.9% of cases), so fewer cases carry the same information. The 1,549 cases also cover the ±2-point score, which needs only 865. If a half-point change would really change a decision, size for that, and it will cost close to option A.

Caveats

  • Planning math, not measurement. Every count here is a formula or a simulation in the lab. The detection rates are 2,000 simulated comparisons; the single tests are one simulated draw each. Real numbers depend on your score, your ρ and your unit costs.
  • The simulated and formula detection rates differ a little. For 100 cases each, 6.1% simulated against 5% by the formula. That gap is rounding plus noise: the formula gives 5.5% before rounding, and a rate from 2,000 simulated comparisons wobbles by about ±1 point. Both say the same thing: the test almost always misses.
  • The paired grid is an expected mix, the lab model's per-100-case average rounded to whole cases, not a measured run.
  • A paired comparison is only as good as its shared cases. If the golden set doesn't represent real traffic, both versions are compared on the wrong cases. That's the next chapter's subject.
  • Example unit costs. $1 a label assumes 1.5 minutes per case; expert labels (medical or legal content, say) cost far more and shift every row toward fewer cases.
  • Option C's $1,558 covers the new version's runs only. The first paired check also runs the old version on the same 1,549 cases, about $9 more in model calls. It doesn't change the comparison.

The checklist

  1. Ask what decision a precision target supports before building for it.
  2. Turn the margin into test cases (z² × p(1 − p) ÷ margin²) and the cases into labeling hours and dollars.
  3. Plan with a cautious score: the lowest you'd believe, or 50% if you have no idea, or a pilot.
  4. Size comparisons separately: pick the smallest change that matters and aim for 80% power.
  5. Report the range for a difference, never "no difference" from a test that wasn't significant.
  6. Compare versions on the same test cases, and estimate the disagreement rate with a small pilot.
  7. Keep the labeled set and rerun every new version on it.
  8. Offer priced options, each with what it gives up.

Practice: size the eval

Write the lab's planning functions: the cases for a margin, the margin a plan really gives, the cost of a design, the cases for a comparison on different cases and on the same cases, and the cost of 10 changes both ways. The tests use the lab's numbers: 385 / 865 / 3,458 / 21,609, $21,739 and 540 hours, 12,078 against 2,423, option C's 1,549, and $66,828 against $2,583.

Try it · Practice in PythonRuns in your browser · ⌘/Ctrl + Enter to run
size_practice.py92 lines

Quiz

Try it · Check your understanding0 of 6 answered
  1. 1.At about 90% right, ±2 points takes 865 test cases. Roughly how many does ±1 point take?

  2. 2.Measuring ±0.4 points at the lab's unit costs comes to $21,739. What is most of that money?

  3. 3.Old version 80% right, new one truly 82%. A team compares them on 100 different cases each. How often does that test show the new one clearly ahead?

  4. 4.A 100-case comparison of that real +2 gain came back 85 vs 85: 'not significant', with a range of −10.1 to +10.1 points. What do you report?

  5. 5.Why does running both versions on the same test cases need so many fewer labeled cases?

  6. 6.Your manager asks for the score to ±0.4 points. What's the best first reply?

Check your understanding

Try each question before opening its answer.

How do you work out the number of test cases for a ±margin, and why does ±0.4 points need so many?

Test cases ≈ 1.96² × p(1 − p) ÷ margin², with p the score you expect. The margin is squared, so a 5× thinner margin costs 25× the cases: at about 90% right, ±2 points takes 865 and ±0.4 takes 21,609, about $21,739 and 540 hours of labeling at the lab's example costs.

What score should you plan with when you don't know it yet?

50% is the safe guess: p(1 − p) is largest there, so the plan always meets the target, at up to 2.8× the cases of a 90% plan. A plan made for 90% that meets a system at 70% gives ±3.1 points instead of ±2. The middle path is the lowest score you'd believe, or a small pilot and a top-up.

When does a small population mean fewer cases?

When the question is about a fixed, closed set and the sample is a sizable share of it. For last month's 2,000 tickets, ±2 points takes 604 instead of 865; for 100,000 requests it barely matters (857). It doesn't apply to all future traffic, which isn't a fixed set.

What are power and the minimum detectable effect, and how do they set the size of a comparison?

The minimum detectable effect is the smallest real difference you need to see, set by the decision. Power is how often a test notices a real difference that size; 80% is the usual goal. With 100 cases per version a real 80% → 82% gain was noticed 6.1% of the time in 2,000 simulated comparisons; 80% power takes 12,078 labeled cases on different cases. Halving the difference costs about 4× the cases.

Why does a paired comparison need fewer cases, and what decides how many fewer?

Both versions run on the same cases, so the luck of which cases were picked cancels, and cases both get right or both get wrong carry no information; only the disagreements count. How many fewer depends on how alike the versions behave case by case (ρ): for the 2-point gain, 4,233 at ρ = 0.3, 2,423 at 0.6, 1,217 at 0.8, against 12,078 on different cases. A small pilot estimates the disagreement rate.

A comparison isn't significant. What do you report?

The range for the difference. One 100-case comparison of a real +2 points came back 85 vs 85, with a range of −10.1 to +10.1: consistent with a big loss and a big gain. "Not significant" means the test couldn't tell. A change is shown harmless only when the whole range is inside what you'd accept.

How would you answer a request for ±0.4%?

Not with no. Show the cost (21,609 labeled cases, 540 hours, $21,739), ask which decision it serves, then offer options: ±1 point to report a quality number (3,458 cases, 6× cheaper, can't separate scores under about 1.4 points apart), or ±2 points plus paired checks on a reused labeled set (1,549 cases, about $9 per later check, misses drops under 2 points).

Next up: Chapter 3, stratified sampling: this chapter sized one score for one population. Real traffic has segments, including a rare 1% of critical requests a random sample can miss entirely; the next chapter sizes each segment, oversamples the rare ones and reweights the overall score.

Learning something useful?

New labs, articles, and videos on evaluating and testing AI systems come out regularly. Follow along so you don't miss the next one.