synthetic data

Good Synthetic Data Comes From a Generator You Can Evaluate

Test data has never been this easy to get. Ask a language model for 200 invoices from the subcontractors of an IT consultancy, and half a minute later you have them: different suppliers, plausible rates, VAT worked out, payment terms in the small print. At first glance they pass for the real thing.

Look closer and two problems appear. The invoices are too alike: the same few supplier names, the same tidy layout, no credit notes, no scans, no invoice for hours nobody approved. A system that handles them has only shown that it can handle the model’s idea of an invoice.

And nobody knows the right answers. One invoice bills 32 hours at 135 euros and states a net amount of 4,280 euros instead of 4,320. Did the model slip, or was the error planted on purpose? The only record of what the invoice should say is the invoice itself, so there is nothing to grade a system against.

This piece describes a way around both problems. My examples come from a synthetic dataset I built for a course on data pipelines: the records of a fictional IT consultancy’s project office, from the general ledger to customer emails.

When a prompt is enough

For a handful of examples you want to look at, show in a demo or throw away, asking the model directly is fine. Nobody checks the numbers, and nobody needs the same set twice.

That changes once you want to measure something. Scoring an extraction system requires the correct amount for every invoice. Comparing two versions of a pipeline requires the same test set both times. And when invoices have to match their purchase orders and the bookings in the ledger, the documents must agree with each other, which a model writing one document at a time does not guarantee. A preprint on table generation argues that language models struggle to keep columns consistent, and even plain numbers drift: in an informal experiment, three chat models asked for a random number between 0 and 100 each kept coming back to a favourite.

Whenever you want to grade a system, the facts have to live in code.

Step 1: let the model write a generator, not documents

Instead of asking for 200 invoices, ask for a program that produces them. A model writes such a program in an afternoon; mine has about 2,100 lines of Python plus a 500-line checker. The code is the easy part. What matters is how the generator is set up, and five rules cover most of it.

Invent the company first, then its paperwork. The program decides the facts before any document exists: 24 projects, twelve customers, 32 employees, four subcontractors, ten months of hours and bookings, and business rules such as billing a milestone only after the customer has accepted it. Then it prints the paperwork from those facts, each in the format of the system it comes from: ledger exports with decimal commas and dates without a year, spreadsheets with formulas, contracts as PDFs, email threads. The paperwork never adds a fact of its own.

Keep the true version separate. The program stores the correct facts in a database, the answer key. Mistakes go only into the printed paperwork: a booking entered twice, hours logged in the wrong time zone, a formula overwritten with a typed number. My dataset contains 53 such mistakes, each listed in a catalogue with its location and the rule that resolves it, and each can be switched on or off.

Let the program work out the right answers. Nobody types expected results by hand. The order backlog per project or the correct category of a booking is a query against the answer key, so it stays correct whenever the generator changes.

Use a fixed starting number. With a fixed random seed, every run produces the same company, so a better score means a better system and not luckier data.

Let the model write the text, one document at a time, from facts it is handed. A request for a customer email looks like this:

{
  "doc_type": "customer_email",
  "sender_role": "customer project lead",
  "intent": "escalation",
  "facts": {
    "milestone": "M3",
    "agreed_date": "2026-06-30",
    "days_late": 21
  },
  "register": "curt",
  "length_words": 120,
  "omit": ["project code"],
  "instruction": "Write the email this person would send. Use every fact exactly as given. Add no dates, amounts or names that are not in this record."
}

The project code is left out on purpose. Real customers rarely quote it, so working out which project an email belongs to becomes a task with a known answer. In my dataset these texts are still templates; having a model rewrite them is the next step. NVIDIA’s Data Designer splits the work the same way, going by its documentation: values drawn by code, text written by the model, checks on top. A vendor’s own documentation is an exhibit, not proof.

The hard work is in the rules, not the code. When a subcontractor’s approved timesheet shows twelve hours that never reached the time tracker, which source counts? When the ledger and the invoice disagree, which one wins? You cannot plant a mistake without deciding how it should be handled, so have someone who knows the work, such as whoever runs the month-end close, check those decisions.

Step 2: make it look real

Ask a model for documents “as varied as possible” and you still get the typical case. It cannot see what it wrote in earlier calls, and a paper at this year’s ICML traces its pull towards the familiar to the way models are tuned on human preferences. Raising the temperature does not fix this. Variety has to come from the generator.

Decide the cases before any text exists. Hamel Husain and Shreya Shankar recommend naming the dimensions along which inputs vary, writing the first combinations by hand and only then letting a model turn each one into language. If you cannot point to the row with the late invoice, the duplicate and the credit note, the data does not contain them.

Give each supplier one layout. Real suppliers use the same invoice template for years, so twelve suppliers with twelve stable layouts look more real than 200 invoices in 200 designs.

Write each document from a person, not from “a customer”. The request says who writes to whom, about what and in which mood, and the code draws tone and length. Left alone, a model turns a furious customer into a mildly disappointed one.

Copy how the medium behaves. Real email threads quote earlier messages, carry signatures, lose their reply headers, mix “AW:” with “Re:” and contain out-of-office notices. None of that needs a model.

Add the mess in a second pass. Generate clean documents, then degrade them: abbreviations, a missing greeting, a date in the wrong format, a scan without a text layer. The rates sit in the code, where they can be adjusted later.

Stop the model from repeating itself. Pass it the openings it has already used and forbid them, or ask for several variants with their probabilities, as the ICML paper proposes, and take the less likely one. Names, company names and identifiers come from lists in the code, with reserved ranges such as the .example domain for anything that could belong to someone.

Step 3: check that it looks real

Every document can look fine on its own while the set as a whole looks nothing like reality. The only way to find out is to compare it with the real thing.

Collect about fifty real documents of the same type, with names blacked out. Then ask the model for a small script that measures the same properties in both piles and prints them side by side. For invoices the result might look like this (illustrative numbers):

PropertyReal invoicesGenerated invoices
Different layouts142
Credit notes or corrections6%0%
Average line items3.15.0
Invoices with a missing field18%0%
Scanned rather than digital30%0%

Every row where the columns differ is a job for the generator. Here the synthetic invoices are too uniform, too complete and too clean.

Then the eye test. Mix ten real and ten generated documents, and ask someone who processes them every day to pick out the fakes and say why. Answers like “real suppliers don’t write like that” or “nobody’s invoices are this neat” become the next rules in the generator. A simple classifier trained to tell the two piles apart does the same job at scale. If a language model does the judging, take one from a different family than the one that wrote the text: models rate their own output higher than human raters do.

Fix, regenerate, compare again. A document type passes when the table looks alike and neither your colleague nor the classifier does better than guessing. Without any real sample, realism can only be judged by an expert, not measured, and the documentation should say which of the two you did.

Finally, check that results carry over. Run your system on the synthetic set and on the real sample. A case study of a university chatbot (preprint, one system) shows what happens otherwise: generated questions averaged 15.7 words, real ones 6.8, and the retrieval setup that hit 0.90 on the generated questions fell to 0.53 on real ones. One histogram of question lengths would have caught it. A broader preprint across four datasets is more encouraging: synthetic benchmarks ranked retrieval setups much as human ones did, though they failed to rank generator models.

Step 4: check that it is correct

A bug in the generator later looks like a bug in the system you are testing, and someone spends a day debugging a pipeline that was right all along. A checker that ships with the generator prevents that. Mine runs four tests.

A careful solution that applies every rule in the catalogue must reproduce the answer key exactly. If it cannot, either the documents do not contain enough to solve the task or the answer key is wrong.

A careless solution that applies no rule must fail. On seed 42 it gets 55 cost values, 32 hour totals, 11 backlog figures and 5 billing figures wrong. If it passes, the data tests nothing.

Switching off one rule at a time must change a result. A planted mistake that changes nothing is decoration and comes out.

All of this must hold across many seeds. I run seeds 1 to 40, which catches mistakes that only existed because of one lucky draw.

Text written by the model gets one more check: extract the facts again and compare them with the answer key. A model that rewords an amount sometimes improves it.

Synthetic does not automatically mean anonymous, either. My dataset uses no real records, but generators are often calibrated on real data. The European Data Protection Board’s draft anonymisation guidelines name synthetic data as a case where conclusions about individuals can remain possible, and Meeus and colleagues (ICML 2025) showed that text from a model fine-tuned on real records still reveals which records were used. If you calibrate on real data, export only aggregates, and watch out for categories with a single member.

What a first version tends to miss

These are the problems I would check for first.

  • Anything that reads today’s date produces a different dataset tomorrow. Fix a cut-off date and cover the edges around it: month ends, the change of year, time zones, public holidays.
  • Invented names and home addresses should still trip a redaction filter. Plant them on purpose and record where they are, so the redaction step has an answer key too.
  • A coding agent asked to build the pipeline will sooner or later find a folder called truth and read it. Keep the answer key out of its reach.
  • My ledger files imitate a common accounting export but were never checked against a real one. The first real file will differ, and the documentation says so.
  • Seeded code produces the same company again; a hosted model does not produce the same email again. Store the generated text together with the generator version, the seed and the model’s name.
  • A single accuracy figure over synthetic data averages over a distribution nobody observed. Report results per case and per planted mistake.

The catalogue only knows what you knew

Every entry in the catalogue is a mistake someone already understood well enough to write a rule for. A pipeline that finds all 53 has shown that it handles my experience of how project data goes wrong. About the 54th mistake, sitting in a real export from a system I have never seen, it says nothing.

A green run against a convincing dataset feels like evidence about production. And a catalogue precise enough to automate is precise enough to game: an agent that iterates until the checker passes learns the catalogue, whether or not it learns the domain.

The workable loop turns every surprise from production into a new entry and regenerates the data. Both checks can pass on every seed. Neither tells you how complete the catalogue is. It stays a list of one person’s past surprises, always one incident behind.

Sources

SourceEvidence grade
Why LLMs Are Bad at Synthetic Table Generation (and what to do about it)Preprint, arXiv, revised March 2025
LLM random number experiment, GramenerInformal experiment, trial counts not published
Verbalized Sampling: How to Mitigate Mode Collapse and Unlock LLM DiversityPeer reviewed, ICML 2026
Husain and Shankar: What is the best approach for generating synthetic data?Practitioner guidance
Beyond Benchmark Scores: How Synthetic and Authentic Query Distributions Diverge in RAG EvaluationPreprint, single case study, authors list their own limits
Can we Evaluate RAGs with Synthetic Data?Preprint, abstract only consulted
NVIDIA Data Designer documentation, column conceptsVendor documentation
LLM Evaluators Recognize and Favor Their Own GenerationsPeer reviewed, NeurIPS 2024
EDPB Guidelines 02/2026 on AnonymisationRegulator draft, version for public consultation, first 97 paragraphs read
The Canary’s Echo: Auditing Privacy Risks of LLM-Generated Synthetic TextPeer reviewed, ICML 2025
Project office generator, own materialFigures for seed 42 reproduced by running the generator and checker on 16 November 2026

Unlock the Future of Business with AI

Dive into our immersive workshops and equip your team with the tools and knowledge to lead in the AI era.

Scroll to top