Topic 3 of 5 · 5 min read
Synthetic data from stronger models
Goal: Design a synthetic data pipeline with a generation prompt, a filter step and a terms check for a stated task.
Synthetic data means using a stronger model to write training examples for a smaller one, and it only works when every generated row passes a check you trust. Generation is cheap. Filtering is where the quality comes from.
Check yourself · 1 of 3
What is synthetic data in fine-tuning?
Why it matters
Real labelled data is slow and expensive to collect. A frontier model such as Claude, GPT or Gemini can write thousands of plausible examples in an hour. Self-Instruct showed this can bootstrap instruction data from a model's own output. But the generator makes mistakes, repeats itself and carries its own biases, and your model inherits all of it.
How to do it
- Write a seed set by hand. Twenty to fifty real or carefully written examples define the task. They go into the generation prompt as demonstrations.
- Prompt for variety. Ask for different topics, lengths, tones and difficulty levels, and give a list of scenarios to cover. Without this you get ten thousand variations of the same few rows.
- Generate inputs and outputs separately when you can. Draw realistic inputs first, ideally from real traffic, then generate answers.
- Filter hard. Combine:
- rule checks: valid JSON, length limits, required fields, no banned phrases;
- execution checks: run generated code, validate against a schema;
- a judge model scoring each row against a rubric, with spot checks by a human;
- deduplication against the dataset and against your test set.
- Check the terms. Provider terms of use may restrict using outputs to train competing models. Read the current terms for the generator you use, and keep a record of which model made which rows.
- Keep real data in the mix and keep your evaluation set human-written.
Before and after
Weak plan: "Ask the big model for 20,000 support tickets and answers, then train."
Better plan:
1. Hand-write 40 seed tickets across 8 categories.
2. Generate 4,000 tickets using 8 category prompts with varied tone and length.
3. Generate answers with the style sheet in the prompt.
4. Filter: schema check, judge score >= 4 of 5, near-duplicate removal.
5. Human-review 100 random survivors; stop if more than 5 are wrong.
6. Check generator terms; log the model used for every row.
What goes wrong
- Model collapse. Training repeatedly on model-written data narrows variety and loses rare cases, as the research on recursive generation describes.
- Inherited errors and bias. If the generator is wrong about a rule, thousands of rows repeat it with confidence.
- Judge blindness. A judge model often prefers long, fluent answers, even wrong ones.
- Contamination. Synthetic rows can echo your test questions, making evaluation look better than it is.
Examples
A code-fix dataset with execution checks
Generate 5,000 buggy snippets with fixes. Run each fix against a unit test the generator also wrote. Keep rows where the buggy version fails and the fixed version passes. Execution filters out the confident but wrong fixes that a judge would miss.
A judge that rewards length
A judge scores long answers 5 out of 5 and short ones 3. After filtering, the average answer length doubles and the tuned model rambles. Fix the rubric to penalise unneeded length, and compare against a human-rated sample of 100 rows.
Key points
- Generate from a small hand-written seed set and a list of scenarios, not from a single vague prompt.
- Filtering with rules, execution checks, a judge and human spot checks matters more than generation volume.
- Training repeatedly on model-written data can narrow variety, so keep real examples in the mix.
- Read the generator provider's current terms of use before training on its outputs.
- Keep the evaluation set human-written and deduplicate generated rows against it.
Common mistakes
- Generating a large set and training without any filtering or human spot check.
- Using one generation prompt with no scenario list, which yields near-duplicate rows.
- Ignoring the generator's terms of use until after release.
- Letting generated rows leak into the evaluation set.
Check yourself · 2 of 3
A generated dataset has 10,000 rows. Which step most improves its quality?
Check yourself · 3 of 3
A team plans to train on 50,000 answers written by a commercial model. What should they do before starting?
Practice items, not counted towards your mastery.
Start here
- OpenAI: Supervised fine-tuning guide (opens in a new tab)DocsFree
How a hosted provider expects training data to be formatted, sized and evaluated.
- Hugging Face TRL: SFT Trainer (opens in a new tab)DocsFree
How an open-source trainer reads conversational data and masks the loss.
- Chat templates (Hugging Face Transformers) (opens in a new tab)DocsFree
Shows how a model's chat template turns messages into the exact training text.
More for this topic
- The Curse of Recursion: Training on Generated Data Makes Models Forget (opens in a new tab)PaperFree
Describes model collapse when models are trained repeatedly on model-generated data.