ealeng

Episode 15 of 15 · Style and form

Same rules, different form

One made-up refund policy, given to a small model (gpt-5.4-nano) in seven forms, on 150 cases whose right answers a rules engine knows exactly. A flowchart picture got 28% right; the same rules as a hand-written paragraph, 71%. How to test the form of an input: generate every form from one rule tree, spread the cases over every path and put some next to the thresholds, compare forms case by case, trace each wrong answer to the one decision that would explain it, check the result on a second model (on gpt-5.4-mini the prose-vs-JSON gap disappeared), and count the cost per right answer ($0.116 per 1,000 for prose, $1.592 for the picture). The policy and cases are made up; every answer is a real recorded run.

Lab 16 · Same Rules, Different Form19 min read
Video transcript7:46

0:00Cold open

0:01

Here is the same refund policy, given to a small model, two ways. Once as a flowchart picture. Once as a plain paragraph.

0:10

The model applied the picture correctly 28 percent of the time. The paragraph: 71 percent.

0:18

Same rules. Same facts. Only the form changed. Would you have guessed that?

0:24

Let me show you how I tested it.

0:27Intro

0:29

Hands-on AI evals: the same refund policy, in seven forms. Prose, JSON, a flowchart as text, and a picture of it.

0:39Meet Sara

0:40

I’m Sara, the compliance lead. Our refund policy lives in a wiki page, and in a flowchart someone drew.

0:47

Someone asked: can we paste the flowchart picture into the support prompt, instead of writing the policy out?

0:55

So I tested it: one policy in seven forms, on a small model called gpt-5.4-nano, with 150 cases. Each case has a right answer I know in advance.

1:08

Here is how the policy is built.

1:1101 · One rule tree

1:13

The policy is a tree of ten yes-or-no decisions. The limits are 30, 60 and 90 days, and a 200-dollar price. It ends in five outcomes: full refund, partial refund, replacement, store credit, or refuse.

1:28

A rules engine, a plain program, follows that tree for each case, and gives the exact right answer.

1:35

Six of the seven forms are generated from the same tree, so they can’t disagree with the engine. The policy page is written by hand, and a test checks it against the tree.

1:47

Here is one case. Watch one decision change the outcome.

1:52

Delivered 30 days ago: a full refund. Delivered 31 days ago: refused. Only the day count changed.

2:0102 · Four forms

2:02

There are seven forms in all. The first is the policy as a plain paragraph, written the way a policy page is written.

2:10

Form two: JSON, the same tree as nested data. Form three: Mermaid, a flowchart written as text.

2:18

Form four: the flowchart drawn as a picture. Three more are variants of these, all in the table.

2:25

A token is a small chunk of text the model reads, and is billed for. The picture costs about 2,100 tokens per case, against about 330 for the paragraph. With the Mermaid text added, it is 2,490.

2:4203 · The cases

2:44

There are 150 cases. Each lists six plain facts: days since delivery, the item’s state, the price, membership, a past refund, and final sale.

2:54

I spread them evenly over the eleven paths through the tree. Otherwise, most cases could test only the short paths.

3:03

Fifty-three of them sit right next to a threshold: 29 to 31 days, 59 to 61, 89 to 91, and 199 to 201 dollars.

3:15

Here is one case, in plain words. The model reads only this text.

3:20

The policy and the cases are made up for this test. Each model answer is a real run.

3:2704 · Predict

3:28

Here are all seven forms. Which one do you think the model applied most accurately?

3:34

Take a guess. A plain paragraph? The picture? Something in between?

3:39

Here is the answer. Prose came first, at 71 percent. JSON came next, at 56.

3:47

The full picture came last, at 28 percent. Its range runs from 23 to 33.

3:54

The paragraph beat every structured form. Adding the Mermaid text to the picture helped by about ten points, but prose still won.

4:0305 · Deeper paths

4:05

Depth is how many yes-or-no questions a case needs, from two to six. I split the answers into three groups: depth two or three, depth four, and depth five or six.

4:16

Prose was best on the deepest paths, at 91 percent. We don’t know exactly why.

4:22

The picture fell apart with depth. It got 44 percent on short paths, and 11 percent on the deepest.

4:30

My guess is that following many arrows in a picture is hard. I didn’t test that.

4:3606 · How it is drawn

4:38

Flowcharts are often drawn with shared outcome boxes: many arrows lead to one box, like “refund”.

4:45

The text version, Mermaid, does the same. We think the model has to look up what that box means, from far above.

4:53

Here it is drawn another way, where every outcome has its own labelled box. Same rules.

5:00

Changing the Mermaid text from shared to own boxes raised accuracy by 9.7 points. The range is about 2 to 17 points.

5:10

So in this test, the drawing mattered, though the rules didn’t change.

5:1507 · Which decision failed

5:17

When the model gets a case wrong, I can ask which decision would explain it. Flip one answer on the path. Does that give the wrong outcome?

5:25

Explains means: flipping that one answer gives the model’s wrong result. For most wrong answers, one flipped decision matches the wrong result: between 84 and 96 percent, depending on the form.

5:40

The decisions most often blamed are the day thresholds: 30 days, and 90 days.

5:46

So check the 30- and 90-day rules first. It isn’t proof, because some cases match more than one flip.

5:5408 · A stronger model

5:55

Is nano the whole story? I ran the main forms again, on a bigger model: gpt-5.4-mini.

6:03

On nano, prose beat JSON by 15 points. On mini, the difference disappeared: 15 cases were right only with prose, and 13 only with JSON. The p value, 0.851, is the chance of a split this lopsided, or more, if the two were really equal.

6:22

The picture doubled, from 25 to 53 percent. The 25 is nano’s first sample alone, so it runs a little below the 28 percent from both samples. The flowchart text came close, at 47, not a clear gap.

6:38

The nano result depended on the model. Check a second model before you trust one.

6:4509 · What a right answer costs

6:46

Last, cost, per correct answer. A cheap form that is often wrong is not really cheap. These are dollars per thousand correct answers.

6:55

Prose came to about twelve cents. The full picture came to about one dollar and fifty-nine cents.

7:02

The picture costs more than thirteen times as much per right answer.

7:07

It was also the least accurate. So the picture is the expensive choice, and the weaker one.

7:14Summary

7:15

So here is what I do now. I paste the policy text, because on this small model prose was the most accurate form, at 71 percent, not the picture.

7:26

And I test every form on the same cases, boundaries included. Then I check on a second model.

7:33Summary

7:35

On this small model, the form changed how well the rule was applied. Test the form on the same cases you use to test the rule.Sara: Thanks for watching!

Key takeaways

  • ✓The form of an input is a variable. The same refund policy, the same 150 cases, the same small model (gpt-5.4-nano): written as a paragraph, 71% of answers were right (Wilson interval 66–76%); as a JSON tree, 56%; as Mermaid flowchart text, 42%; as a picture of the flowchart, 28% (23–33%).
  • ✓Make the right answer exact before comparing forms. A rules engine walks one rule tree (ten yes-or-no decisions, five outcomes) to give every case its answer, and six of the seven forms are generated from that tree, so they can't disagree with it. The hand-written policy page is the exception, checked by a test that every threshold and outcome appears in it.
  • ✓Spread the cases over the paths, not at random. 150 cases, 13 or 14 on each of the tree's 11 paths, so long paths get as many cases as short ones; 53 sit next to a threshold (29–31, 59–61, 89–91 days; $199–$201). Thresholds weren't the main problem: boundary and other cases scored within 5 points in six of seven forms.
  • ✓Compare forms case by case. Prose beat JSON by 15.3 points (bootstrap range +9.3 to +21.3). Asking the same form twice changed the verdict on 22 to 47 of the 150 cases, so a single run per form is noisy.
  • ✓How a diagram is written matters as much as whether it's a diagram. The Mermaid text with shared outcome boxes (one box per outcome, pointed to from all over the tree) scored 9.7 points lower (+1.7 to +17.3) than the same flowchart with its own box per outcome. Half-size, the picture scored about the same and cost 2.6× less per answer.
  • ✓A wrong answer can often be traced to one decision: flip that decision, and the rules engine gives the model's wrong answer. One flip explains 84–96% of wrong answers, depending on the form, most often at the 30- and 90-day thresholds. When several flips fit, the lab blames the deepest one, which is a convention, not proof.
  • ✓Check a second model before trusting a ranking. On the bigger gpt-5.4-mini, prose and JSON were level (15 cases right only with prose, 13 only with JSON, p = 0.851), and the picture doubled (25% → 53%). Per 1,000 right answers on nano, prose cost $0.116 and the picture $1.592, more than 13 times as much.

Here is one refund policy, given to a small model in two forms: once as a picture of a flowchart, once as a plain paragraph. The model applied the picture correctly in 28% of cases, the paragraph in 71%. Same rules, same facts; only the form changed. This chapter is about testing the form of an input: how to make the right answer exact, which cases to use, how to compare forms fairly, how to trace a wrong answer back to the decision that probably went wrong, and why one model's ranking isn't the last word.

The examples come from Lab 16 (Same Rules, Different Form) of the eval labs, all four of its scripts: 00_build.py (builds every form and the 150 cases from one rule tree), 01_run_forms.py (asks the model every case in every form, twice), 02_compare.py (paired differences, boundaries, which decision went wrong, the picture checks, cost per right answer) and 03_stronger_model.py (the main forms again on a bigger model). The rule tree and the rules engine live in the lab's policy.py. The policy and the 150 cases are made up (a seeded script writes the cases). Every answer is a real model run: gpt-5.4-nano, a small, cheap OpenAI model, with reasoning turned off (in this chapter, "nano"), and for the last check gpt-5.4-mini, a bigger one ("mini"). The whole run cost the lab about $0.97. Nothing was re-run for this chapter: the numbers come from the lab's recorded answers, put through the lab's own code. The lab's exercise ideas (reasoning on, prose written by someone who hasn't seen the tree, a messier photo, cases written as customer emails) aren't covered. Neither is the other meaning of "graph": a workflow graph, where code runs the steps instead of the model reading them, is a different question. Chapter 14 tested the style of the instructions; this chapter keeps the instructions fixed and changes the form of the reference material.

The question

The refund policy lives in a wiki page, and in a flowchart someone drew. Can the flowchart picture go straight into the support prompt, instead of writing the policy out? Teams paste policies into prompts in whatever form they have: a wiki page, a config file, a diagram, a screenshot of one. The facts are the same; how the model reads them may not be.

One rule tree

The policy is a tree of ten yes-or-no decisions. The limits are 30, 60 and 90 days and a $200 price, and it ends in five outcomes: full refund, partial refund, replacement, store credit, or refuse. A rules engine, a plain program, follows the tree for each case and gives the exact right answer. No judge, no rubric: right is right.

Here is one case, case 107 (the lab numbers its cases 1 to 150). Delivered 30 days ago, unopened, $180, the customer isn't a member, had a refund in the last 90 days, not a final-sale item. The engine walks: final sale? no. Damaged or defective? no. Delivered 30 days ago or less? yes. Opened? no. Full refund. Change only the day count to 31, and the third decision flips: delivered 30 days ago or less? no. Member and within 60 days? no. Refuse. One day, a different outcome.

The model gets the policy in one of seven forms. Six are generated from the tree, so they can't disagree with the engine; a test walks the JSON form, reading only its question text, on 3,000 random cases and checks it against the engine. The seventh, the policy page, is written by hand the way real policy pages are, and a weaker test checks that every threshold and outcome appears in it.

Form What the model gets Tokens per case
Policy page (prose) a hand-written page, four paragraphs 327
JSON tree the tree as nested JSON data 566
Mermaid text, shared boxes the flowchart written as Mermaid text, each outcome box defined once and pointed to again by a short id 490
Mermaid text, own boxes the same flowchart with every outcome its own labelled box 513
Picture the flowchart drawn as an image (2,259 × 911 pixels) 2,115
Picture, half size the same image at half the resolution 767
Picture + Mermaid text the image and the shared-box Mermaid text together 2,490

A token is a small chunk of text the model reads and is billed for; an image is billed as input tokens too, depending on its size. Mermaid is a small language for drawing flowcharts as text (N1{"Final-sale item?"} -->|Yes| N2{"Arrived damaged?"}); the lab's picture is drawn with a plotting library straight from the tree, with its own box for every outcome. The two Mermaid forms differ only in how outcomes are drawn, which turns out to matter.

Every prompt is the same apart from the policy: apply the policy exactly as written, and answer with JSON naming one of the five outcomes. A fixed label list keeps parsing out of the way: only 3 of the 2,100 nano answers were unreadable (all with the own-box Mermaid text), and they count as wrong.

The cases

There are 150 cases. Each lists six plain facts: days since delivery, the item's state (unopened, opened and working, arrived damaged, defective), the price, membership, a refund in the last 90 days, and final sale. Facts are spelled out so that the test is about applying the policy, not about pulling facts out of a customer email.

Random cases would mostly test the broad rules ("final sale, not damaged: refuse"), and the deep paths would get a handful each. So the lab spreads the cases evenly over the tree's 11 paths, 13 or 14 per path, the way Chapter 3's stratified sampling gives every group enough cases to measure. That makes the overall accuracy an average over paths, not over real traffic: to quote one number for your traffic, reweight by how often each path really happens.

The depth of a case is how many decisions it passes through: 2 to 6. In the 150 cases, 42 need 2 or 3 decisions, 67 need 4, and 41 need 5 or 6. And 53 are boundary cases, next to a threshold: 29–31, 59–61 or 89–91 days, or $199–$201. "Within 30 days": is day 30 in?

Try it · One case through the rule treeLab 16 · policy.py, data/cases.jsonl, recorded answers · made-up cases, real model runs

The policy is this tree of ten yes-or-no decisions (boxes shortened; the full questions are in the list below). Green: the path a case takes and its right answer, from the lab's rules engine. Pick one of the 150 cases, or change its facts and watch the path move. Under the tree: what each form of the policy made the model answer. Click a wrong answer to see the single flipped decision that would produce it (red, dashed).

Case 107 of 150 · a boundary case

Delivered 30 days ago. The item is unopened, still in its original packaging. Price: $180. The customer is not a member. The customer received a refund in the last 90 days. It is not a final-sale item.

Change the facts

Draw the outcomes as:

The tree is wide: scroll it sideways.

yesnoyesnoyesnoyesnoyesnoyesnoyesnoyesnoyesnoyesnoFinalsale?Arriveddamaged?Damaged ordefective?≤ 90days?Price> $200?≤ 30days?Member and≤ 60 days?Opened?Refund inlast 90 days?Member?REPLACE-MENTREFUSEREPLACE-MENTFULLREFUNDSTORECREDITSTORECREDITFULLREFUNDPARTIALREFUNDFULLREFUNDSTORECREDITREFUSE

The engine's path · depth 4 · right answer: full refund

  1. Final-sale item? no
  2. Arrived damaged or defective? no
  3. Delivered 30 days ago or less? yes
  4. Opened? no

What the model answered for this case (14 of 14 nano answers wrong)

formnano, run 1nano, run 2mini
Prose
JSON
Mermaid (shared)
Mermaid (own)
Picture
Half-size picturenot run
Picture + Mermaidnot run

Click an answer. For a wrong one, the tree shows which single flipped decision would give it.

Case 107 is one of the 9 cases that nano got wrong in every form, both times. Most of its wrong answers were store credit, which is what the policy gives an opened item after a recent refund; this item is unopened.

Which form won?

Before reading on: which form do you think the model applied most accurately?

Try it · Which form did the model apply best?Lab 16 · 01_run_forms.py, 02_compare.py, 03_stronger_model.py · real runs

Same policy, same 150 cases, seven forms, on the small model (gpt-5.4-nano, every case asked twice: 300 answers per form). Guess first: which form did it apply most accurately?

Pick a form to reveal the results.

On nano, 150 cases × 2 runs = 300 answers per form:

Form Right 95% interval Depth 2–3 Depth 4 Depth 5–6
Policy page (prose) 71% 66–76% 68% 61% 91%
JSON tree 56% 50–62% 55% 44% 77%
Mermaid text, own boxes 52% 46–58% 42% 47% 71%
Mermaid text, shared boxes 42% 37–48% 42% 40% 48%
Picture + Mermaid text 38% 33–44% 56% 30% 33%
Picture, half size 32% 27–38% 37% 40% 16%
Picture 28% 23–33% 44% 28% 11%

The intervals are Wilson intervals (Chapter 1): the range of accuracies consistent with what was measured. The hand-written paragraph beat every structured form, the opposite of the usual advice to give the model structure.

Are the gaps real? Every form answered the same cases, so the lab compares them case by case, a paired comparison (Chapter 1): average each case's two runs, take the difference per case, and resample the 150 cases 4,000 times (a bootstrap) for a range. Prose minus JSON: +15.3 points (+9.3 to +21.3). JSON minus shared-box Mermaid: +13.7 (+5.7 to +22.0). Shared-box Mermaid minus the picture: +14.7 (+7.3 to +21.7). On single runs, McNemar's test (Chapter 2), which counts only the cases where the two forms disagree, agrees: 29 cases right only with prose against 8 only with JSON, p = 0.001.

Why two runs? Ask the same form the same 150 questions again, and some verdicts change. This A/A check (the same thing compared with itself) flipped 22 cases for prose and 47 for shared-box Mermaid, almost a third. The model answers at temperature 1, as a deployed system would, so its answers vary like a flaky test. Two forms compared on one run each could differ by several points by luck. (The intervals in the table treat the 300 answers as independent, which the two runs of one case aren't; the paired ranges above account for that.)

The lab also ran a 10-case slice first, to check the cost estimate before the full run. Its accuracies, 7 to 11 right of 20 answers per form (35% to 55%), said "everything is about 45%". Twenty answers can't rank anything; the full run separated the forms clearly.

Deeper paths

You might expect accuracy to fall as a case needs more decisions. For the text forms, it didn't: the prose did best on the deepest paths, 91% at depth 5–6. Those paths are the rules for opened items (a recent refund, then membership), which the policy page explains in a paragraph of their own. We don't know exactly why that helps; one guess is that how a rule is written matters more than how deep it sits.

The picture fell apart with depth: 44% on short paths, 11% on the deepest. Following five arrows across an image may be what's hard; the lab didn't test that directly.

Thresholds weren't the main problem. Boundary cases and the rest scored within 5 points of each other in six of the seven forms (prose: 69% against 73%). The exception is own-box Mermaid, 44% against 56%, and even there the intervals overlap. "Within 30 days" in the prose was read as including day 30 about as often as "30 days ago or less" in the diagrams.

How it is drawn

Flowcharts are often drawn with shared outcome boxes: one "refund" box, with arrows from all over the chart leading into it. The shared-box Mermaid text does the same: L1["REPLACEMENT"] is defined once, and six lines later another decision just says -->|Yes| L1. The lab thinks the model then has to look up what L1 means, from far above. Switch the drawing in the first widget to see the same tree both ways.

Writing every outcome as its own labelled box, same rules, raised accuracy by 9.7 points (+1.7 to +17.3) on nano. On mini, the own-box version was right on 14 cases where the shared-box one was wrong, against 4 the other way (p = 0.031). So there's no single "diagram" result: a claim like "models are bad at Mermaid" is a claim about one way of writing Mermaid. Test the way your team draws it.

Three more checks on the picture, all paired, on nano:

Comparison Difference in accuracy
Picture + Mermaid text − picture +10.3 points (+3.3 to +17.3)
Picture + Mermaid text − Mermaid text alone −4.3 (−12.0 to +3.7)
Picture − half-size picture −4.7 (−11.3 to +2.0)

Adding the Mermaid text to the picture helped the picture by about ten points, but adding the picture to the text didn't help the text, and the prose still won. Halving the picture's resolution didn't hurt, and cut its cost per answer by 2.6×.

Which decision went wrong?

When the model gets a case wrong, you'd like to know what it misread, without a judge. The lab's trick: take the case's path through the tree, flip one decision at a time, and ask the engine what it would answer. If a flip gives exactly the model's wrong answer, that decision explains it. "Wrong" becomes "misread Delivered 90 days ago or less?", by rule.

Try it · Which decision went wrong?Lab 16 · 02_compare.py, Exercise 3 · nano, 300 answers per form

For every wrong answer, the lab flips each decision on the case's path, one at a time, and asks the rules engine: does this flip give the model's answer? The number on each decision is how many wrong answers it explains (when several flips do, the deepest one gets the blame: a convention). "None" means no single flip gives that answer.

yesnoyesnoyesnoyesnoyesnoyesnoyesnoyesnoyesnoyesnoFinalsale?7Arriveddamaged?31Damaged ordefective?7≤ 90days?15Price> $200?19≤ 30days?35Member and≤ 60 days?17Opened?6Refund inlast 90 days?31Member?15REPLACE-MENTREFUSEREPLACE-MENTFULLREFUNDSTORECREDITSTORECREDITFULLREFUNDPARTIALREFUNDFULLREFUNDSTORECREDITREFUSE
Wrong answers
217 / 300
One flip explains
84%
None
34 (16%)
  1. 35 · Delivered 30 days ago or less?
  2. 31 · Arrived damaged?
  3. 31 · Refund in the last 90 days?
  4. 19 · Price over $200?

The picture has the most answers no single flip explains: answers off the path entirely.

For most wrong answers, one flip does it: 84% to 96% of them, depending on the form. The decisions blamed most are the day thresholds: 90 days for prose, JSON and own-box Mermaid; 30 days for shared-box Mermaid and the three picture forms. Next come "Arrived damaged?" against "Arrived damaged or defective?", two similar questions in different branches. The picture has the most wrong answers no single flip explains (34 of 217, 16%): answers off the path entirely.

It's a pointer, not proof. Often several flips fit: for case 107, "refuse" is what you get by calling it a final-sale item or by reading day 30 as over 30 days. The lab blames the deepest decision, a convention. Two wrong decisions that cancel out look like none. And a fitting flip says which decision would produce the answer, not what the model did: case 107's store-credit answers are "explained" by misreading Opened?, but the model may equally have applied the recent-refund rule to an unopened item. To confirm, ask the model for its path on a sample of wrong answers. Still, the attribution tells you where to look first: check the 30- and 90-day rules.

A stronger model

Is nano the whole story? The lab ran the main forms again on mini, once per case:

Form nano (first run) mini mini's 95% interval
Policy page (prose) 71% 80% 73–86%
JSON tree 57% 79% 71–84%
Mermaid text, own boxes 52% 53% 45–61%
Picture 25% 53% 45–61%
Mermaid text, shared boxes 44% 47% 39–55%

The nano column here is the first run alone, so the picture shows 25% instead of the 28% from both runs.

  • The prose lead over JSON disappeared. On nano it was 15 points. On mini, 15 cases were right only with prose and 13 only with JSON. McNemar's p = 0.851: the chance of a split at least this lopsided if the two forms were really equal. That's no detected difference, not proof they're equal. Part of the nano result was nano.
  • The picture doubled, 25% to 53%, level with own-box Mermaid and above the shared-box text (28 cases against 18, p = 0.184, not a clear gap). A stronger model reads pictures much better.
  • Shared-box Mermaid barely moved, 44% to 47%, and stayed 32–33 points behind prose and JSON: the one form that was poor on both models.

If you'd only run nano, you'd have told your team "use prose, not JSON". On mini, they're level. A ranking measured on one model is a fact about that model.

What a right answer costs

A cheap form that's often wrong isn't cheap. Divide what the answers cost by how many were right (nano's prices: $0.20 per million input tokens, $1.25 per million output tokens):

Form Tokens per case Cost per 1,000 answers Cost per 1,000 right answers
Policy page (prose) 327 $0.083 $0.116
JSON tree 566 $0.131 $0.233
Mermaid text, own boxes 513 $0.120 $0.230
Mermaid text, shared boxes 490 $0.115 $0.272
Picture, half size 767 $0.170 $0.527
Picture + Mermaid text 2,490 $0.515 $1.355
Picture 2,115 $0.440 $1.592

The picture costs 13.7 times as much as the prose per right answer, and on nano it was also the least accurate. The three picture forms were 72% of the nano bill.

When would you still send an image? When the picture is the only source and nobody can write out the text, or when what matters is visual (a layout, the shape of a chart). If you must, the half-size version scored about the same as the full one for a third of the cost per right answer.

What to do

  1. Paste the text the flowchart was drawn from, not the picture, and test it. On this small model, the plain policy page was the most accurate form and the cheapest per right answer.
  2. Make the right answer exact. Keep the rules in one source and generate the forms from it, or check hand-written forms against it.
  3. Spread test cases over every path, and put some next to each threshold. Report accuracy by depth, not just overall.
  4. Compare forms on the same cases, case by case, with more than one run each.
  5. Trace wrong answers to decisions with single flips, then read those answers before rewriting the rule.
  6. Test the way your team actually draws diagrams: shared boxes, ids, layout are each a variable.
  7. Check on a second model before you tell anyone which form is best, and compare cost per right answer, not per call.

Caveats

  • Made-up policy, real answers. The rules and the 150 cases are invented, so the right answers are known exactly; each answer is a real model run, with reasoning turned off. A real policy has ambiguous wording a rules engine wouldn't, and reasoning might close some of the gaps (the lab suggests trying it).
  • The prose had an advantage nobody measured. Its author knew the tree and grouped the paragraphs by its branches. Prose written by someone else might not win; that's one of the lab's exercise ideas.
  • A ranking of forms, not of models' abilities in general. One policy, one flowchart drawing, one prompt. The picture was drawn by the lab's code; a whiteboard photo or a screenshot would likely do worse.
  • Overall accuracy is over paths, not traffic. Each of the 11 paths has about the same number of cases; real traffic doesn't. And two of the 150 cases (numbers 43 and 112) happen to have identical facts, so they got identical prompts and the same recorded answers: the run has 149 distinct cases.
  • Boundary cases. The lab flags 53 cases as boundary, and their days are drawn from 29–31, 59–61 and 89–91, with $199–$201 for some of the prices. Only 23 of them sit exactly on 30, 60 or 90 days or $200, where "is the limit itself included?" actually decides the answer.
  • Attribution is a convention. The deepest of several fitting flips gets the blame, so the "most-blamed decisions" are a pointer to which answers to read, not a measurement.

The checklist

  1. Why generate the JSON, Mermaid and picture forms from one rule tree instead of writing each by hand?
  2. Why spread the 150 cases over the tree's paths instead of drawing them at random?
  3. Prose beat JSON by 15 points on nano and tied it on mini. What do you tell your team?
  4. How does tracing an error to one flipped decision work, and what are its limits?
  5. The picture cost 13.7 times as much per right answer as the prose. When would you still send an image?
  6. Shared outcome boxes in the Mermaid text cost about 10 points. What does that say about testing "diagrams"?
  7. Asking the same form twice changed up to 47 of 150 verdicts. What does that mean for comparing forms?

Practice: test the form of a policy

Write Lab 16's offline math: walk the rule tree (path, depth and the engine's answer, optionally with one decision flipped), find the flips that explain a wrong answer and blame the deepest, read the model's answer the way the lab does, and the comparison numbers: Wilson interval, exact McNemar p-value, paired difference, A/A flips and cost per right answer. The tests use the lab's recorded data: the 150 cases and every one of nano's 2,100 answers. Case 107's 30 and 31 days, 13–14 cases per path, the blame counts (34 off-path answers for the picture), 214 of 300 for prose, +15.3 and +9.7 points, 22 and 47 A/A flips, p = 0.851, and $0.116 against $1.592.

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

Quiz

Try it · Check your understanding0 of 6 answered
  1. 1.The same refund policy, the same 150 cases, the same small model. Which form did the model apply most accurately?

  2. 2.Why are the JSON, Mermaid and picture forms generated from one rule tree instead of written by hand?

  3. 3.The same flowchart as Mermaid text, written two ways: every outcome in its own box, or one shared box per outcome that many arrows point to. What happened on the small model?

  4. 4.A case's right answer is a full refund; the model said store credit. Flipping "Opened?" from no to yes makes the rules engine say store credit. What can you conclude?

  5. 5.On the small model, prose beat JSON by 15 points. On the bigger model, 15 cases were right only with prose and 13 only with JSON (p = 0.851). What do you tell your team?

  6. 6.On the small model, the full picture cost $0.440 per 1,000 answers and was right 28% of the time; the prose cost $0.083 and was right 71% of the time. Why compare cost per right answer?

Check your understanding

Try each question before opening its answer.

Why generate the JSON, Mermaid and picture forms from one rule tree instead of writing each by hand?

Because the comparison only means something if every form says the same thing. If one form had a mistake, "form A is worse" might just mean "form A is wrong". Generated forms agree with the rules engine by construction, and a test proves it for the JSON (3,000 random cases, answered from its question text alone). The policy page is hand-written on purpose, because real ones are, so it gets a weaker check: every threshold and outcome appears in it.

Why spread the 150 cases over the tree's paths instead of drawing them at random?

Random cases land where the rules are broad, like "final sale, not damaged: refuse", and the deep paths would get a handful of cases each. With 13 or 14 cases on each of the 11 paths, accuracy by depth has enough cases behind it. The catch: the overall accuracy is then an average over paths, not over your traffic, so reweight by how often each path really happens before quoting one number.

Prose beat JSON by 15 points on nano and tied it on mini. What do you tell your team?

That the best form depends on the model: test the form you'll actually send on the model you'll actually use. On nano, prose was clearly better (+15.3 points, range +9.3 to +21.3). On mini, 15 cases were right only with prose and 13 only with JSON (p = 0.851): no detected difference. What held on both: Mermaid with shared boxes was poor, and the picture cost the most per right answer.

How does tracing an error to one flipped decision work, and what are its limits?

For a wrong answer, rerun the rules engine once per decision on the case's path, each time flipping just that decision. If a flip gives the model's answer, that decision is a candidate for what the model misread. It's free and explained 84–96% of wrong answers. Limits: several flips can fit (the lab blames the deepest, a convention), two wrong decisions that cancel look like none, and a fitting flip says what would produce the answer, not what the model did. Confirm by asking the model for its path on a sample.

The picture cost 13.7 times as much per right answer as the prose. When would you still send an image?

When the picture is the only source and nobody can write out the text, or when what matters is visual, like a layout or the shape of a chart. For rules that exist as text somewhere, send the text. If you must send the picture, the half-size one scored about the same and cost 2.6× less per answer. On mini the picture reached 53%, so a stronger model narrows the accuracy gap, but not the cost.

Shared outcome boxes in the Mermaid text cost about 10 points. What does that say about testing "diagrams"?

That there's no single "diagram" result. The same flowchart, written so the model has to look up what a short id like L1 means, scored 9.7 points lower (+1.7 to +17.3) than with every outcome written in place; on mini, 14 cases against 4. Node order, ids against labels, layout and edge wording are each a variable until measured. Test the way your team draws it.

Asking the same form twice changed up to 47 of 150 verdicts. What does that mean for comparing forms?

That one run of 150 cases carries a lot of noise: for shared-box Mermaid almost a third of the verdicts changed between two runs. Two forms compared on one run each could differ by several points by chance. So the lab takes two runs, averages them per case, and compares forms case by case with a bootstrap range. Setting temperature to 0 would hide the variation, not remove it from the deployed system.

Next up: When your eval set is wrong (coming soon). Every chapter so far trusted the test cases' right answers; next, what happens when some of them are wrong.

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.