Skip to content
GenAI Learn/Adapting Models: SFT, LoRA & Distillation
Browsing as a guest. Sign in to save your progress and earn XP as you complete chapters.

Synthetic Data Pipelines

4 min readChapter 3 of 4

You'll learn to

  • -Describe the stages of a synthetic data pipeline: generate, verify, deduplicate and decontaminate
  • -Explain why verification is the stage that decides whether the data helps or hurts
  • -Explain what test-set contamination is and how to remove it
  • -Name the risks of training on a model's own output

Tip: the highlighter is on - just select any text below to mark it. Use the highlighter button up top to change color or turn it off. Highlights are saved on this device only. Log in to save them to your account instead.

Good labeled data is slow and expensive to collect, and often there is not enough of it. A language model can write examples for pennies: questions, answers, dialogues, edge cases. The Self-Instruct paper showed the idea at scale. It had a model generate instructions and responses, filtered out invalid and near-duplicate ones, and tuned the original model on what remained. The catch is that a generator makes mistakes, and training on mistakes teaches them.

An Analogy: A Factory With Inspectors

A factory stamps out parts quickly. If it shipped every part, the buyer would receive the defective ones too. So there is an inspector who tests each part, a worker who removes the duplicates from the pile, and a rule that no part may be identical to the sample the buyer will use to judge the order. The stamping machine is the generator. The inspectors are what make the output safe to use.

The Stages

  • -Seed: start from real examples, topics or documents so the generated data stays grounded in your task.
  • -Generate: have a model write many candidates, with varied prompts so they are not all alike.
  • -Verify: check each one. Use an exact checker if the task has one, such as running code against tests or recomputing arithmetic. Use a validated judge model or a person otherwise.
  • -Deduplicate: remove repeats and near repeats, which otherwise make the model overweight them.
  • -Decontaminate: remove anything that overlaps with the evaluation set.
  • -Mix and sample: combine with real data, then have a person read a random sample.

The simulation below makes addition questions with a generator that is wrong 15 percent of the time, sometimes repeats earlier questions, and sometimes reproduces a question from the test set. Each stage prints how many items survive.

Press Run: how many generated examples survive each stage

Of 200 generated items, 164 passed verification, so 36 had a wrong answer that would otherwise have gone straight into training. Removing duplicates cut that to 125, and removing questions that matched the test set left 122. Only 61 percent of what the generator produced was usable. The verification stage worked here because addition has an exact checker. For open-ended tasks there is no such checker, and a judge model must be validated first, as the judge chapters explain.

Contamination and Collapse

Contamination means the test questions leaked into the training data. A model that has seen the exam scores well without knowing the subject, and your measurements become meaningless. Remove test items from the training set by exact match and by overlap, and keep the test set private. A separate risk is feeding a model its own output again and again. Each round can narrow the range of what it produces, so mix in real data and keep humans in the loop.

Check the terms of the model that wrote the data. Some providers restrict using their outputs to train competing models. Read the license before building a pipeline on someone else's generator.

Interview Signal is part of Pro

See a real weak answer next to a real strong one for this exact topic.

Quiz is part of Pro

Test what you just read with a short quiz, and bank the XP.

Discussion0

Join the Discussion

Sign in to leave comments, reply to others, or like insights.

Sign In to ScaleDojo

No comments yet. Be the first to start the thread!