Concepts / Generating Synthetic Data for Model Training

Generating Synthetic Data for Model Training

Privacy concerns arise when data contains sensitive information, such as real patient records and real insurance claims.

  • Programming

Why the Obvious Training Data Is Off Limits

Imagine you are asked to build an AI model that predicts health outcomes for patients. The most obvious source of training material is the records that already exist: real patient files, collected over years of care. Yet in many organizations those records cannot simply be handed to a model-building team. The data is valuable precisely because it describes real people, and that same fact is what makes it difficult to use.

This article follows one problem through a short sequence of steps: privacy concerns in data usage, and the approach the course describes for reducing them, which is synthetic data. As you read, keep a running picture of the path a dataset takes from the real world into a model, because the core idea is about where the sensitive part of that path stops.

Real Records Versus Generated Look-Alikes

Definition

Synthetic data is data generated to mimic real data without containing sensitive information. It is produced programmatically so that it resembles the real thing, but it is not a copy of any real person's record.

The contrast between the two kinds of data is the core of this topic. Real records contain sensitive information, and in healthcare, legislation makes it hard, if not impossible, to use them to train a model. Synthetic records are generated to mimic them and are described as containing no sensitive information. That single difference, sensitivity, is what decides which kind of data a team is allowed to feed into training.

Synthetic data is often described as the only option where human-generated data cannot be used because of privacy concerns. The two cases the course names are synthetic patient records and synthetic claims. Insurance claims are another kind of record where privacy is a serious concern, so the same reasoning applies there.

AspectReal patient records and claimsSynthetic patient records and claims
OriginCollected from actual people over the course of real care or real insurance activityGenerated programmatically to mimic the real kind of record
Sensitive informationContains sensitive information about real individualsDescribed as containing no sensitive information
Use for model trainingOften restricted, and in healthcare legislation makes it hard, if not impossible, to useOften the usable option where human-generated data cannot be used
Main risk to managePrivacy of the real people describedWhether the generated examples are accurate and representative

Real and synthetic records differ mainly in sensitivity and in what must be checked before use.

Where Synthetic Data Enters the Pipeline

The diagram below traces the path. Real data remains the starting point, and synthetic data is added to it. The sensitive real dataset feeds a generator, which produces a synthetic dataset. The generated portion does not go straight into training. It must be evaluated first, just as real data must be checked before it is used to train a model. Follow the arrows and notice the point where the sensitive information stops flowing.

Real datasetcontains sensitiveinformationGeneratorproduces records that mimicthe real dataSynthetic datasetno sensitive informationQuality evaluationchecked before trainingModel trainingreceives only evaluateddatamimicked bygeneratesmust be evaluatedpasses
How information moves from the sensitive real dataset through the generator into the synthetic dataset, and where the sensitive data stops flowing.

Read the diagram as a boundary. Everything to the left of the synthetic dataset carries the sensitivity of the real people. The synthetic dataset is the point at which that sensitivity is said to be absent, which is why it can be used where the real records cannot. The boundary does not remove the need for judgment, however. The evaluation step still sits between generation and training.

The Three Dataset Design Criteria

A dataset is designed by first deciding the behaviors the model should learn, then choosing data that demonstrates them. The data you need is shaped by your use case and by the training phase the model is in. Pre-training draws on different data than instruction finetuning or preference finetuning does. Even so, dataset design across all of these phases rests on the same three criteria: quality, coverage, and quantity.

Quantity gets most of the attention in discussions about training, but the other two criteria matter just as much. Keep that in mind, because the rest of the design logic depends on it.

Worked Example: Planning a Patient Dataset

Worked example

Checking a synthetic patient dataset against the three criteria

A team needs data to train a model that predicts health outcomes. Real patient files are restricted, so they plan to generate synthetic patient records. Before generating in bulk, how should they reason about quality, coverage, and quantity?

  1. 1
    Name the behavior first

    Decide what the model should learn to do. For example, it should predict outcomes for patients whose situations resemble those in real care. The dataset is designed around that behavior, not around volume.

  2. 2
    Check quality

    Ask whether each generated patient record is accurate and useful for that behavior. A record that is wrong, off-topic, or unrepresentative would teach the model those flaws, so quality is judged per example.

  3. 3
    Check coverage

    Ask whether the generated set spans the range of situations the model must handle. If every generated patient looks alike, the set has gaps even if it is large.

  4. 4
    Decide quantity last

    Only after quality and coverage are settled does it make sense to ask how much data to generate. Generating a huge volume of poor records adds noise, not correct behavior.

  5. 5
    Decide the judgment rule before generating

    Before generating large amounts, decide how each piece will be judged. If the output cannot be evaluated, the team cannot be confident the generation is helping.

Result

The team does not start by asking how many synthetic records to create. It starts by deciding the behavior, sets a way to evaluate each record, and checks coverage before scaling up the quantity.

Checks Before Training

The course is firm that synthetic data must be evaluated to ensure its quality before it is used to train models. This applies to generated data in the same way it applies to real data. A generated example can be wrong, off-topic, or unrepresentative, and training on it can teach the model those flaws.

The flowchart below shows the order in which a generated record moves through the check. Notice that a record which does not pass is not sent into the training set. The loop back to generation is a pedagogical illustration of how a failed record is handled, not a fixed procedure from the course.

Generate recordmimics real dataQuality checkaccurate and useful?Coverage checkadds a needed situation?Training setonly passing recordsRegeneratefailed record sent backevaluatepassespassesfailsfailstry again
The order in which synthetic records pass through evaluation, and which records are rejected or sent back for regeneration before reaching the training set.

Healthcare and Insurance Privacy Pressure

Healthcare is the clearest case where privacy concerns are significant. Legislation in healthcare makes it hard, if not impossible, to use real patient records to train a model. Insurance is the second industry the course names, because claims data also describes real people and their sensitive circumstances. In both industries the value of the data and the difficulty of using it come from the same source: the records describe real individuals.

Mistakes When Using Synthetic Data

  • Common mistake

    Treating generated data as correct because it looks realistic

    What it looks like

    A generated patient record reads plausibly, so it goes straight into the training set without checking.

    Why it fails

    A generated example can be wrong, off-topic, or unrepresentative, and training on it can teach the model those flaws.

    Do this instead

    Evaluate each generated piece for quality before it is used to train.

  • Common mistake

    Starting with quantity

    What it looks like

    A team generates as many synthetic records as possible before deciding what behavior the model should learn.

    Why it fails

    Quantity is one of three criteria. Noisy examples add volume without adding correct behavior, and a set of similar examples leaves gaps.

    Do this instead

    Decide the behavior first, then design for quality and coverage, and only then choose the quantity.

  • Common mistake

    Generating without a way to judge the output

    Why it fails

    If the output cannot be evaluated, the team cannot be confident the generation process is helping.

    Do this instead

    Before generating large amounts, decide how each piece will be judged.

  • Common mistake

    Assuming synthetic data removes the need for careful thinking

    Why it fails

    Acquiring high-quality data is difficult. Writing annotation guidelines is harder than annotating, and verifying generated data is harder still. Judgment about what data you want cannot be handed off to a tool.

    Do this instead

    Treat generation as moving the effort into design and evaluation rather than eliminating it.

The Data Flywheel

A data flywheel describes a model that continually improves upon itself. The implication of using synthetic data is that, in theory, it is possible to train a model that keeps improving this way. Each round of improvement produces material for the next round, so progress builds on itself. The diagram below traces one turn of the cycle and what happens on each pass.

Model outputgenerated answers orsolutionsFeedback signalis it reliable?New training databuilt from the outputNext training roundmodel learns from new dataImproved modelproduces the next round ofoutputcheckedreliable signalused forproducesnext turn
How output from a model becomes new training data, and what happens on each turn of the cycle until the loop either improves or stalls.

Follow one turn. The model produces output. That output is checked by a feedback signal. If the signal is reliable, the output becomes new training data, which feeds the next training round and yields an improved model. The improved model then produces the next round of output, and the cycle repeats. The loop is only as good as the step where feedback is judged. If the feedback is unreliable, the next round is built on a flawed foundation.

When the Flywheel Stalls

The loop is attractive, but whether it works in practice is another story. The flywheel depends on the quality of what the model feeds back into itself. A cycle that reinforces mistakes is not an improvement. The course gives two contrasting cases that show what separates a working loop from a failing one.

In the working case, a reported study found that about 20 percent of solutions were initially incorrect but self-corrected. This indicated that the model learned from execution feedback and improved its performance. The feedback came from running the code, a signal that reliably separated good output from bad.

The failing case is the same loop with a weaker signal. If a human labeler answers a question using knowledge the model does not have, the labeler is effectively teaching the model to hallucinate. The label looks correct to a person but carries information the model cannot reproduce from its own inputs, so the model learns to produce answers without grounds.

Trace the Flywheel Yourself

What do you think happens?

A model generates answers, and a human labeler adds labels using knowledge the model lacks. Does the next training round reliably improve the model?

  • Yes, because human labels are always better than model output

  • No, because the labels can carry information the model cannot reproduce, so it learns to answer without grounds

Reveal answer
Answer:

No, because the labels can carry information the model cannot reproduce, so it learns to answer without grounds.

The same flywheel logic can fail with human annotations. A label that looks correct to a person but depends on knowledge outside the model's inputs teaches the model to produce answers it cannot justify.

MEDIUM

A team plans to generate 50,000 synthetic patient records to train a model. Using the three design criteria, list what you would decide before generating and what check each generated record must pass.

Hints
  • Start with the behavior the model should learn, not the number of records.
  • Consider whether the records cover the range of situations the model must handle.
  • Ask how each record will be judged before it reaches the training set.

Key Takeaways

  • Real records containing sensitive information, such as patient records and insurance claims, can be restricted from training, and in healthcare legislation makes this hard if not impossible.
  • Synthetic data is generated to mimic real data without containing sensitive information, and is often the only option where human-generated data cannot be used because of privacy concerns.
  • Quality, coverage, and quantity are the three core dataset design criteria, and a small amount of high-quality data can outperform a large amount of noisy data.
  • Generated data must be evaluated for quality before training, and the data flywheel only improves a model when the feedback it reuses is reliable.

Related concepts

More concepts starting with G