# Synthetic against real: design

Written and committed before any synthetic copy was generated or scored. Anything decided later is labelled on the page.

## Question

If a team tests AI SQL on a high-scoring synthetic copy instead of the real table, how many answers that are wrong on the real table pass on the copy, how many right answers fail, does the model comparison hold, and does the fidelity score warn when it does not?

No published page answers this. A search of the site's pages found only one hit for the idea, a clean copy used to replay pipeline breaks, which is a different question. The round re-scores stored answers from this study; it asks a new question of them and changes no published figure.

## What was seen before this design

The census below re-executes every recorded answer on the real table, so the author knew which answers are wrong on real and on which questions before writing the predictions. No synthetic copy existed then.

## Census of stored SQL

`synthetic/census.py` read every recorded Chicago answer on an analytical question.

- 1,485 recorded answers on 55 analytical questions: 1,388 hold a statement, and 97 never reached the database (82 asked for a clarification, 15 were invalid responses). Those 97 keep their recorded status on every copy.
- Re-execution on the real table reproduced the recorded status on 1,485 of 1,485 answers, so the round runs at full size.
- 355 distinct statements. The governed arm's statements are what MetricFlow compiles each stored request to, frozen in `synthetic/results/answers.json`, so nothing later needs the compiler.
- 91 recorded wrong answers: Haiku 5.5 28, Sonnet 5.5 9, Gemini 3.8 Flash 0, GPT-4.1 mini 54.

Gemini 3.8 Flash has no wrong answers, so a false pass cannot be measured for it. Sonnet 5.5 has 9, under the floor of 10, so it gets counts and no rate.

## Real side and copies

The real side is the public Chicago trip sample (10,000 trips, January 2024) and its frozen questions and gold SQL. Each copy replaces `trips`, keeps the real `zones` lookup, and rebuilds `daily_trips` from the copy with the study's own model SQL. Same columns, types and row count.

Seven generators, five seeds each, 35 copies. All are in `synthetic/generators.py`.

| Generator | What it keeps |
|---|---|
| `independent` | Each column drawn on its own from the real column, missing values included. No dependence. |
| `copula` | Gaussian copula over all columns. Every pair carries a correlation; zone ids count as numbers, a known weakness; missing values are their own 0 or 1 column. |
| `tree` | Chow-Liu tree over binned columns: the best single set of pairwise links, then a real value from each bin. |
| `resample-1` | Real rows drawn with replacement, numbers multiplied by exp(N(0, 0.01)), categorical cells redrawn with probability 0.01. |
| `resample-5` | The same at 0.05. |
| `resample-20` | The same at 0.20. |
| `resample-5-filled` | `resample-5`, with missing fares, tips, charges and totals filled with the column median first. A generator that models no missing values. |

An exact copy of the real rows (`real`) runs through the same code as a control.

## Fidelity score

One score out of 1.0, the mean of two parts, each one minus a total variation distance from the real table:

- Column shape: over 11 scored columns (all but the id and the load time), 20 quantile bins of the real column for numbers, one category per value otherwise, missing as its own bin.
- Pair trends: over all 55 pairs of those columns, a joint table with numbers in 5 quantile bins, and each zone as one of its 5 most common values or "other".

A copy is high-scoring at 0.90 or more, the level one public write-up of synthetic test environments treats as highly realistic. The score is not computed on the questions: it sees only the table, as such scores do.

## Scoring

Each recorded statement and the same gold SQL run on the copy, in the study's sandbox, under its validator and its tolerance (absolute and relative 1e-6). A statement that errors or times out on a copy counts as not correct there.

Reported per model, never pooled, per generator with the minimum and maximum over the five seeds:

- False pass: wrong on real, correct on the copy, out of that model's recorded wrong answers, with the count of distinct questions behind it.
- False fail: correct on real, not correct on the copy, out of that model's recorded right answers.
- Verdict agreement over answers with a statement.
- Model score and raw against governed gap on real and on each copy, over the 330 strict-format answers each model has, so all four share one design. GPT-4.1 mini's 165 earlier answers count only in false passes and false fails.
- For wrong answers, how many differ from gold in the number of columns or rows on the real table. A wrong column count cannot pass on any copy, so this bounds the headline.
- Intervals: for models with 10 or more wrong answers, a 95% percentile bootstrap over question ids (2,000 draws, seed 7), for each generator across its seeds.

Does the score warn? Two tests. Spearman correlation per model between the score and the false pass count, over the 35 copies and within those at 0.90 or more. And the pair `resample-5` against `resample-5-filled`, close on the score by design.

## Positive control

Five planted wrong queries per question: the gold SQL reading a filtered `trips`.

- `drop_no_fare`: trips without a fare are lost.
- `drop_unavailable_pickup`: trips in the unavailable pickup bucket are lost.
- `drop_unavailable_dropoff`: the same for dropoff.
- `drop_inconsistent_sharing`: trips matched without authorization are lost.
- `drop_last_day`: January 31 is lost.

A planted query counts only on questions where it is wrong on the real table. These are written by the same author as the generators, so they show the instrument can flip a verdict and are a self-test, never a headline.

Bars, checked before reading any result, and the round stops and reports if either fails:

1. The exact copy scores 1.0 and reproduces all recorded verdicts and all planted verdicts.
2. On `resample-5-filled`, at least one `drop_no_fare` query that is wrong on real passes, in every seed. On `resample-5`, at least one is caught, in every seed.

## Predictions

1. `independent` scores under 0.90. Every `resample` copy, including the filled one, scores 0.90 or more.
2. On `resample-5`, false passes stay at or under 15% for Haiku 5.5 and GPT-4.1 mini, because keeping missing values keeps most of what makes an answer wrong.
3. On `resample-5-filled`, false passes are higher than on `resample-5` for both models, while the score differs by under 0.01.
4. False fails stay under 3% per model on `resample-1` and `resample-5`, and are higher on `independent`.
5. The order of the models by score on real holds on each copy, with at most one swap. The sign of each model's raw against governed gap holds on the `resample` copies, and the gap moves by 5 points or less.
6. Among copies at 0.90 or more, the score does not order false passes: Spearman under 0.5 in size for each model with 10 or more wrong answers.

## Limits fixed in advance

- The same SQL is re-scored. A model that could see the copy might write different SQL.
- One table of 10,000 trips and one question set, written alongside the definitions it tests.
- Generator choices drive the result, so every headline carries the range over generators at the number.
- Only 91 wrong answers, so counts come with denominators and question counts.
- The copies are the author's own generators. They stand in for the idea of a fidelity-scored copy and say nothing about any product.
