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?
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
The tree is wide: scroll it sideways.
The engine's path · depth 4 · right answer: full refund
- Final-sale item? no
- Arrived damaged or defective? no
- Delivered 30 days ago or less? yes
- Opened? no
What the model answered for this case (14 of 14 nano answers wrong)
| form | nano, run 1 | nano, run 2 | mini |
|---|---|---|---|
| Prose | |||
| JSON | |||
| Mermaid (shared) | |||
| Mermaid (own) | |||
| Picture | |||
| Half-size picture | not run | ||
| Picture + Mermaid | not 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?
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.
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.
- 35 · Delivered 30 days ago or less?
- 31 · Arrived damaged?
- 31 · Refund in the last 90 days?
- 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
- 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.
- Make the right answer exact. Keep the rules in one source and generate the forms from it, or check hand-written forms against it.
- Spread test cases over every path, and put some next to each threshold. Report accuracy by depth, not just overall.
- Compare forms on the same cases, case by case, with more than one run each.
- Trace wrong answers to decisions with single flips, then read those answers before rewriting the rule.
- Test the way your team actually draws diagrams: shared boxes, ids, layout are each a variable.
- 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
- Why generate the JSON, Mermaid and picture forms from one rule tree instead of writing each by hand?
- Why spread the 150 cases over the tree's paths instead of drawing them at random?
- Prose beat JSON by 15 points on nano and tied it on mini. What do you tell your team?
- How does tracing an error to one flipped decision work, and what are its limits?
- The picture cost 13.7 times as much per right answer as the prose. When would you still send an image?
- Shared outcome boxes in the Mermaid text cost about 10 points. What does that say about testing "diagrams"?
- 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.
Quiz
1.The same refund policy, the same 150 cases, the same small model. Which form did the model apply most accurately?
2.Why are the JSON, Mermaid and picture forms generated from one rule tree instead of written by hand?
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.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.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.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.