Kolkata ·  
AI engineering
evals
short · 3 min

Synthetic test data

Test cases generated by a model, and the traps in trusting them.

updated 29 Sept 2026

There's a chicken-and-egg problem with AI features. To make one good, we need real user data to test on. To get users, we need it to be good first.

So we cheat a little: have a model write the test inputs for us. That's synthetic test data. It lets us start on evals before there's any traffic, and it lets us aim at a rare failure on purpose.

The obvious way, and why it flops

Say we're building a recipe app. The obvious move is to ask a model: "give me 50 test queries". What comes back is bland and samey. The same few dishes, phrased the same polite way. Real users are messier than that, and a test set with no variety can't show us where the app breaks.

The fix is to decide up front how inputs should vary, and make the model fill in our plan.

Plan the variety first

Start with dimensions: the ways user messages differ. For the recipe app:

  • dietary need: vegan, gluten-free, none
  • cuisine: Italian, Asian, comfort food
  • complexity: simple request, multi-step, edge case

Pick dimensions that point at failures we suspect. (No hunches yet? Use the app a lot yourself, or get friends to.)

Next, write about 20 tuples by hand. A tuple takes one value from each dimension: (vegan, Italian, multi-step). Doing the first 20 ourselves makes us think about which combinations matter.

Then let a model make more tuples. There are two ways. Generate every combination and have a model throw out the ones that make no sense, which covers the odd corners. Or ask the model for tuples directly, which gives more realistic mixes but slides back towards the generic and skips rare cases.

Finally, in a separate prompt, turn each tuple into something a person would type. Keeping this step apart is what stops every query sounding the same. (vegan, Italian, multi-step) might become "I need a dairy-free lasagna recipe that I can prep the day before."

Then run them all through the whole system. The messages aren't the point; the traces they produce are. About 100 varied traces is a good first pool for error analysis.

Let the model write questions, never answers

Here's the trap. It's tempting to have the model write the expected answers too. Don't. If the same kind of model writes what "correct" looks like, the test set inherits its biases and blind spots, and we end up grading our system against them.

Ground the inputs in real data where you can, too. One real estate assistant tested this way used a database of real listings and real showing rules. A query meant to test "no listings match" should actually return zero results when run. If it doesn't, the test isn't testing what we think.

And skip generating tests for bugs we can just fix. If the prompt never mentions dietary needs, fix the prompt. A batch of dietary tests first is wasted effort.

What it can't tell us

Synthetic data finds failures. It can't say how often they happen to real users, because we picked the mix of inputs ourselves. It can also miss the details and quirks of a specialised domain that a model doesn't know about. So once real users arrive, compare the synthetic set against real traffic, and use online evals for the rates.

One more thing: the synthetic set usually doesn't go away. What started as a stopgap tends to become a permanent part of the test setup, because it covers cases real traffic rarely hits. That's fine, as long as real traces keep getting added beside it.

Further reading