ealeng

Episode 04 of 15 · How many test cases?

Saturation: have you found every failure?

A simulated support assistant with 28 planted types of failure. Its failure rate was known to ±3 points after about 240 reviewed cases; finding all 28 types typically took 9,439, 39× as many. Why “how often it fails” and “in what ways it fails” need such different numbers, why “stop after 20 failures with nothing new” typically finds only 3 of 6 critical types, how the types seen only once hint at the ones you haven't seen (Chao1), and which sources of cases find which failures.

Lab 05 · Dataset Saturation15 min read
Video transcript7:39

0:00Cold open

0:01

We have an AI that answers customer support tickets. I read its answers one by one, to see how often it fails, and how.

0:09

How often was quick. After about two hundred forty answers, I knew its failure rate, give or take three percentage points.

0:18

But one failure is rare, and critical, the kind that does real damage: the AI obeys an instruction that someone hid inside a ticket.

0:28

That one typically showed up for the first time only after about five thousand one hundred answers.

0:35

So how many cases does it take to find the ways an AI fails? And how do you know you’re done?

0:42Intro

0:43

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

0:48

Today: finding the ways an AI fails, and telling when you’re not done.

0:54Meet Maya

0:55

I’m Maya, an ML engineer. First, the setup.

0:59

This assistant is a simulation I built. I planted twenty-eight types of failure in its answers, from common to very rare. So I know the truth, which you never do in real life.

1:11

Here, a test case is one customer request and the AI’s answer. Reviewing it means reading the answer and marking it: pass, or fail.

1:21

These are the first hundred I reviewed. Most passed. The red ones failed.

1:26

For each failure, I write down what went wrong: its type of failure. Engineers also call it a failure mode.

1:34

Five different types so far. One of them showed up twice.

1:3901 · The discovery curve

1:40

Now I keep going. After every case, I count how many different types of failure I’ve found so far.

1:47

Drawn as a line, that count is called a discovery curve.

1:51

It climbs fast at first, because common failures show up early. Eighteen types after a thousand cases.

1:59

Then it crawls. After five thousand cases: twenty-seven types. One is still missing.

2:06

Meanwhile, the failure rate was pinned down early: by a thousand cases, give or take about a point.

2:1402 · Two different questions

2:15

One review can be lucky, or unlucky. So I reviewed the same requests in many random orders, and took the typical result.

2:24

Knowing how often it fails, give or take three points: about two hundred forty cases.

2:30

Finding all twenty-eight types: about nine thousand four hundred. Almost forty times as many.

2:37

The hidden instruction is one of six critical types: failures that cost money, leak data, or put someone at risk. It’s typically the last critical type to show up.

2:48

How often it fails is a rate. In what ways it fails is a list. They’re different questions, and the list needs far more cases.

2:5803 · A popular stopping rule

3:00

So when do people stop reviewing? A popular rule: stop when twenty failures in a row bring nothing new.

3:07

Here’s what that looks like in my review. Twenty failures, and every one is a type I’d already found. Six of them are the most common one: missing the customer’s second question.

3:18

The rule says: done. And it’s a good rule for finding the main problems.

3:23

But across many reviews, when it stopped, how many of the six critical types had it found?

3:31

Typically three. Half of them.

3:34

Waiting for a hundred in a row takes more than three times as many cases, and still typically misses one.

3:4304 · Types seen once

3:44

Can the reviews themselves tell you you’re not done? Ecologists face the same problem when they count bird species in a forest.

3:52

If many of the species they spotted were seen just once, more are probably hiding. If every species was seen again and again, they’ve likely found most of them.

4:02

Here are my types after a thousand cases, and how many times each one showed up.

4:08

Half of them were seen only once.

4:12

A formula from ecology, called Chao1, turns those counts into an estimate: about thirty types in total. The truth is twenty-eight.

4:22

This time it landed close. Usually it guesses low, because a type too rare to show up even once leaves no clue. So read it as: at least this many.

4:3305 · Rare isn’t harmless

4:34

The types you haven’t found yet are rare. So it’s tempting to say they don’t matter much.

4:39

Let’s check: I gave every failure a cost. A critical failure costs fifty times a normal one.

4:46

After a thousand cases, the types still unseen are typically about twelve percent of all failures.

4:53

But they carry more than a third of the cost.

4:57

Because the rarest types include critical ones: the hidden instruction, a legal promise, another customer’s order details shown.

5:0706 · Where the cases come from

5:08

So far I picked requests at random. But there are other places to look for failures.

5:14

Random requests are slow, because most of them pass. Five hundred typically turn up just one of the six critical types.

5:23

Stratified: the same number of requests from each kind of traffic, including the critical one percent. It finds the critical types early.

5:32

A generator of tricky synthetic tickets, fake ones a program writes, finds what it was built to provoke, fast. Then it goes flat. It can’t fake failures that need real customer data, like showing one customer another’s order.

5:48

And tickets that users flagged: nearly every type shows up. In my simulation, users never flag the hidden instruction, because people don’t report what they don’t notice, or what works in their favor.

6:0207 · Mix the sources

6:04

Now give each source the same budget: five hundred cases to review.

6:09

No single source reliably finds all six critical types. The best, stratified, does it in about two reviews out of three.

6:18

Split the budget three ways: flagged, synthetic and stratified. Nearly every type, and all six critical ones in about four reviews out of five.

6:29

Their blind spots are different, so a mix covers more of them. Half stratified, half synthetic does a bit better on the critical ones, but finds only sixteen types. The three-way mix finds twenty-six.

6:42

But keep a random sample too, or a stratified one weighted back as in part three. Flagged and synthetic cases are skewed on purpose, so they can’t tell you how often each failure really happens. Targeted sources to find failures, random samples to measure them.

7:0008 · What I do now

7:02

So now I ask two questions, and size each one. How often it fails: a few hundred random cases.

7:09

In what ways it fails: thousands of cases, or better, sources aimed at the risky parts.

7:15

I don’t stop just because twenty failures brought nothing new. I count the types seen only once: many of them mean I’m not done. And I read Chao1 as a floor, not a total.

7:26

That wraps up this series on how many test cases you need.Maya: Count the ways, not just the fails.

7:31Summary

7:32

Then you know not just how often your AI fails, but much more about how.Maya: Thanks for watching!

Key takeaways

  • ✓“How often does it fail?” is a rate; “in what ways does it fail?” is a list. In the simulation, the rate was known to ±3 points after about 240 cases. Finding all 28 failure types typically took 9,439, 39× as many, because every rare type has to show up at least once.
  • ✓A discovery curve counts the distinct failure types found after each reviewed case. It climbs fast, because common types show up early (18 types after 1,000 cases in one review), then crawls (27 of 28 after 5,000). A flat curve says the source has stopped showing new types, not that none are left.
  • ✓The popular stopping rule, “stop when 20 failures in a row bring no new type”, is good for finding the main problems. It typically stopped at 1,652 cases with 21 of 28 types and only 3 of the 6 critical ones. Waiting for 100 in a row took 5,552 cases and still typically missed one critical type.
  • ✓Count the types you've seen only once. Many of them mean more types are hiding. Chao1 (from ecology, where it estimates bird species) turns those counts into an estimate: after 1,000 cases, 18 types seen, 9 of them once, Chao1 said 30 against a true 28. Over 300 reviews it usually ran low (a median of 22.5), so read it as “at least this many”.
  • ✓Rare isn't harmless. After 1,000 cases the unseen types were typically 11.6% of failures but 36.6% of the failure cost, because 3 of the 6 rarest types were critical (each critical failure costs 50 times a normal one).
  • ✓Every source of cases has blind spots: random requests are slow, synthetic tickets can't fake failures that need real customer data, users never flagged the hidden instruction. For 500 cases, no single source found all 6 critical types in more than 68.5% of reviews; a three-way mix found 26 of 28 types and all 6 critical in 81.5%.
  • ✓Find with targeted sources, measure with random samples. Flagged and synthetic cases are skewed on purpose, so they can't say how often a failure happens; a random sample, or a stratified one weighted back (Chapter 3), can.

Chapters 1 to 3 asked how precisely you know a rate: how often your AI fails, give or take how much. This chapter asks a different question: in what ways does it fail, and how can you tell you haven't found them all? In the simulation below, the failure rate was known to ±3 percentage points after about 240 reviewed cases. Finding every type of failure typically took 9,439, and one dangerous failure, the AI obeying an instruction hidden inside a ticket, typically showed up for the first time only after about 5,100.

The examples come from Lab 05 (Dataset Saturation) of the AI evals labs, scripts 01_discovery_curve.py (how fast failure types are found, against how fast the rate is known), 02_unseen_modes.py (estimating the types you haven't seen, and what they cost) and 03_sources.py (where to look: four sources of cases and their blind spots). Their counting functions live in the labs' shared package, evalkit/discovery.py. The lab's fourth script, 04_your_labels.py, runs the same report on your own review labels; this chapter only mentions its example result. Every number here comes from the lab's code, re-run for this chapter.

Everything here is a simulation. The assistant is a simulated customer-support AI with 100,000 requests, and the lab planted the failures in it, so it knows the truth, which you never do in real life. The requests come in four kinds, the same mix as Chapter 3: normal (90% of traffic, failing 4% of the time), difficult (5%, failing 15%), ambiguous (4%, failing 20%) and critical (1%, failing 30%). Overall, 5.5% of answers fail.

What a type of failure is

Here a test case is one customer request and the AI's answer. Reviewing it means reading the answer and marking it pass or fail, and for each failure, writing down what went wrong. That label is its failure mode: its type of failure. The lab planted 28 of them, with a long tail of frequencies:

  • 13 in normal traffic, from "missed the customer's second question" (about 1 in 110 requests) to "promised a callback that doesn't exist" (1 in 5,556);
  • 5 in difficult requests (like "miscalculated a partial refund") and 4 in ambiguous ones (like "guessed instead of asking");
  • 6 critical types: failures that cost money, leak data or put someone at risk. "Refund above the limit without approval", "changed account details without verification", "unsafe advice about a gas stove leak", "exposed another customer's order details", "made a legal promise about liability", and the rarest of all 28, "followed an instruction injected in the ticket", about 1 in 11,000 requests by design.

In one review, the first 100 cases held 6 failures of 5 different types; "wrong order status" showed up twice.

The discovery curve

Now keep reviewing, in random order. After every case, count how many different failure types you've found so far. Drawn as a line, that count is a discovery curve. Here is one review of 5,000 random cases, the one Scripts 1 and 2 read:

Cases reviewed Failures seen Types found Failure-rate margin
100 6 5 ±4.8 points
500 22 11 ±1.8
1,000 49 18 ±1.3
2,000 109 24 ±1.0
5,000 277 27 ±0.6

The margin is half the width of the 95% confidence interval for the failure rate (the Wilson interval from Chapter 1). It shrinks fast: by 1,000 cases the rate is 4.9% ± 1.3 points, pinned down. The types climb fast at first, because common failures show up early, then crawl: 18 after 1,000 cases, 27 after 5,000. One type, "made up a discount code", still hadn't appeared. The flat end of the curve is called saturation: more review stops turning up new types, for the source you're sampling from.

Try it · One review, two questionsLab 05 · 01_discovery_curve.py · simulated assistant, one review

Cases reviewed so far

07142128all 28 types01,0002,0003,0004,0005,00020 failures, nothing new: 2,223Critical: refund above the limit without approval, first seen at case 28Critical: changed account details without verification, first seen at case 104Critical: made a legal promise about liability, first seen at case 1,189Critical: exposed another customer's order details, first seen at case 1,907Critical: unsafe advice about a gas stove leak, first seen at case 2,820Critical: followed an instruction injected in the ticket, first seen at case 3,436
distinct types found a critical type, first seen
How often: failure rate
4.9%
± margin (Wilson)
±1.3
In what ways: types
18 of 28
Critical types
2 of 6

49 failures in 1,000 cases. Margin in percentage points. Critical types not seen yet: unsafe advice about a gas stove leak; exposed another customer's order details; made a legal promise about liability; followed an instruction injected in the ticket.

Typical, over 200 random review orders (cases needed)

Failure rate to ±3 points
240
Half the types found (14)
494
Failure rate to ±1 point
2,010
90% of the types found (26)
3,724
All 28 types found
9,439

The two rate rows are planned sample sizes at the population's true 5.5% failure rate; the type rows are medians. The hidden-instruction failure, the last critical type in about half the orders, typically first appears at case 5,103.

“Stop after k failures in a row with no new type”, typical over 200 reviews: k = 20: stops at 1,652, 21 of 28 types, 3 of 6 critical · k = 50: stops at 3,376, 25 of 28 types, 4 of 6 critical · k = 100: stops at 5,552, 26 of 28 types, 5 of 6 critical. In this one review the 20-failure rule fired at case 2,223.

Two different questions

One review can be lucky or unlucky. So Script 1 replays the same 100,000 requests in 200 random orders and takes the typical result, the median:

Milestone Cases
Failure rate known to ±3 points 240
Half the types found (14 of 28) 494
Failure rate known to ±1 point 2,010
90% of the types found (26 of 28) 3,724
All 28 types found 9,439

The two rate rows aren't medians: they're the planned sample size at the true 5.5% rate, the calculation from Chapter 2. Knowing how often it fails took 240 cases; finding every way it fails took 9,439, 39× as many. And the critical types are among the latest: the median first sighting was case 664 for the unapproved refund, 2,457 for another customer's order details, and 5,103 for the hidden instruction, which was the last critical type to appear in 105 of the 200 orders.

How often it fails is a rate. In what ways it fails is a list. They're different questions, and the list needs far more cases, because every rare item on it has to turn up at least once.

So when do people stop reviewing? A popular rule from qualitative research and error analysis is called theoretical saturation: stop when k failures in a row (often 20) bring no new type. Passes don't count; only failures extend or break the streak.

In the review above, the rule fired at case 2,223. The last 20 failures were all types already found; 6 of them were the most common one, "missed the customer's second question". At that point the review had 24 of 28 types and 4 of the 6 critical ones. Across 200 random reviews (Script 1, Exercise 3):

k (failures in a row with nothing new) Typically stops after Types found Critical types found
20 1,652 cases 21 of 28 3 of 6
50 3,376 25 of 28 4 of 6
100 5,552 26 of 28 5 of 6

The rule is good at what it was made for: "have I understood the main problems?". It fires when the common types keep repeating, which happens early in a random sample. It's poor at "have I found everything dangerous?": with k = 20 it typically stopped with half the critical types still unseen, and waiting for 100 in a row took more than three times as many cases and still typically missed one.

Types seen once

Can the review itself tell you you're not done? Ecologists face the same problem when they count bird species in a forest. If many of the species they spotted were seen just once, more are probably hiding: the tail of rare species hasn't been exhausted. If every species was seen again and again, they've likely found most of them.

Failure types work the same way. The counts that matter are f1, the number of types seen exactly once (singletons), and f2, the number seen exactly twice. After 1,000 cases the review above had 18 types; 9 of them were seen once and 2 twice. A formula from ecology called Chao1 (after the statistician Anne Chao) turns those counts into an estimate of the total, seen and unseen:

estimated total = types seen + f1 × (f1 − 1) ÷ (2 × (f2 + 1))
                = 18 + 9 × 8 ÷ (2 × 3) = 18 + 12 = 30

The truth is 28, so this time it landed close. Its 95% range is wide, though: about 21 to 72. Read the same review at four points:

Cases Types seen Seen once (f1) Seen twice (f2) Chao1 (rough 95% range) Coverage: estimated Coverage: true
500 11 6 1 18.5 (12–54) 73% 63%
1,000 18 9 2 30 (21–72) 82% 86%
2,000 24 6 5 26.5 (24–39) 94% 97%
5,000 27 3 1 28.5 (27–42) 99% 99%

The last two columns are a second estimate from the same counts, Good–Turing coverage: the share of all failures that belong to types you've already seen, about 1 − f1 ÷ failures (at 1,000 cases, 1 − 9 ÷ 49 = 82%). Only a simulation knows the true share. Coverage answers "how many of the failures do the types I know explain?"; the next section shows why that isn't the question that matters most.

Try it · Counting what you've seen onceLab 05 · 02_unseen_modes.py · the same simulated review
Cases reviewed:
Read it as:
answer far too long9missed the customer's second question9guessed instead of asking5wrong delivery estimate4wrong order status3quoted an outdated policy3contradicted itself3escalated to a human unnecessarily2 · twicelinked the wrong help page2 · twicerefund above the limit without approval ●1 · seen onceconfused two similar products1 · seen oncechanged account details without verification ●1 · seen onceanswered the wrong interpretation1 · seen onceanswered only part of a multi-part ticket1 · seen oncerepeated the question back1 · seen oncehedged so much it never answered1 · seen onceignored the order number given1 · seen onceignored the customer's attachment1 · seen once

Each row a failure type found so far, each dot one failure of that type. ● marks a critical type.

Types seen
18
Seen once (f1)
9
Seen twice (f2)
2
Chao1 estimate
30

Chao1 = seen + f1 × (f1 − 1) ÷ (2 × (f2 + 1)) = 18 + 9 × 8 ÷ 6 = 30. Rough 95% range 21–72. The truth: 28.

Over 300 reviews of 1,000 cases, Chao1's median was 22.5 and its range held 28 in 82% of them: it usually runs low. Read it as “at least this many”.

Types not seen yet: share of failures

11.6%

typical (median of 300 reviews) · this review: 14.5%

… and share of failure cost

36.6%

typical (median of 300 reviews) · this review: 32.3%

Cost per failure: normal 1, difficult or ambiguous 2, critical 50. Only a simulation knows the unseen types; in real life you have the left-hand rows and nothing else.

Chao1 usually guesses low. Script 2 ran it on 300 independent reviews per size: with 1,000 cases its median estimate was 22.5, and with 500 cases 19.2, against a true 28. Its 95% range contained 28 in only 68–88% of reviews, depending on the size. That's built in: a type too rare to show up even once leaves no singleton behind, so nothing can count it. Read Chao1 as "at least this many", not as a total. It also assumes the cases come from one source, independently: mixing sources or reviewing near-duplicate traces distorts the counts.

Rare isn't harmless

The types you haven't found yet are rare, by definition. So it's tempting to say they don't matter much. Script 2 checks that by giving every failure a cost: a normal failure costs 1, a difficult or ambiguous one 2, a critical one 50.

Cases reviewed Unseen types: share of failures Unseen types: share of the cost
500 26.0% 58.4%
1,000 11.6% 36.6%
2,000 4.3% 19.1%
5,000 0.6% 4.8%

Medians over 300 random reviews. After 1,000 cases the types still unseen are typically about 12% of failures, but carry more than a third of the cost. The reason is in the tail: of the six rarest types, three are critical (the hidden instruction, a legal promise, another customer's order details shown). Coverage of failures and coverage of harm are different numbers.

Where the cases come from

So far the cases were picked at random. Script 3 compares four places to look, each reviewed 500 or 1,000 cases at a time:

  • Random: production requests picked at random. Slow, because about 19 of 20 pass.
  • Stratified: the same number of requests from each kind of traffic, including the critical 1% (stratified sampling, Chapter 3).
  • Synthetic tricky tickets: fake difficult, ambiguous and critical tickets a generator writes (the lab calls this source "adversarial"). It can only provoke the types it was built to reach, and it can't fake failures that need real customer data.
  • User-flagged: production failures a user flagged with a thumbs-down or a complaint. Every case is a failure, but only the ones users notice.
Source Types after 100 cases after 500 after 1,000 Critical types after 500
Random 5 14 19 1 of 6
Stratified 10 18 21 6 of 6
Synthetic 13 13 13 5 of 6
User-flagged 20 26 27 4 of 6

(Medians over 100 reviews.) Each source is blind somewhere. The generator went flat at 13 types after about 100 cases: it never found a normal-traffic type, and never "exposed another customer's order details", which needs real data. In this simulation users never flag the hidden instruction (the lab sets that chance to zero: people don't report what they don't notice, or what works in their favor), and flag the legal promise only 10% of the times they hit it.

Mix the sources

Now give every option the same budget of 500 reviewed cases, 200 times each (Script 3, Exercise 3):

Budget split Types found Critical types found Reviews that found all 6 critical
All random 13 of 28 1 of 6 0 of 200
All synthetic 13 5 0
All user-flagged 26 4 0
All stratified 18 6 137 (68.5%)
½ stratified + ½ synthetic 16 6 169 (84.5%)
⅓ flagged + ⅓ synthetic + ⅓ stratified 26 6 163 (81.5%)

No single source reliably finds all six critical types; the best, stratified, does in about two reviews out of three. Their blind spots differ, so a mix covers more of them. Half stratified, half synthetic does a bit better on the critical types (84.5%) but finds only 16 types; the three-way mix finds 26 of 28 and all six critical types in about four reviews out of five.

Try it · Every source has blind spotsLab 05 · 03_sources.py · simulated
0714212802505007501,000
Random Stratified Synthetic tricky tickets User-flagged
SourceTypes at 100at 500at 1,000Critical at 500
Random514191 of 6
Stratified1018216 of 6
Synthetic tricky tickets1313135 of 6
User-flagged2026274 of 6

Average of 100 reviews per source; the table shows medians. User-flagged cases are all failures, so that curve rises fastest. The synthetic generator reaches its 13 types within about 100 cases and then stays flat.

One thing none of the targeted sources can do is measure. Flagged and synthetic cases are skewed on purpose, so they say nothing about how often each failure happens in production. Keep a random sample for that, or a stratified one weighted back to the real traffic mix, as in Chapter 3. Targeted sources to find failures; random samples to measure them.

What to do

  1. Ask the two questions separately, and size each one. How often it fails: a few hundred random cases for ±3 points (Chapter 2). In what ways it fails: thousands of cases, or better, sources aimed at the risky parts.
  2. Plot a discovery curve for every review: distinct types against cases reviewed, per source.
  3. Don't stop on "20 failures with nothing new" alone. It finds the main problems. Before saying "we know how it fails", count the types seen only once: many of them mean you're not done.
  4. Compute Chao1 and read it as a floor. If it's well above the types you've seen, keep going.
  5. Weigh the unseen types by cost, not count. The rare types can carry much of the harm.
  6. Mix sources to find: stratified for rare kinds of traffic, synthetic for what you can provoke, user flags for what users notice. Know each one's blind spots.
  7. Sample at random (or stratify and weight back) to measure how often each type happens.

Caveats

  • A simulation with planted failures. The 28 types, their frequencies, the user flag chances and what the generator can reach are settings in the lab's simulation file, common.py. The lessons carry over; the exact numbers are this simulation's.
  • Rounded medians. Medians of 200 can end in .5, and the lab rounds them to the even number: the k = 20 rule stops at a median of 1,652.5 (shown as 1,652), half the types at 493.5 (494).
  • About 1 in 11,000 is a design rate. The 100,000 simulated requests actually hold 12 hidden-instruction failures, about 1 in 8,300.
  • The mixes reviewed slightly fewer than 500 cases. The lab splits 500 into whole cases per source (and the stratified source into equal quarters): the three-way mix reviewed 496, half-and-half 498.
  • Chao1 assumes one source and independent cases. Run it per source (or per kind of traffic), not on a mix.
  • Your own labels. 04_your_labels.py prints the same report for a real review. On its bundled example of 600 traces (simulated too), the 20-failure rule fired at trace 338 while 7 categories had been seen once and Chao1 estimated about 26 (22–49): not saturated.

The checklist

  1. What's the difference between a precise failure rate and having found the failure types? A rate needs a few hundred cases; the list needs every rare type to show up, which took 39× as many here.
  2. What is a discovery curve, and what does saturation mean? Distinct types against cases reviewed; saturation is its flat end, for the source you're sampling from.
  3. How do the types seen once help? Many singletons mean more types are hiding; Chao1 turns f1 and f2 into an estimate.
  4. What are Chao1's limits? It runs low (types never seen leave no clue), its range missed the truth 12–32% of the time, and it assumes one source.
  5. When is "20 failures with nothing new" appropriate? For finding the main problems; not for "have I found everything dangerous?".
  6. Why can unseen types matter more than their frequency? The rarest types include critical ones: 11.6% of failures, 36.6% of the cost after 1,000 cases.
  7. Which sources find which failures, and how do you combine them? Each has blind spots; mix them to find, and sample at random to measure.

Practice: count what you haven't seen

Write the lab's discovery math: the discovery curve, how many types were seen once and twice, Chao1's estimate, Good–Turing coverage, the "k failures with nothing new" stopping rule, and the share of failures and of cost in the types you haven't seen. The tests use the recorded review up to case 2,223, where the 20-failure rule fired: 11 types after 500 cases and 18 after 1,000, Chao1 30 (21–72) at 1,000, coverage 82%, and the unseen types holding 14.5% of failures but 32.3% of the cost in this review.

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

Quiz

Try it · Check your understanding0 of 6 answered
  1. 1.In the simulation the failure rate was known to ±3 points after about 240 cases. Finding all 28 failure types typically took 9,439. Why so many more?

  2. 2.You review production traces and stop when 20 failures in a row bring no new type. In the simulation, what did that typically miss?

  3. 3.After 1,000 cases you've seen 18 failure types: 9 of them once, 2 of them twice. What does that suggest?

  4. 4.Why does Chao1 usually guess low?

  5. 5.After 1,000 cases, the types you haven't seen are about 12% of all failures. Is it safe to ignore them?

  6. 6.User-flagged tickets found the most failure types (26 of 28 in 500 cases). Why not use only them?

Check your understanding

Try each question before opening its answer.

Your failure rate is known to ±1.3 points after 1,000 reviewed cases. Have you found the ways it fails?

Not necessarily. The rate and the list are different questions. In the simulation, 1,000 cases gave 4.9% ± 1.3 points but only 18 of 28 failure types and 2 of the 6 critical ones. Finding all 28 typically took 9,439 cases.

What is a discovery curve, and does a flat one mean you're done?

The number of distinct failure types found after each reviewed case. It climbs fast, then crawls. Flat means this source has stopped showing new types, not that none are left: the synthetic generator went flat at 13 of 28 after about 100 cases, because it can't reach the rest.

A review of 1,000 cases found 18 types, 9 seen once and 2 seen twice. Estimate the total, and say how much to trust it.

Chao1 = 18 + 9 × 8 ÷ (2 × 3) = 30, with a rough range of 21–72. The truth was 28. Chao1 usually runs low (median 22.5 over 300 reviews of 1,000 cases), because a type never seen leaves no clue, so read it as "at least this many".

When is "stop when 20 failures in a row bring no new type" a good rule?

For finding the main problems in a first round of error analysis. Not for safety work: it typically stopped at 1,652 cases with 3 of 6 critical types. Check the types seen once, and aim sources at the risky kinds of traffic.

Good–Turing says 95% of failures belong to types you already know. What doesn't that tell you?

How bad the other 5% are. Coverage counts failures, not harm. After 1,000 cases the unseen types were typically 11.6% of failures but 36.6% of the cost, because the rarest types include critical ones.

You have budget to review 500 cases. Where do they come from?

A mix, because each source has a blind spot: stratified for the critical kinds of traffic, synthetic tickets for what a generator can provoke, user flags for what users notice. In the simulation the three-way mix found 26 of 28 types and all 6 critical in 81.5% of reviews; no single source beat 68.5%.

Why keep a random sample if targeted sources find more types?

To measure. Flagged and synthetic cases are skewed on purpose, so they can't say how often each type happens in production. A random sample, or a stratified one weighted back to the real mix (Chapter 3), can.

Next up: Chapter 5, repeated runs: so far every case passed or failed once. Run the same eval again with nothing changed and the score moves. Chapter 5 separates the number of cases from the number of runs, and measures pass@k (the share of cases that pass at least once in k runs) and pass^k (the share that pass all k).

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.