ealeng

Episode 11 of 15 · When the number lies

Is your synthetic test data realistic?

A simulated summarizer passes 86.2% of 400 model-written support tickets and 70.5% of 400 "real" ones. How to check synthetic test data before trusting a score on it: read it, then measure what you noticed; run a classifier two-sample test against a shuffled-label baseline, not against 50% (real vs real scored 44.2%, inside chance's 41–59%); and see how a better, grid-based generator hides two errors that cancel. It scores just 2.2 points below real, yet is about 4 points too easy once reweighted to the real mix (known in the simulation). Finally, a rule per group: measure, find failures, or a coverage gap. Everything is simulated, including the "real" tickets.

Lab 12 · Is Your Synthetic Data Realistic?15 min read
Video transcript7:16

0:00Cold open

0:01

Before launch, I had no real tickets. So I had a model write four hundred, to test our summarizer.

0:08

It got eighty-six percent of them right. I was ready to ship.

0:12

Then I ran it on four hundred real tickets.

0:15

Seventy and a half percent.

0:19

Same summarizer. Almost sixteen points lower.

0:24

So how can you tell if your test data looks real? And when can you trust a score measured on it?

0:30Intro

0:32

Hands-on AI evals: when the number lies, part one. Today: is your synthetic test data realistic?

0:40Meet Maya

0:41

I’m Maya, an ML engineer. Our summarizer turns each support ticket into a short summary for the agent.

0:49

Synthetic data means test cases written by a model, instead of by real users. Before launch, it’s often all you have.

0:57

Everything here is simulated: three sets of four hundred tickets, and the summarizer. The real set stands in for real customers.

1:06

I also set what makes a ticket hard for it: more issues, an angry customer, no order number, typos, or Spanish. The scores are what comes out.

1:1801 · Look first

1:19

Before measuring anything, read a few tickets from each set.

1:23

Real ones are messy. Typos, lowercase, three problems in one message, an angry customer, no order number. Some are in Spanish.

1:32

The model-written ones are polite and clean. Here, one problem each, and an order number.

1:38

Now measure what you noticed, over all four hundred. Model-written tickets are longer.

1:44

And they use about seven times as many pleases and thank-yous.

1:48

More than ninety-five percent have an order number. Real ones: about half.

1:53

And they repeat themselves: they all open in just two ways.

1:58

It’s like a driving test on an empty practice track. No traffic, no rain. Clean, one-problem tickets are exactly the easy ones for my summarizer. Passing says little about rush hour.

2:1202 · Can a classifier tell?

2:13

But I want one number for how different two sets look.

2:17

So I train a classifier: a small model that learns to sort tickets into two piles, real or model-written. It looks at the same things I just measured.

2:27

Then I test it on tickets it never saw. If the sets look alike, it can only guess: about half right. If they’re different, it gets almost all.

2:36

So, how often do you think it sorts these right?

2:42

Ninety-nine point nine percent. It almost never misses. Politeness and length give them away.

2:49

A sanity check: two random halves of the real tickets. Nothing to learn here.

2:54

Forty-four percent. Worse than a coin flip?

2:59

Not really. With nothing to learn, the score just wobbles. To see how much, I shuffle the labels at random, and rerun the test a hundred times.

3:09

That’s the baseline: what pure chance scores. Here, chance alone scored anywhere from forty-one to fifty-nine percent.

3:17

So forty-four is just chance. Compare with chance’s whole range, not with exactly fifty percent.

3:2503 · A better generator

3:26

So I built a better generator. I gave the model a grid of ticket types: mood, number of issues, and channel, chat or email.

3:35

Every combination, about equally often: calm and angry, one issue and three.

3:41

Can the classifier still tell? Yes. About seventy percent, far outside what chance scores.

3:48

What gives them away: almost no typos, too many issues per ticket, and too many order numbers.

3:54

And the summarizer? It passes sixty-eight percent of these tickets.

3:59

That’s about two points below the real ones. So this set is realistic, maybe even a bit harder. Right?

4:0804 · Two errors that cancel

4:10

Not quite. Two errors are cancelling each other out.

4:13

First, the mix. Most real tickets have one issue. My grid made a third of them three-issue tickets, the hardest kind: more than twice their real share. That pulls the score down.

4:25

Second, each ticket. Tickets with the same number of issues, I’ll call a group.

4:30

In my simulation, I know how likely every ticket is to pass. In every group, the grid’s tickets are easier than real ones.

4:39

They’re cleaner: fewer typos, more order numbers, and none in Spanish.

4:44

Would the measured scores have shown this? No. From a few hundred tickets per group, each measured gap is too noisy to tell from zero.

4:52

So fix the mix. Reweighting counts each kind of ticket by its share of real traffic. I covered it in my video on eval dataset bias.

5:02

Reweighted, the grid’s tickets look too easy: a true pass rate of seventy-nine percent, against seventy-five for real ones.

5:11

The measured scores point the same way, about four points. But with four hundred tickets, even that is inside the noise.

5:2005 · A rule per group

5:21

So, can I use these synthetic tickets at all? Group by group.

5:26

I ask two questions. Does it look real? I run the classifier test inside the group. And does it score like real tickets? Here I know the true answer. You won’t, so read these as what the rule would say.

5:39

One-issue tickets pass both. The classifier barely beats chance, and the scores are within three points. I can use them to measure.

5:48

Chance here is sixty-two percent: there are more real tickets, so always guessing real gets most right.

5:54

Two-issue tickets look different, but score close. Use them to find failures, where the summary goes wrong, and measure on real tickets.

6:03

Three-issue tickets score six and a half points too high. Find failures only. Their pass rate misleads.

6:10

And one more kind of ticket: Spanish. Real customers sent twenty. My generator wrote none: I never asked for one. That’s a coverage gap: a kind of ticket the test set doesn’t have.

6:23

In practice, a gap of a few points needs far more graded real tickets than I have. The classifier test is cheaper: it needs only some real tickets’ text, sorted into the same groups.

6:3606 · What I do now

6:38

Now I read samples from both sets first, and measure what I notice.

6:43

I run the classifier test, and compare it with shuffled labels, not with fifty percent.

6:49

I compare scores reweighted to the real mix, and group by group only when I have enough real tickets. And I look for kinds of ticket the generator never made.

6:59

Next time: I tune a prompt against an AI judge. Its score keeps climbing. Are the summaries getting better?Maya: Check the track against the road.

7:07Summary

7:08

Synthetic tickets are a practice track. Measure how far they are from the road.Maya: Thanks for watching!

Key takeaways

  • ✓Synthetic test data, test cases written by a model instead of by users, is often all you have before launch, and it's usually easier than the real thing. On the same simulated summarizer: 86.2% on 400 model-written tickets, 70.5% on 400 real ones, 15.8 points apart (Newcombe range +10.1 to +21.3).
  • ✓Read samples from both sets first, then measure what you noticed. The plain model-written tickets were longer (32 words against 20), said please or thank you about 7× as often, had an order number 95.5% of the time against 54.8%, opened in only 2 different ways (real: 220), and every one had a near-twin in the set. None had a typo or was in Spanish.
  • ✓The classifier two-sample test puts one number on how different two sets look: train a small classifier to tell them apart and score it on tickets it never saw. Real against plain model-written: 99.9%. Its weights say what gives the synthetic tickets away (politeness, length).
  • ✓Compare that accuracy with a shuffled-label baseline, not with 50%. Two halves of the real tickets scored 44.2%, which looks worse than a coin flip, but 100 runs with shuffled labels scored 41% to 59%: it's just chance. When the two sets differ in size, chance sits higher: 62% for one-issue tickets, where always guessing "real" gets 63.1% right.
  • ✓Two errors can cancel. A grid generator (every mood × number of issues × channel about equally often) scored 68.2%, 2.2 points below real, so it looked realistic, or even harder. But a third of its tickets had three issues against 15.5% of real ones (a mix that's too hard), and in every group each ticket was cleaner and easier (+2.0, +3.1, +6.5 points, known in the simulation). Reweighted to the real mix: 79.4% against 75.1%, about 4 points too optimistic.
  • ✓Score gaps of a few points are invisible with a few hundred tickets: every measured per-group gap's range included zero, and the reweighted gap (+4.2 measured) has a likely range of −2 to +10. The classifier test spots the difference from the text alone, so test realism directly instead of waiting for the scores to disagree.
  • ✓Decide per group, not for the whole set: use it to measure (one-issue tickets), use it to find failures and measure on real tickets (two issues), find failures only (three issues, 6.5 points too easy), or a coverage gap, a kind of ticket the set doesn't have (20 real Spanish tickets, 0 synthetic).

Before launch, there were no real support tickets, so a model wrote 400 of them to test a summarizer. It got 86.2% right. Then it ran on 400 real tickets: 70.5%. Same summarizer, almost 16 points lower. This chapter is about checking synthetic test data before you trust a score measured on it: how to see that it doesn't look real, how to put a number on that, why a better generator can still mislead you, and for which kinds of ticket synthetic data is still worth using.

The examples come from Lab 12 (Is Your Synthetic Data Realistic?) of the eval labs, all four of its scripts: 01_features.py (read the tickets, then measure them), 02_c2st.py (can a classifier tell real from synthetic?), 03_score_gap.py (does the summarizer score differently on them, overall, per group and reweighted?) and 04_usage_rule.py (what to use synthetic tickets for, group by group), with the math in the lab's evalkit/realism.py. No API is needed. The lab's "exercises to try on your own" (changing the generator, embeddings through a paid API, your own data) aren't covered. Everything here is simulated, including the "real" tickets, which stand in for real customer traffic. The lab also sets what makes a ticket hard for the summarizer, so in this world we know each ticket's true chance of a correct summary. You never know that in real life, and the chapter says "known in the simulation" every time it uses one. The pass rates, classifier accuracies and gaps are measured.

The setup

Synthetic data means test cases written by a model, not by real users. The summarizer turns each support ticket into a short summary for the support agent; a summary is right or wrong. The lab has three sets of 400 tickets:

Set How it's made
Real stands in for real customer traffic: typos, lowercase chat messages, several problems in one ticket, angry customers, missing order numbers, 5% in Spanish
Plain model-written what a model writes when asked for "a realistic support ticket"
Grid generator a model given a grid of ticket types: mood (calm, frustrated, angry) × number of issues (1, 2, 3) × channel (chat, email), every one of the 18 combinations about equally often (22 or 23 tickets each)

What makes a ticket hard is the lab's own rule: each extra issue, an angry or frustrated customer, a missing order number, each typo (up to four) and Spanish lower the chance of a correct summary. The easiest ticket (calm, one issue, an order number, no typos) is summarized correctly 90% of the time; an angry three-issue chat message with a typo and no order number, 37%. The realism checks below never see that rule or the tickets' hidden labels: they use only the text.

Look first, then measure

Before measuring anything, read a few tickets from each set. Real ones are messy: "yo can I swap the Ridge Softshell for a medium. Also how do I get a refund on the Ridge Softshell. Also tracknig says in transit since forever…" The model-written ones are polite and clean: "Hello, I recently purchased a Hiker Socks from your store. Unfortunately, I want a refund for the Hiker Socks. Order #58290. Could you please help me? Thank you in advance."

It's like a driving test on an empty practice track: no traffic, no rain. Clean, one-problem tickets are exactly the easy ones for this summarizer, so passing says little about rush hour. The widget draws each ticket as a stretch of road from what it contains.

Try it · The practice track and the roadLab 12 · 01_features.py, 03_score_gap.py · simulated tickets

A driving test on an empty practice track says little about rush hour. Each tile is one ticket, drawn from what it contains: cars for extra issues (traffic), drops for typos (rain), a bolt for an angry customer, #? for a missing order number, ES for Spanish. Under each tile: did the simulated summarizer get it right? These are the first 40 tickets of each file, in order (not picked). Click a tile to read the ticket.

extra issue typoϟ angry#? no order numberES Spanish✓/✗ summary judged correct / wrong

Ticket 1 of 40 · real tickets

quiero un reembolso, el producto llegó roto

(I want a refund, the product arrived broken)

1 issue · calm · email · no order number · no typos · Spanish · summary judged correct

All 400 tickets of each set: how many have each trait

tickets that…Real ticketsPlain model-writtenGrid generator
has a typo114 (28.5%)0 (0.0%)37 (9.2%)
no order number in the text181 (45.2%)18 (4.5%)70 (17.5%)
more than one issue171 (42.8%)40 (10.0%)266 (66.5%)
angry customer83 (20.8%)0 (0.0%)132 (33.0%)
in Spanish20 (5.0%)0 (0.0%)0 (0.0%)
summary judged correct282 (70.5%)345 (86.2%)273 (68.2%)
Pass rate (400)
70.5%
95% interval
66–75%
Gap vs real
—

The road: typos, several problems at once, angry customers, missing order numbers, some Spanish. The same summarizer passes 70.5%.

Then measure what you noticed, over all 400 tickets of each set (Script 1). These are averages per ticket, computed from the text alone:

Feature Real Plain model-written Grid
Words 20.25 32.13 24.69
Has an order number 0.55 0.95 0.82
Please / thank you 0.27 2.00 0.33
Issues in one ticket (1 + each "also") 1.53 1.10 1.99
Misspelled-looking words (share of words) 0.06 0.00 0.00

Model-written tickets are longer and say please or thank you about 7× as often (every one of them does; 26% of real ones). 382 of 400 have an order number (95.5%); real ones, 219 (54.8%). 360 have one issue and 40 have two. They also repeat themselves: they open in only 2 different ways (real tickets: 220), and every one has a near-twin, another ticket in the set sharing at least 60% of its words (real: 125 of 400). Script 1 reports the near-twins as a "near-duplicates" share: 21% real, 100% plain, 52% grid; the caveats explain why this chapter counts them differently. None of the 400 is in Spanish (real: 20), and none has a typo; the grid's misspelled-looking share rounds to 0.00, but it's 0.4% of words, and 37 of its tickets have a typo.

The "misspelled-looking words" feature counts words that aren't in the generator's own vocabulary, which here means typos. A feature is an approximation: one real ticket has three issues but counts two, because a typo turned one "also" into "aslo".

Can a classifier tell?

A table of features is a start, but you want one number for how different two sets look. The classifier two-sample test (the lab calls it C2ST) gives one. Train a classifier, a small model that learns to sort tickets into two piles, real or model-written, from the features above. Then test it on tickets it never saw (the lab uses 5-fold cross-validation: train on four fifths, test on the last fifth, five times over). If the sets look alike, it can only guess: about half right. If they're different, it gets almost all of them.

Comparison (Script 2) Sorted right Shuffled-label baseline Margin p
Real vs real (two random halves, a sanity check) 44.2% 50.0% −5.8 points 0.97
Real vs plain model-written 99.9% 50.2% +49.7 0.01
Real vs grid 69.8% 49.9% +19.9 0.01

Real against model-written: 99.9%. It almost never misses. The classifier's largest weights say what gives them away: politeness and length.

Then the sanity check: two random halves of the real tickets, where there's nothing to learn. 44.2%. Worse than a coin flip? Not really. With nothing to learn, the score just wobbles. To see how much, the lab shuffles the labels at random, so "real" and "synthetic" mean nothing, and reruns the test 100 times. That's the shuffled-label baseline: what pure chance scores with your data and your classifier. Here chance alone scored anywhere from 41% to 59%, and 3 of the 100 shuffles scored lower than 44.2%. So 44.2% is just chance. The margin is the accuracy minus the shuffles' average; the p-value is the share of shuffles that did at least as well as the real labels (with one added on top and bottom, so 100 shuffles can't give less than 1 ÷ 101 = 0.01).

Try it · Can a classifier tell them apart?Lab 12 · 02_c2st.py · 100 shuffled-label runs per test

A small classifier learns to sort tickets into real and model-written from the features measured above, and is scored on tickets it never saw. Grey bars: the same test rerun 100 times with the labels shuffled at random, so there is nothing to learn. That spread is what chance scores. The line is the real result.

Whole sets:
Grid, one group at a time:
40%50%60%70%80%90%100%50%44.2%
Accuracy
44.2%
Chance's range
41–59%
Shuffles ≥ it
97 / 100
Margin
−5.8 pts

Inside chance's range: the classifier can't tell these two sets apart. (Both halves are real tickets, so that's the right answer.)

200 real vs 200 real tickets. Margin = accuracy − the shuffles' average (50.0%). p = (1 + shuffles at or above it) ÷ 101 = 0.97.

Gives it away: exclamation marks (more in synthetic), non-English words (more in real), misspelled-looking words (more in synthetic). With nothing to learn, these are noise.

There's a second reason not to compare with 50%, which shows up when the two sets differ in size. Within the one-issue group there are 229 real tickets and 134 grid-made ones, so always guessing "real" already gets 63.1% right. Chance there scores about 62%, and a 65.6% accuracy is barely above it. The shuffled baseline handles both cases. Compare with chance's whole range, not with exactly 50%.

A better generator

So the lab built a better generator: the grid. Every combination of mood, number of issues and channel, about equally often: calm and angry, one issue and three. Can the classifier still tell? Yes: 69.8%, far outside the 43–55% that its shuffles scored. What gives the grid away: almost no typos, too many issues per ticket, and too many order numbers.

And the summarizer passes 68.2% of the grid's tickets (273 of 400), 2.2 points below the real ones. So the grid set is realistic, maybe even a bit harder. Right?

Two errors that cancel

Not quite. Two errors are cancelling each other out.

Error 1, the mix. 57% of real tickets have one issue. The grid made a third of its tickets three-issue tickets, the hardest kind, against 15.5% of real ones: more than twice their real share. That pulls its overall score down.

Error 2, each ticket. Call the tickets with the same number of issues a group (the lab says stratum, as in Chapter 3's stratified sampling). In this simulation we know how likely every ticket is to pass, and in every group the grid's tickets are easier than real ones:

Group Real tickets Grid tickets True gap, grid − real (known in the simulation) Measured gap (95% range)
1 issue 229 134 +2.0 points +2.4 (−6.9 to +10.9)
2 issues 109 134 +3.1 −1.1 (−12.5 to +10.6)
3 issues 62 132 +6.5 +6.0 (−8.7 to +20.6)

They're cleaner. In every group the grid has more order numbers (82–83% against 53–64%) and fewer tickets with typos (7–14% against 19–42%), and none is in Spanish. (It also has more angry customers, which makes it harder, but not enough to make up for the rest.) Without the 20 Spanish tickets, the true gaps are still +1.1, +2.2 and +5.4.

Would the measured scores have shown this? No. The last column is what you'd actually see, each with Newcombe's range for a difference measured on different tickets (the one Chapter 1 uses). From a few hundred tickets per group, every range includes zero, and the two-issue one even points the wrong way.

So fix the mix. Reweighting counts each kind of ticket by its share of real traffic, the weighted score from Chapter 3. Script 3 uses nine kinds of ticket, every number of issues × mood, and the grid covers all nine.

Try it · Two errors that cancelLab 12 · 03_score_gap.py · true rates known only in the simulation

Error 1 · the mix: how many issues per ticket

Real
57.2%
27.3%
15.5%
Grid
33.5%
33.5%
33.0%

Fainter to stronger: one, two, three issues. The grid makes every combination about equally often, so 33% of its tickets have three issues, the hardest kind, against 15.5% of real ones. That pulls its overall score down.

Error 2 · each ticket: pass rate per group (tickets with the same number of issues)

1 issue · real 229, grid 134

grid easier by +2.0 pts

2 issues · real 109, grid 134

grid easier by +3.1 pts

3 issues · real 62, grid 132

grid easier by +6.5 pts

Blue: real tickets; violet: the grid's. In every group the grid's tickets are easier than real ones: fewer typos, more order numbers, no Spanish. Bars start at 40%.

Fix the mix: reweight the grid to real traffic (issues × mood, as Script 3)

weight · grid true ratecalmfrustratedangry
1 issue11.5% · 89%11.0% · 86%11.0% · 81%
2 issues11.5% · 80%11.0% · 75%11.0% · 68%
3 issues11.0% · 65%11.0% · 60%11.0% · 52%

Weight = the cell's share of the grid's 400 tickets. Overall = Σ weight × the cell's pass rate.

Grid, true
72.9%
Real, true
75.1%
Grid, measured
68.2%
Real, measured
70.5%

As generated, the grid looks 2.2 points harder than real (true; measured −2.2): "realistic, maybe even a bit harder". That's the two errors cancelling.

Estimate (Script 3) Measured True (known in the simulation)
Real tickets 70.5% 75.1%
Grid, as generated 68.2% 72.9%
Grid, reweighted to the real mix 74.7% 79.4%

Reweighted, the grid's tickets look too easy: a true pass rate of 79.4% against 75.1% for real ones, about 4 points too optimistic (+4.3). Without the Spanish tickets real is 76.1%, still 3.3 points below. The measured scores point the same way, +4.2 points. But with 400 tickets per set, even that is inside the noise: resampling both sets (a bootstrap, as in Chapter 1; the video's calculation, not the lab's) gives a likely range of −2.0 to +10.5 points.

Reweighting fixes error 1. It can't fix error 2: the only fix for tickets that are too clean is a better generator or real tickets.

A rule per group

So can these synthetic tickets be used at all? Group by group. Script 4 asks two questions of each group:

  1. Does it look real? Run the classifier test inside the group. Looks real = less than 5 points above its shuffled baseline.
  2. Does it score like real tickets? The pass-rate gap: under 3 points → use it to measure; under 5 → use it to find failures (tickets where the summary goes wrong, to study what kinds of failure there are, as in Chapter 4) and measure on real tickets; 5 or more → find failures only, because its pass rate misleads.
Kind of ticket Real Grid Classifier margin Score gap (known in the simulation) Rule
1 issue 229 134 +3.5 points +2.0 use it to measure
2 issues 109 134 +16.6 +3.1 find failures; measure on real tickets
3 issues 62 132 +6.1 +6.5 find failures only
Spanish 20 0 — — a coverage gap

One-issue tickets pass both: the classifier barely beats chance (which here is 62%, because there are more real tickets), and the scores are within 3 points. Two-issue tickets look different but score close. Three-issue tickets score 6.5 points too high. And Spanish: real customers sent 20, the generator wrote none, because nobody asked for one. That's a coverage gap: a kind of ticket the test set doesn't have. There's nothing to judge; generate or collect some.

Read that table carefully: its score gaps are the true ones, which only a simulation knows. You won't, and with these sample sizes the measured gaps can't tell 2 points from 6 (the previous section). In practice, a gap of a few points needs far more graded real tickets than you'll have. The classifier test is cheaper: it needs only some real tickets' text, sorted into the same groups, no grading.

What to do

  1. Read samples from both sets first, side by side, and measure what you notice: length, politeness, order numbers, typos, issues per ticket, language, how often tickets repeat.
  2. Run the classifier test, and compare it with a shuffled-label baseline, not with 50%. Its top features are a to-do list for the generator.
  3. Don't trust an overall gap near zero. Compare scores reweighted to the real mix, and group by group only when you have enough real tickets to measure each group.
  4. Look for kinds of ticket the generator never made (a language, a channel, a product) and fill the gaps.
  5. Decide per group what synthetic data is for: measuring, finding failures, or neither. Keep a real sample, even a small one, to check against.

Caveats

  • It's a simulation. The three ticket sets and the summarizer's rule are made up so that the truth is known. Real generators and real traffic differ in other ways, and the numbers here show the method, not facts about any model.
  • The usage rule uses the true score gap. Script 4 decides from each group's true pass-rate gap (the lab's pass_probability, known only in a simulation). Measured from the same tickets, every group's range includes zero, so the rule's "gap under 3 points" can't be checked in practice with a few hundred tickets. Script 4 also prints mood and channel groups (calm, angry, chat, email…); inside each of those the grid still has its wrong issue mix, so their small gaps (−2.4 to +0.6 points) are the same cancellation as above, not realism. This chapter shows only the issue groups and Spanish.
  • The three sets share their luck. The lab grades every set with the same random seed, so all three measured pass rates came out below their true ones together (70.5 vs 75.1, 86.2 vs 88.3, 68.2 vs 72.9). The gaps between sets are less noisy than two independent runs would be, which Newcombe's range doesn't assume.
  • The classifier sees only hand-picked features. Its give-aways are readable, but it can only notice what the features measure. A classifier on embeddings would catch subtler differences and say less about what to fix.
  • Two ways to count near-twins. Script 1's "near-duplicates" share counts the extra copies beyond the first in each group of near-twins, where pairs chain into groups (real: 84 extra copies = 21%, while 125 tickets = 31% have a twin). The plain set's 100% is one chained group of all 400, 399 extra copies (99.75%). This chapter counts tickets with a near-twin instead.

The checklist

  1. Why can a system score higher on synthetic data than on real data?
  2. What is a classifier two-sample test, and how do you read its result?
  3. Why compare its accuracy with a shuffled-label baseline instead of 50%?
  4. Why can an overall score gap near zero be misleading?
  5. Why might the scores not reveal a realism problem that the classifier test catches?
  6. When is synthetic data fine to use, and for what?

Practice: check a synthetic test set

Write Lab 12's math: a few of its text features, word overlap for near-twins, the simulated summarizer's rule, the two baselines (always guessing the bigger set, and the p-value from shuffled runs), Wilson and Newcombe ranges, reweighting to the real mix, and the usage rule. The tests use the lab's recorded numbers: the 100 shuffled real-vs-real accuracies (41–59%, p 0.97), 63.1% for always guessing "real", +10.1 to +21.3 for the plain set's gap, per-group ranges that all include zero, 74.7% measured and 79.4% true after reweighting, and the rule's verdicts per group.

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

Quiz

Try it · Check your understanding0 of 6 answered
  1. 1.A summarizer passes 86.2% of 400 model-written test tickets and 70.5% of 400 real ones. What's the most likely reason?

  2. 2.A classifier sorting two random halves of the real tickets gets 44.2% right on tickets it never saw. What does that mean?

  3. 3.Within one-issue tickets there are 229 real and 134 grid-made ones. The classifier scores 65.6%. Is that clear evidence the sets differ a lot?

  4. 4.A grid generator's tickets score 68.2% against 70.5% for real ones. Why isn't that good news?

  5. 5.In the simulation, the grid's three-issue tickets are 6.5 points easier than real ones. Measured on 62 real and 132 grid tickets, the gap is +6.0, with a range of −8.7 to +20.6. What does that show?

  6. 6.Real customers sent 20 Spanish tickets; the generator wrote none. What does Lab 12's rule say about Spanish tickets?

Check your understanding

Try each question before opening its answer.

Why can a system score higher on synthetic data than on real data?

Because generated test cases are usually easier than real ones. Asked for "a realistic support ticket", the model wrote polite, clean, one-problem tickets with an order number; real customers send typos, several problems at once, no order number, sometimes Spanish. On the same simulated summarizer: 86.2% against 70.5%. Even the grid generator's tickets were easier than real ones in every group, because it reproduced the dimensions it was given and missed the ones nobody asked for.

What is a classifier two-sample test, and how do you read its result?

Train a small classifier to tell real tickets from synthetic ones, and score it on tickets it never saw. Near chance means the sets look alike; near 100% means they're obviously different. Its largest weights say what gives the synthetic data away. Real against plain model-written: 99.9% (politeness, length); against the grid: 69.8% (few typos, too many issues, too many order numbers).

Why compare its accuracy with a shuffled-label baseline instead of 50%?

Because chance isn't exactly 50%. With nothing to learn, two halves of the real tickets scored 44.2%, while 100 shuffled-label runs scored anywhere from 41% to 59%: 44.2% is just chance. And with unequal sets, chance sits near the bigger set's share: 62% for one-issue tickets (always guessing "real": 63.1%), so 65.6% is only 3.5 points above it.

Why can an overall score gap near zero be misleading?

Because a synthetic set can be wrong in two opposite ways at once. The grid had too many hard three-issue tickets (a third against 15.5%), which pulled its score down, and each ticket was cleaner than a real one, which pushed every group's score up. Overall it came out 2.2 points below real; reweighted to the real mix it's about 4 points too easy (79.4% against 75.1%, known in the simulation).

Why might the scores not reveal a realism problem that the classifier test catches?

Because score gaps of a few points are small and noisy, while style differences are large and consistent. Every measured per-group gap's range included zero (the two-issue one was even −1.1 against a true +3.1), and the reweighted gap's likely range runs from −2 to +10 points. The classifier test separated the sets in every group from the text alone, and it needs no graded tickets.

When is synthetic data fine to use, and for what?

Decide per group with two questions: does it look real (the classifier margin over the shuffled baseline), and does it score like real tickets? Both: use it to measure (one-issue tickets). Looks different but scores close: use it to find failures, and measure on real tickets (two issues). Scores differently: find failures only (three issues, 6.5 points too easy). Never generated: a coverage gap to fill (Spanish). Keep in mind the score gaps here are known only because it's a simulation.

Next up: When the metric stops measuring quality. Tune a prompt round after round against an AI judge, and the judge's score keeps climbing. Are the summaries actually getting better?

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.