Pipeline diagram of generated training examples passing through filters before fine-tuning

Synthetic Data for SFT: Generation, Filtering, and Risks

You have forty real examples and a task that needs four hundred. Writing the rest by hand is slow, so you ask a strong model to produce them. That is synthetic data for SFT: training examples generated by a model, then filtered and used to fine-tune another one. It works well when you treat generation as the cheap step and verification as the expensive one, and badly when you do the reverse.

The honest summary is that synthetic data multiplies whatever you feed it. Feed it a clear spec, real seed examples, and strict filters, and you get breadth that was impractical to write by hand. Feed it vibes and no checks, and you get thousands of fluent, repetitive rows that teach a model your generator’s habits instead of your product’s needs.

What synthetic data is good and bad at

Good useWhy it worksBad useWhy it fails
Format and schema varietyOutputs can be validated by codeNew domain factsGenerator may invent them, and the student memorizes the inventions
Paraphrasing inputs at scaleCheap diversity in phrasingMatching real user messinessGenerated inputs are cleaner than reality
Edge-case coverageYou can request rare scenariosSubjective quality judgmentsGenerator and judge share the same blind spots
Rewriting with verified rulesRules are checkableSafety-critical adviceErrors look polished

The earlier SFT guidance still governs: examples are unit tests for behavior, as laid out in the SFT playbook. Synthetic rows must meet the same bar as hand-written ones.

Start with a coverage map, not a prompt

The most common failure is asking a model for “500 diverse examples” and receiving 500 variations on the three scenarios it finds most natural. Diversity has to be engineered.

Build a small matrix of the dimensions your task actually varies along. For an invoice-extraction feature that might be document type, currency format, language, missing fields, scan noise, and number of line items. For a support classifier: product area, customer emotion, ticket length, presence of code, and ambiguity level. Then generate by sampling cells from the matrix and passing the cell’s attributes into the generation prompt.

This also gives you an audit trail. If the final dataset has zero rows in the “missing field AND non-English” cell, you can see the hole instead of discovering it in production.

Seeds and generation that avoid sameness

The method popularized by the Self-Instruct paper bootstraps new instructions from a small seed set and filters near-duplicates. The principle carries over to application work even if you do not copy the pipeline.

  • Seed with real examples. Show the generator three to five varied, high-quality real rows per request, and rotate which ones appear so the style does not lock in.
  • Generate inputs and outputs separately when you can. Create the user message first, then produce the answer with your production prompt and tools. This keeps targets aligned with how the system actually behaves.
  • Vary the persona and register. Terse engineers, anxious customers, and non-native speakers write differently. Ask for the specific voice per cell.
  • Use moderate temperature, and generate extra. You will discard a large share, so overproduce by two to three times your target.
  • Use a stronger generator than the student, but not necessarily the strongest model available. The question is whether outputs pass your filters, not which model is fanciest.

The filter stack that earns the dataset its keep

Think of filtering as the main product. Apply these in order from cheapest to most expensive.

  1. Structural validation. Parse the JSON, check the schema, verify required fields, and reject length extremes.
  2. Executable checks. If the answer is code or SQL, run it. If it is a calculation, recompute it. Execution-verified rows are the most trustworthy synthetic data you can have.
  3. Deduplication. Remove exact duplicates, then near-duplicates using normalized text or embedding similarity. A tight threshold is a common cure for the “500 rows, 3 scenarios” problem, and embedding basics are explained in what embeddings are.
  4. Rule-based screens. Ban phrases that signal generator habits, such as “As an AI language model” or ceremonial openers you do not want imitated.
  5. Model-based grading. A judge scores helpfulness or faithfulness against a rubric. Calibrate the judge on a human-labeled sample first, and keep the threshold strict.
  6. Human spot checks. Review at least a stratified sample from every coverage cell. If more than a small fraction fail, fix the generator and regenerate rather than patching rows.

Log the rejection reason for every dropped row. The distribution of reasons tells you what the generator gets wrong, which is often more valuable than the dataset.

Leakage and contamination

Synthetic pipelines leak in subtle ways. If your generator saw the held-out test set while producing seeds, or the seeds were drawn from the same pool as your test set, the “improvement” you measure after training is partly memorization. Rules to keep yourself honest:

  • Split real data into train, validation, and test before any generation, and only use the train split as seeds.
  • Never put test prompts into a generation request, even as examples of what to avoid.
  • Remove synthetic rows whose input is a near-duplicate of anything in validation or test.
  • Keep the test set purely real wherever possible; synthetic tests measure agreement with your generator, not with users.

The routine in eval before and after fine-tuning assumes a clean held-out set and depends on the discipline above.

The risks people underrate

Model collapse. Training repeatedly on model-generated data can erode the tails of the distribution. The paper The Curse of Recursion demonstrates this effect when models are trained recursively on their own outputs. A single round of filtered, mixed synthetic data is far from that scenario, but the lesson is practical: keep real data in the mix and avoid regenerating from your own tuned model’s outputs in a loop.

Inherited errors. The generator’s mistakes become ground truth. Filters catch format and executable errors; they rarely catch confident factual mistakes, so do not use synthetic rows to teach facts.

Style fingerprinting. Students trained on one generator’s outputs start to sound like it. If your product voice matters, anchor with human-written examples and compare tone on a blind review.

Licensing. Providers differ on whether you may train on their outputs. Check the generator’s terms before you commit, as with distillation.

Privacy. If you derive synthetic rows from customer data, “synthetic” does not automatically mean “anonymous.” Memorized names, emails, and identifiers can be carried over. Run PII detection on outputs and honor your data agreements.

A pilot you can finish in a week

  1. Day 1: write the behavior spec and coverage matrix; split real data.
  2. Day 2: generate 3x the target count from matrix cells with rotating seeds.
  3. Day 3: run the filter stack, record rejection reasons, review stratified samples.
  4. Day 4: train a small adapter with LoRA on real-plus-synthetic data, and a control adapter on real data only.
  5. Day 5: compare both with the baseline on the real held-out set, by slice.

If the synthetic-augmented adapter does not beat the real-only control on the real test set, the synthetic data did not help, regardless of how impressive it reads. When results disappoint, when fine-tuning fails offers a diagnosis order. Keep the dataset versions and generator prompts under version control as part of your LLMOps practice, and if the generated tasks involve retrieval, validate them with the RAGAS evaluation guide. For trainer setup, the official TRL documentation is the reference.

FAQ: synthetic data for SFT

Is synthetic data good enough for supervised fine-tuning?

Yes for format, schema, style, and edge-case coverage, provided you filter aggressively and keep real examples in the mix. It is poor at teaching new facts, because the generator can invent plausible falsehoods that the student then memorizes.

How much synthetic data should I mix with real data?

There is no universal ratio. Start with real data as the anchor, add synthetic rows to fill coverage gaps, and compare against a real-only control on a real held-out set. Keep the share that measurably helps.

How do I keep synthetic examples diverse?

Define a coverage matrix of the attributes your task varies on, sample combinations from it, rotate seed examples across requests, vary personas, and deduplicate by similarity. Diversity is engineered, not requested with a single prompt.

What is model collapse and should I worry?

Model collapse is the loss of distribution tails when models train recursively on their own outputs. One filtered round mixed with real data is low risk, but avoid loops where each generation trains on the last one and keep real data in the dataset.

Can I use LLM judges to filter synthetic data?

Yes, after calibrating the judge against human labels on a sample and setting a strict threshold. Judges share biases with generators, so pair them with executable checks and human spot reviews instead of relying on them alone.

Do I need to disclose or check licensing for synthetic data?

You should check the generator’s terms, since some providers restrict training on their outputs, and review privacy obligations if seeds came from customer data. Track the generator, prompt, and date for each batch as provenance.

Related reading

About Mudasir Syed

Check Also

Engineer debugging a failed fine-tuning run with loss curves and decoded training samples on screen

When Fine-Tuning Fails: Diagnosis and Cheaper Fixes

The run finished, the loss curve looks healthy, and the model is no better in …

Leave a Reply