Synthetic data

In one sentence

Use LLMs to generate training or eval data, then filter, dedup and verify it. It's cheap coverage for rare cases, but it inherits the generator's blind spots, so humans still check eval labels.

Analogy: A teacher writing practice exams: fast and endless, but every question reflects what that teacher thinks matters. Students who only study those exams get surprised by the real one.

Generation is one box; the quality comes from the filters, the dedup and the human-reviewed sample.

How it works

  • It's now the post-training default: over 98% of Nemotron-4 340B's alignment data was synthetic.
  • Self-Instruct grew 175 human seed tasks into ~52k; Evol-Instruct rewrites prompts to be harder or broader.
  • Force diversity with personas, and generate from your own documents so facts come from the source.
  • Verify with a judge from a different model family, MinHash dedup and humans reviewing a random sample.
  • The real test: train with and without the synthetic slice, then compare on real held-out data.

Check yourself

Answer to mark it learned; your answers aren't scored.

Your team generated 10,000 SFT examples with one model, one prompt template and one temperature. Clustering shows they are paraphrases of about 50 ideas, and the fine-tune barely moves the real metric. Best next step?

Go deeper

Full explanation

Synthetic data is training or evaluation data produced by a model instead of collected from people. It's now the default for post-training: NVIDIA reported over 98% of Nemotron-4 340B's alignment data was synthetic.

Main recipes:

  • Self-Instruct: start from ~175 human seed tasks; the LLM writes new instructions and answers; drop near-duplicates (ROUGE-L ≥ 0.7 to an existing one) and loop. Alpaca's 52k examples came from this.
  • Evol-Instruct (WizardLM): rewrite seed prompts to be harder (add constraints, deepen the reasoning) or broader, to climb difficulty.
  • Persona-driven: condition each generation on a persona ("a pharmacist in Lima", "a junior SRE") to force diversity; Persona Hub offers 1B of them.
  • Grounded: generate questions from your own documents, so the facts come from the source, not the model's memory.

Generating is the easy half. The pipeline is generate → filter → dedup → verify: schema checks, run the code, an LLM-as-a-judge from a different model family, MinHash or embedding dedup (Training data quality & curation), and humans reviewing a random sample. The real test is downstream: train with and without the synthetic slice and compare on real held-out data.

Code Persona-driven generation with structured output
pythonPersona-driven generation with structured output
import random
from openai import OpenAI
from pydantic import BaseModel

MODEL = "gpt-4.1-mini"   # any capable chat model; judge with a different family
client = OpenAI()
rng = random.Random(7)   # seeded: reproducible datasets

class Ticket(BaseModel):
    message: str          # what the customer writes
    intent: str           # the label we will train or evaluate on

PERSONAS = ["retired teacher, not technical, long paragraphs",
            "SRE at a fintech, terse, pastes stack traces",
            "shop owner in Bogota, writes in Spanish, angry"]
INTENTS = ["refund", "bug_report", "change_plan", "cancel", "how_to"]

def generate(n: int) -> list[Ticket]:
    out = []
    for _ in range(n):
        persona, intent = rng.choice(PERSONAS), rng.choice(INTENTS)
        r = client.responses.parse(
            model=MODEL, temperature=1.0, text_format=Ticket,
            input=f"Write a realistic support message from a {persona}. "
                  f"Intent: {intent}. Don't name the intent; add one irrelevant detail.")
        out.append(r.output_parsed)
    return out

tickets = dedup_minhash(generate(5_000), threshold=0.8)          # near-copies kill diversity
tickets = [t for t in tickets if relabel(t.message) == t.intent]  # a 2nd model must agree
review_queue(rng.sample(tickets, 200))                            # humans before training
Real example

A team building a help-center bot has only 300 real user questions. They generate 2,000 more from 400 help articles, crossing 20 personas with three difficulty levels. MinHash dedup removes 18%; a judge from another model family drops questions the source article can't answer; two support agents review a 10% sample and fix expected answers. The surprise: synthetic questions are cleaner than real ones (no typos, one intent each), and the bot scores 12 points higher on them. They keep the 300 real questions as the headline metric and use the synthetic ones to cover rare topics.

Trade-offs +4 · −4

+ You gain

  • Thousands of labeled examples in hours instead of weeks of annotation.
  • Targets gaps on purpose: rare intents, edge cases, other languages, adversarial inputs.
  • Keeps real customer data out of training sets (though a generator can still leak memorized text).
  • Fully controllable distribution: you choose difficulty, balance and format.

− You pay

  • Bounded by the generator: inherits its errors, style and biases, and can amplify them.
  • Too clean: synthetic inputs lack the typos, ambiguity and mixed intents of real traffic.
  • Recursive training on model output erodes the tails of the distribution (model collapse).
  • Provider terms may forbid using outputs to train competing models.

Use it when

Bootstrapping SFT or preference data when real labels are scarce, covering rare cases and languages, generating eval inputs at scale, and distilling a big model into a small one, always with verification and a human-reviewed sample.

Avoid it when

As the only ground truth for evals, when plenty of real labeled data already exists, or for high-stakes labels (medical, legal) with no verifier and no expert review.

Numbers to know 4
  • Self-Instruct: 175 human seed tasks grew into ~52k instructions; Stanford's Alpaca reproduced it for under $500 of API calls.
  • Nemotron-4 340B: over 98% of the data used in its alignment process was synthetic.
  • phi-1 (1.3B): 50.6% HumanEval pass@1, trained on ~6B filtered web tokens plus ~1B tokens of GPT-3.5-written textbooks and exercises.
  • Persona Hub: 1B personas (~13% of the world's population) to diversify generation.
Common pitfalls 4
  • Low diversity: one model, one template and one temperature give 10,000 paraphrases of 50 ideas. Vary personas, seeds and constraints; measure cluster coverage.
  • The same model generates, answers and judges: shared blind spots, inflated scores. Judge with a different family and anchor evals on human labels.
  • Replacing real data with synthetic across generations: the tails vanish (model collapse). Accumulate synthetic data on top of real data instead.
  • Benchmark leakage: generators reproduce famous test items. Decontaminate synthetic sets against your evals like any other data.
Interview questions 3

Answer out loud first, then reveal.

How do you know synthetic training data is actually good?Show answer

I treat it as untrusted until proven. First, per-example checks: schema validation, executing code, or a judge from a different model family with a rubric. Second, set-level checks: dedup with MinHash or embeddings and measure diversity, because 10,000 paraphrases of the same idea add little. Third, humans review a random sample against an acceptance bar, say 95% correct. The final proof is an ablation: train with and without the synthetic slice and compare on real held-out data. If it doesn't move the real metric, it's just cost.

Can you build your eval set synthetically?Show answer

The inputs, yes; the ground truth, carefully. I use an LLM to widen coverage: personas, edge cases, adversarial phrasings, rare topics. But domain experts review the expected outputs, and I anchor the headline metric on real production samples, because synthetic inputs are cleaner and systems usually score higher on them. I never let one model generate the questions, answer them and judge them. And I check that system rankings agree on the synthetic and real sets; if they don't, I trust the real one.

What is model collapse, and should you worry about it?Show answer

Shumailov et al. showed that training each model generation on the previous generation's output narrows the distribution: rare events disappear first, and after several rounds the outputs degrade. In practice the risk comes from replacing real data with synthetic in a loop; follow-up work found that accumulating synthetic data on top of the original real data avoids the collapse. So I keep a real-data anchor, track which data is synthetic, and watch diversity metrics. It matters for web crawls too, since the web holds more and more LLM text.