Synthetic Data and Self-Improvement: When Models Make Data, and When It Collapses
Synthetic data is generated by a model or a program and then used for training. It keeps helping only with an outside signal: a verifier, a stronger teacher or fresh real data. Two experiments show recursive training losing the tail and only a verifier letting self-training bootstrap.
After this page you will be able to
- Tell the five recipes for synthetic data apart, and say for each one who guarantees quality and where the ceiling is.
- Explain model collapse with finite-sample resampling: a symbol of probability p vanishes from n samples with probability (1-p) to the power n, and check the closed form with code.
- Compare replacing, mixing in fresh data and accumulating, and say why accumulating does not collapse and what it cannot recover.
- Read from the experiment where the information in self-improvement comes from: a real verifier adds information, while a weak verifier, majority voting and unfiltered self-training add almost none.
- List what to check before putting synthetic data into a training pipeline.
On this page
- Where synthetic data comes from: five recipes
- Where the information comes from
- Experiment 1: how recursive training loses the tail of a distribution
- Experiment 2: who supplies the signal for self-training
- Putting it into a training pipeline: a checklist
- Summary and exercises
- Quick self-check
- Further reading
- FAQ
Synthetic data is data generated by a model or a program and then used to train a model: a strong model writing answers to instructions, a model posing its own problems and solving them, a program producing math problems with known answers, or web pages rewritten in the style of a textbook. Human-written high-quality text is finite. Villalobos et al. (2022) estimated that, on the trends of the time, training sets would grow to about the size of the stock of public human text between 2026 and 2032. So post-training today hardly works without synthetic data; the Nemotron-4 340B report says that over 98% of its alignment data is synthetic.
“The model generates and the model learns” comes with two traps. First, a model can only write what is already in its distribution: training on its own output adds no information, and because of the randomness of finite samples it keeps losing the tail of the distribution. This is model collapse. Second, errors get amplified: without a check, the model’s systematic mistakes are learned as “labels”. So the question is never whether to use synthetic data, but where the information comes from: a verifier, a stronger teacher, fresh real data, or human selection.
This page measures that with two reproducible small experiments, both on a CPU. Experiment 1 refits a Zipf distribution to samples from the previous generation, again and again, to see how the vocabulary shrinks and which data policy stops it. Experiment 2 teaches a Transformer with only 100,000 parameters to add two-digit numbers and compares five ways of self-training: only a real verifier lifts test accuracy from 0.281 to 1.000, and the others stay near where they started. Both experiments are toy scale, so the conclusions are about mechanisms, not numbers for real large models; evidence from real systems is given where it belongs, with its source.
Where synthetic data comes from: five recipes
| Recipe | Where the data comes from | Who guarantees quality | Main risk |
|---|---|---|---|
| Teacher distillation and instruction generation | A stronger model writes answers, or rewrites and expands seed instructions | The teacher’s ability, plus rule and similarity filters | The ceiling is the teacher; its errors and style come along |
| Bootstrapping on verifiable tasks | The model samples several solutions per problem and keeps those a verifier accepts | A verifier: answer check, unit tests, prover | A leaky verifier gets exploited; problems the model cannot solve yield no data |
| Label-free self-consistency | Sample several times and use the majority answer as the label | No outside signal; relies on “the majority is more reliable” | Systematic errors are amplified by the vote |
| Model as judge | The model scores its own answers, then preference optimization | The judge model’s opinion | The judge’s biases (favoring length, favoring itself) get amplified |
| Synthesis and rewriting for pretraining | Web pages rewritten as textbooks or Q&A, or generated textbooks and exercises | The rewriting model and the selection rules | Less diversity; factual errors written into the “textbook” |
Each recipe has published results. Only numbers stated in the paper abstracts are listed here:
- Teacher distillation and instruction generation. Self-Instruct (Wang et al., 2022) has GPT-3 generate instructions, inputs and outputs, filters out invalid and similar ones, and fine-tunes the original model; on Super-NaturalInstructions it improves on the original model by 33% absolute, on par with InstructGPT-001, which was trained on private human data. WizardLM (Xu et al., 2023) uses Evol-Instruct to rewrite instructions step by step into more complex ones. Orca (Mukherjee et al., 2023) trains a 13B model on GPT-4’s explanation traces and beats Vicuna-13B by more than 100% on Big-Bench Hard. Magpie (Xu et al., 2024) observed that an aligned model, given only the template up to the user message, writes the user’s question by itself; they generated 4 million instructions with responses from Llama-3-Instruct and selected 300K.
- Bootstrapping on verifiable tasks. STaR (Zelikman et al., 2022) has the model write a rationale; for wrong answers it is given the correct answer and asked to rationalize; it fine-tunes only on rationales that end in a correct answer and repeats, matching a fine-tuned model 30 times larger on CommonsenseQA. ReST-EM (Singh et al., 2023) uses PaLM-2 on MATH and APPS: sample, filter with binary feedback, fine-tune, repeat, and clearly beats fine-tuning on human data alone. DeepSeek-R1 keeps about 600,000 correct and readable reasoning samples from rejection sampling (see the R1 write-up); in Llama 3, about one million code dialogs come from execution feedback (see the Llama 3 write-up).
- Label-free self-consistency. Huang et al. (2022) use chain of thought with self-consistency to produce “high-confidence” solutions for unlabeled questions and fine-tune a 540B PaLM on them: GSM8K goes from 74.4% to 82.1%, DROP from 78.2% to 83.0%, OpenBookQA from 90.0% to 94.4% and ANLI-A3 from 63.4% to 67.9%.
- Model as judge. Self-Rewarding Language Models (Yuan et al., 2024) have the model score its own answers with LLM-as-a-Judge prompting; three iterations of DPO on Llama 2 70B beat Claude 2, Gemini Pro and GPT-4 0613 on AlpacaEval 2.0.
- Synthesis and rewriting for pretraining. phi-1 (Gunasekar et al., 2023) has 1.3B parameters and is trained on 6B tokens of “textbook quality” web data plus 1B tokens of textbooks and exercises generated by GPT-3.5, for 4 days on 8 A100s; it reaches 50.6% pass@1 on HumanEval and 55.5% on MBPP. WRAP (Maini et al., 2024) uses an off-the-shelf instruction-tuned model to rephrase C4 web pages in styles such as “like Wikipedia” or question-and-answer, pretrains on real and rephrased data together, and speeds up pretraining by about 3 times.
All five share one structure: generate, filter, train, then loop. They differ only in what the filter relies on: the teacher’s ability, a verifier, a majority vote, a judge or a rewriting model. The filter is the one place in the system that can bring in new information; the other is fresh real data. The next section spells that out.
Where the information comes from
Write one round of self-training as: a model generates data , a filter selects from it, and training gives . New information can enter from only three places:
- Outside knowledge in the filter : a verifier, a stronger teacher, human selection.
- Fresh real data: samples mixed in each round that did not write.
- Inductive bias that was there before training: architecture, initialization and regularization decide how a model generalizes from finite data.
With none of the three, is a noisy copy of : unchanged in expectation, drifting in practice. There are two sources of drift.
Finite samples lose the tail. A symbol of probability fails to appear in samples with probability
Once a symbol disappears from one generation’s data, the next model gives it probability 0, and so does every later one: disappearance is an absorbing state. For the whole distribution, the expected real probability mass that a new data set misses is
Continuous distributions behave the same way. Fitting a Gaussian by maximum likelihood on samples gives a biased variance estimate: . If every generation samples from the Gaussian fitted by the previous one and refits, after generations
so the variance shrinks on average by a factor of per generation.
Errors get amplified. If a model makes systematic mistakes on some class of problems and makes them confidently, those wrong answers dominate both samples and majority votes and are trained into the next generation as “labels”: it learns its own bias. Experiment 2 measures this.
The literature has three data policies, and Experiment 1 compares all of them:
| Policy | Training data of each generation | What the literature found |
|---|---|---|
| Replace | Only data generated by the previous generation | Shumailov et al. (2023): tails vanish in VAEs, Gaussian mixtures and language models; they call it model collapse |
| Mix in fresh data | Previous generation’s data plus some fresh real data | Alemohammad et al. (2023, image generators): without enough fresh real data in each generation, quality (precision) or diversity (recall) declines generation by generation |
| Accumulate | The original real data plus the data of all earlier generations | Gerstgrasser et al. (2024): accumulating avoids collapse; in linear models the test error has an upper bound independent of the number of generations |
Experiment 1: how recursive training loses the tail of a distribution
The “real world” is a Zipf law over 1,000 symbols (probability proportional to ; the most common symbol has 0.134, the rarest ). Generation 0 fits the empirical distribution of real samples; every later generation draws samples from the distribution fitted by the previous one and fits again. Fitting is maximum likelihood, that is, taking empirical frequencies, so the symbols a model can “still write” are those with a count above zero. Two metrics: the number of symbols still alive, and the share of real probability mass sitting on symbols the model can no longer write (lost mass).
Environment: Apple M2 Max, Python 3.14.3, NumPy 2.4.2, CPU only, about a minute. Drawing real data, synthetic data and fresh data each use an independent random stream; every setting runs 20 chains (20 seeds) and reports the mean.
import numpy as np
V, G, SEEDS = 1000, 100, 20
p = 1.0 / np.arange(1, V + 1)
p /= p.sum() # real world: a Zipf law over 1000 symbols
print(f"most common symbol {p[0]:.3f}, rarest {p[-1]:.1e}")
def stats(q):
"""Symbols the model can still write; real mass it can no longer write."""
return int((q > 0).sum()), float(p[q == 0].sum())
def run(n, mode, seed, frac=0.1):
"""G generations; each one fits the empirical distribution of its data."""
r_real, r_syn, r_fresh = (np.random.default_rng(s)
for s in np.random.SeedSequence(seed).spawn(3))
pool = r_real.multinomial(n, p) # generation 0: n real samples
q = pool / n
out = [stats(q)]
k = int(frac * n) if mode == "fresh" else 0
for _ in range(G):
data = r_syn.multinomial(n - k, q) # the model writes the data
if k:
data = data + r_fresh.multinomial(k, p) # 10% fresh real data
if mode == "accumulate": # keep everything ever seen
pool = pool + data
q = pool / pool.sum()
else: # train on this generation only
q = data / n
out.append(stats(q))
return np.array(out)
most common symbol 0.134, rarest 1.3e-04
run implements the three policies: replace fits only this generation’s data, fresh swaps 10% of the positions for fresh real samples every generation, and accumulate keeps the data of all generations.
GENS = range(0, G + 1, 10)
MODES = ("replace", "fresh", "accumulate")
curve = {m: np.mean([run(10_000, m, s) for s in range(SEEDS)], axis=0)
for m in MODES}
print(f"n = 10,000 samples per generation, mean of {SEEDS} chains")
for j, title, fmt in ((0, "alive symbols (of 1000)", "{:6.0f}"),
(1, "missing real mass", "{:6.3f}")):
print(f"\n{title}")
print(f"{'generation':11s}" + "".join(f"{g:6d}" for g in GENS))
for m in MODES:
print(f"{m:11s}" + "".join(fmt.format(curve[m][g, j]) for g in GENS))
n = 10,000 samples per generation, mean of 20 chains
alive symbols (of 1000)
generation 0 10 20 30 40 50 60 70 80 90 100
replace 906 434 304 238 197 169 149 133 121 112 104
fresh 906 695 689 690 683 689 689 696 695 693 693
accumulate 906 906 906 906 906 906 906 906 906 906 906
missing real mass
generation 0 10 20 30 40 50 60 70 80 90 100
replace 0.018 0.157 0.224 0.267 0.303 0.331 0.354 0.372 0.389 0.404 0.417
fresh 0.018 0.068 0.071 0.070 0.072 0.071 0.070 0.069 0.069 0.069 0.069
accumulate 0.018 0.018 0.018 0.018 0.018 0.018 0.018 0.018 0.018 0.018 0.018
How to read the numbers:
- Generation 0 has already lost some tail. 10,000 real samples leave only 906 symbols “alive” and lose 0.018 of the mass; the closed form predicts 0.0171, and the simulated generation 0 gives 0.0177 (see the table below). Fewer samples make it worse: with the very first fit already loses 0.211 of the real mass.
- Replace: the vocabulary keeps shrinking and never comes back. 906 symbols become 434 after 10 generations and 104 after 100; the lost mass climbs from 0.018 to 0.157 and then to 0.417. The first 10 generations fall fastest, because the rarest symbols are the first to drop out of the samples.
- Mixing in 10% fresh data: the decline stops, at a worse plateau. The number of live symbols settles near 693 and the lost mass near 0.069, about 4 times the 0.018 of generation 0: 1,000 fresh samples per generation cannot restore a tail that took 10,000 samples to cover.
- Accumulate: the numbers do not move at all. That is by construction: the pool always contains the real sample of generation 0, so no symbol that ever appeared can be lost. Accumulating preserves what the real sample had; it cannot restore the 94 symbols that sample never contained. Its benefit is that things stop getting worse, not that the real distribution is recovered.
print("replace: the effect of n; closed form = sum_i p_i (1 - p_i)^n")
print(f"{'n':>8s}{'closed form':>13s}{'gen 0':>8s}"
f"{'alive at 100':>14s}{'missing at 100':>16s}")
for n in (1_000, 10_000, 100_000):
m = np.mean([run(n, "replace", s) for s in range(SEEDS)], axis=0)
exact = float((p * (1 - p) ** n).sum())
print(f"{n:8d}{exact:13.3g}{m[0, 1]:8.3g}{m[G, 0]:14.0f}{m[G, 1]:16.3f}")
replace: the effect of n; closed form = sum_i p_i (1 - p_i)^n
n closed form gen 0 alive at 100 missing at 100
1000 0.209 0.211 16 0.732
10000 0.0171 0.0177 104 0.417
100000 1.48e-08 0 492 0.136
- More samples per generation only postpone it. With generation 0 loses almost nothing (closed form ), yet after 100 generations only 492 symbols are left and 0.136 of the mass is lost; with only 16 symbols survive 100 generations. The
closed formcolumn is and agrees with the simulated generation 0 in each row.
The continuous case is checked with the same idea: every generation fits a mean and a standard deviation by maximum likelihood and samples the next one; the true standard deviation is 1.
def gauss_chain(n, gens, trials, seed=0):
"""Fit mean and std (MLE) to n samples, then sample the next generation."""
rng = np.random.default_rng(seed)
mu, sd = np.zeros(trials), np.ones(trials)
for _ in range(gens):
x = rng.normal(mu[:, None], sd[:, None], size=(trials, n))
mu, sd = x.mean(1), x.std(1)
return sd
GENS_G, TRIALS = 50, 20_000
print(f"Gaussian, true std 1, {GENS_G} generations, {TRIALS} chains")
print(f"{'n':>6s}{'mean var':>10s}{'s.e.':>8s}{'formula':>9s}"
f"{'median std':>12s}{'P(std<0.5)':>12s}")
for n in (50, 200, 1000):
sd = gauss_chain(n, GENS_G, TRIALS)
f = ((n - 1) / n) ** GENS_G
se = (sd ** 2).std() / TRIALS ** 0.5
print(f"{n:6d}{(sd ** 2).mean():10.3f}{se:8.3f}{f:9.3f}"
f"{np.median(sd):12.3f}{(sd < 0.5).mean():12.3f}")
Gaussian, true std 1, 50 generations, 20000 chains
n mean var s.e. formula median std P(std<0.5)
50 0.362 0.006 0.364 0.361 0.674
200 0.784 0.004 0.778 0.783 0.107
1000 0.953 0.002 0.951 0.955 0.000
- The mean variance matches the formula, but the typical chain loses more. With , the mean variance after 50 generations is 0.362 (standard error 0.006) against the formula ; and also agree within two standard errors. But the mean is pulled up by a few lucky chains: with the median standard deviation is only 0.361, and a fraction of 0.674 of the chains already has a standard deviation below 0.5.
Limits: this is a toy with discrete symbols and a Gaussian, with no neural network and none of the inductive bias of “learning”; in real language models the speed of collapse depends on how the model generalizes and how data are deduplicated and mixed. What this measures is the mechanism: finite samples plus recursion mean the tail is bound to leak away.
The widget below makes these tables draggable: pick a strategy and drag the generations to watch the alive symbols and the lost mass; then pick the per-generation sample size n to compare the closed form against the measured loss at generation 0 — more samples only delay the loss.
Experiment 2: who supplies the signal for self-training
Experiment 1 has no right or wrong, only distributions. Experiment 2 adds correctness: a small Transformer learns two-digit addition, and we watch what self-training does under different filtering rules.
- Task. The prompt is
ab+cd=and the answer is the sum as 3 digits, least significant digit first (so carries propagate in the direction of generation). The 10,000 problems are split into three disjoint parts: 1,000 for testing, 500 labeled, and a pool of 4,000 unlabeled problems. - Model. A Transformer with 2 layers, width 64 and 4 heads (parameter count in the output below), trained from scratch for 1,500 steps (AdamW, learning rate , batch size 128). 500 labeled examples sit right between “learns the carry algorithm” and “only memorizes”: the base model’s accuracy averages 0.281 with a standard deviation of 0.078 across seeds.
- Self-training. In each round the current model samples answers for every pool problem (temperature 1, only digits allowed in the answer), a rule filters them, the result is merged with the 500 labeled examples, and the next model is trained from scratch; 4 rounds in all. Five rules:
| Name | Samples per problem | What is kept | Where the labels come from |
|---|---|---|---|
verifier | 4 | A problem is kept if some sample is judged correct | The model’s own sample, checked from outside |
units-only | 4 | A problem is kept if some sample has the right units digit | Same, but a weak verifier |
majority | 8 | The most common answer, kept only if at least half agree | The model’s own majority vote, no outside signal |
unfiltered | 1 | Everything | One sample from the model |
self-only | 1 | Everything, and the 500 labeled examples are no longer mixed in | Entirely the model’s own data (the “replace” of Experiment 1) |
- Controls.
controlretrains on the same 500 examples with a new initialization each time, which measures the noise floor;oraclegives the pool its true answers and is the upper bound, but it needs the answers themselves, while a verifier only has to judge whether an answer is right.
Environment: Apple M2 Max, Python 3.14.3, PyTorch 2.10.0, CPU only (4 threads); 5 seeds, each seed fixing the data split, initialization, batch order and sampling (the last three use different random streams). A full run takes about 48 minutes.
import random
import numpy as np
import torch
import torch.nn.functional as F
from torch import nn
torch.set_num_threads(4)
V, PLEN, ALEN = 12, 6, 3 # tokens: digits 0-9, "+" is 10, "=" is 11
N_LAB, N_POOL, N_TEST = 500, 4000, 1000
STEPS, ROUNDS, SEEDS = 1500, 4, 5
def make(pairs):
"""Prompt "ab+cd=", answer: the sum as 3 digits, least significant first."""
prompts, answers = [], []
for a, b in pairs:
prompts.append([a // 10, a % 10, 10, b // 10, b % 10, 11])
s = a + b
answers.append([s % 10, s // 10 % 10, s // 100])
return torch.tensor(prompts), torch.tensor(answers)
class Net(nn.Module):
def __init__(self, d=64, layers=2, heads=4):
super().__init__()
self.tok = nn.Embedding(V, d)
self.pos = nn.Embedding(PLEN + ALEN, d)
block = nn.TransformerEncoderLayer(
d, heads, 4 * d, dropout=0.0, activation="gelu",
batch_first=True, norm_first=True)
self.body = nn.TransformerEncoder(
block, layers, enable_nested_tensor=False)
self.norm, self.head = nn.LayerNorm(d), nn.Linear(d, V)
def forward(self, x):
n = x.shape[1]
mask = torch.triu(torch.ones(n, n, dtype=torch.bool), 1)
h = self.tok(x) + self.pos(torch.arange(n))
return self.head(self.norm(self.body(h, mask=mask)))
print("parameters:", sum(p.numel() for p in Net().parameters()))
parameters: 102220
train trains from scratch and the loss only looks at the answer part; decode decodes greedily (for evaluation) or draws samples at temperature 1.
def train(prompts, answers, seed):
"""Train from scratch; the loss only looks at the answer tokens."""
torch.manual_seed(seed)
net = Net()
opt = torch.optim.AdamW(net.parameters(), lr=3e-3, weight_decay=0.01)
sched = torch.optim.lr_scheduler.OneCycleLR(
opt, 3e-3, total_steps=STEPS, pct_start=0.1)
data = torch.cat([prompts, answers], 1)
gen = torch.Generator().manual_seed(10_000 + seed) # batch order
for _ in range(STEPS):
x = data[torch.randint(len(data), (128,), generator=gen)]
logits = net(x[:, :-1])[:, PLEN - 1:]
loss = F.cross_entropy(logits.reshape(-1, V), x[:, PLEN:].reshape(-1))
opt.zero_grad()
loss.backward()
opt.step()
sched.step()
return net
@torch.no_grad()
def decode(net, prompts, k=0, gen=None):
"""k = 0: greedy, shape (M, 3). k > 0: k samples at T=1, shape (M, k, 3)."""
x = prompts.repeat_interleave(max(k, 1), 0)
for _ in range(ALEN):
logits = net(x)[:, -1]
if k:
logits[:, 10:] = -1e9 # only digits are legal answer tokens
nxt = torch.multinomial(F.softmax(logits, -1), 1, generator=gen)
else:
nxt = logits.argmax(-1, keepdim=True)
x = torch.cat([x, nxt], 1)
out = x[:, PLEN:]
return out.reshape(len(prompts), k, ALEN) if k else out
def accuracy(net, prompts, answers):
return (decode(net, prompts) == answers).all(1).float().mean().item()
Each of the five rules is a small function: the input is samples per problem and the output is “which problems to keep, and with what label”. Note that verified and units_only only use the true answer to judge “right or wrong”; they never hand the answer itself to the model.
def verified(S, truth):
"""Keep a problem if some sample is correct (the verifier says yes/no)."""
ok = (S == truth[:, None]).all(2)
first = ok.int().argmax(1)
return ok.any(1), S[torch.arange(len(S)), first]
def units_only(S, truth):
"""A weak verifier: it only checks the units digit."""
ok = S[..., 0] == truth[:, None, 0]
first = ok.int().argmax(1)
return ok.any(1), S[torch.arange(len(S)), first]
def vote(S):
"""Most common answer per problem and how many samples gave it."""
code = S[..., 0] + 10 * S[..., 1] + 100 * S[..., 2]
votes = torch.zeros(len(S), 1000, dtype=torch.long)
top, arg = votes.scatter_add_(1, code, torch.ones_like(code)).max(1)
return top, torch.stack([arg % 10, arg // 10 % 10, arg // 100], 1)
def majority(S, truth=None):
"""Label-free: keep the most common answer if at least half agree."""
top, label = vote(S)
return top * 2 >= S.shape[1], label
def unfiltered(S, truth=None):
return torch.ones(len(S), dtype=torch.bool), S[:, 0]
COND = { # name: (filter, samples per problem, keep the labeled seed data?)
"verifier": (verified, 4, True),
"units-only": (units_only, 4, True),
"majority": (majority, 8, True),
"unfiltered": (unfiltered, 1, True),
"self-only": (unfiltered, 1, False),
}
The main loop: for each seed, train the base model and a few retrained controls, then run 4 rounds for each of the five rules, and finally train the oracle.
def one_seed(seed):
rng = random.Random(seed)
pairs = [(a, b) for a in range(100) for b in range(100)]
rng.shuffle(pairs)
test = make(pairs[:N_TEST])
lab = make(pairs[N_TEST:N_TEST + N_LAB])
pool = make(pairs[N_TEST + N_LAB:N_TEST + N_LAB + N_POOL])
gen = torch.Generator().manual_seed(20_000 + seed) # sampling
base = train(*lab, seed)
res = {"base": accuracy(base, *test)}
# noise floor: same labeled data, new initialization each time
res["control"] = [accuracy(train(*lab, seed + 100 * r), *test)
for r in range(1, ROUNDS + 1)]
for name, (keep_fn, k, anchor) in COND.items():
net, hist = base, []
for r in range(ROUNDS):
S = decode(net, pool[0], k, gen)
keep, label = keep_fn(S, pool[1])
right = (label == pool[1]).all(1)
if name == "majority" and r == 0:
top, lab8 = vote(S)
ok8 = (lab8 == pool[1]).all(1)
res["agree"] = [(int((top >= a).sum()),
ok8[top >= a].float().mean().item()
if (top >= a).any() else 0.0)
for a in range(4, 9)]
prec = right[keep].float().mean().item() if keep.any() else 0.0
prompts, answers = pool[0][keep], label[keep]
if anchor:
prompts = torch.cat([lab[0], prompts])
answers = torch.cat([lab[1], answers])
net = train(prompts, answers, seed)
hist.append((accuracy(net, *test), int(keep.sum()), prec))
res[name] = hist
both = [torch.cat([lab[i], pool[i]]) for i in (0, 1)]
res["oracle"] = accuracy(train(*both, seed), *test)
return res
runs = []
for seed in range(SEEDS):
runs.append(one_seed(seed))
r = runs[-1]
print(f"seed {seed}: base {r['base']:.3f}, oracle {r['oracle']:.3f}, "
f"verifier {' '.join(f'{h[0]:.3f}' for h in r['verifier'])}")
seed 0: base 0.298, oracle 1.000, verifier 0.884 1.000 1.000 1.000
seed 1: base 0.165, oracle 1.000, verifier 0.924 0.995 0.998 1.000
seed 2: base 0.250, oracle 1.000, verifier 0.882 0.999 1.000 1.000
seed 3: base 0.370, oracle 1.000, verifier 0.976 1.000 1.000 1.000
seed 4: base 0.324, oracle 1.000, verifier 0.972 1.000 1.000 1.000
def cell(xs):
return f"{np.mean(xs):.3f}±{np.std(xs, ddof=1):.3f}"
def row(name, per_round):
print(f"{name:12s}" + "".join(f"{cell(x):>13s}" for x in per_round))
base = [r["base"] for r in runs]
init = [np.std([r["base"]] + r["control"], ddof=1) for r in runs]
print(f"std over {ROUNDS + 1} initializations of the same {N_LAB} examples: "
f"{np.mean(init):.3f}")
print(f"std of the base model over {SEEDS} seeds: "
f"{np.std(base, ddof=1):.3f}")
print(f"\ntest accuracy, mean±std over {SEEDS} seeds")
print(f"{'round':12s}" + "".join(f"{i:>13d}" for i in range(ROUNDS + 1)))
row("control", [base] + [[r["control"][i] for r in runs]
for i in range(ROUNDS)])
for name in COND:
row(name, [base] + [[r[name][i][0] for r in runs]
for i in range(ROUNDS)])
print(f"oracle (true labels for the whole pool): "
f"{cell([r['oracle'] for r in runs])}")
for title, col, fmt in (
(f"problems kept (of {N_POOL}), mean over seeds", 1, "{:8.0f}"),
("precision of the kept labels, mean over seeds", 2, "{:8.3f}")):
print(f"\n{title}")
print(f"{'round':12s}" + "".join(f"{i + 1:>8d}" for i in range(ROUNDS)))
for name in COND:
vals = [np.mean([r[name][i][col] for r in runs])
for i in range(ROUNDS)]
print(f"{name:12s}" + "".join(fmt.format(v) for v in vals))
print("\nbase model, 8 samples per problem; n = problems where >= a agree")
print(f"{'a':>3s}{'n':>8s}{'precision':>11s}")
for i, a in enumerate(range(4, 9)):
n = np.mean([r["agree"][i][0] for r in runs])
p = np.mean([r["agree"][i][1] for r in runs])
print(f"{a:3d}{n:8.0f}{p:11.3f}")
std over 5 initializations of the same 500 examples: 0.092
std of the base model over 5 seeds: 0.078
test accuracy, mean±std over 5 seeds
round 0 1 2 3 4
control 0.281±0.078 0.291±0.117 0.243±0.111 0.237±0.058 0.317±0.091
verifier 0.281±0.078 0.928±0.046 0.999±0.002 1.000±0.001 1.000±0.000
units-only 0.281±0.078 0.297±0.072 0.300±0.076 0.297±0.067 0.299±0.067
majority 0.281±0.078 0.277±0.080 0.277±0.082 0.277±0.075 0.281±0.075
unfiltered 0.281±0.078 0.280±0.076 0.271±0.079 0.273±0.067 0.273±0.069
self-only 0.281±0.078 0.257±0.081 0.248±0.079 0.254±0.084 0.263±0.077
oracle (true labels for the whole pool): 1.000±0.000
problems kept (of 4000), mean over seeds
round 1 2 3 4
verifier 1394 3816 3998 4000
units-only 3861 3992 4000 4000
majority 3896 3983 3992 3994
unfiltered 4000 4000 4000 4000
self-only 4000 4000 4000 4000
precision of the kept labels, mean over seeds
round 1 2 3 4
verifier 1.000 1.000 1.000 1.000
units-only 0.290 0.289 0.289 0.289
majority 0.284 0.283 0.284 0.285
unfiltered 0.275 0.273 0.271 0.271
self-only 0.274 0.273 0.271 0.270
base model, 8 samples per problem; n = problems where >= a agree
a n precision
4 3896 0.284
5 3589 0.291
6 3189 0.300
7 2742 0.310
8 2073 0.325
How to read the numbers:
- The base model is weak and noisy. Trained on 500 labeled examples, it solves 0.281 of the test problems on average, and the standard deviation across the 5 seeds is 0.078. Retraining the same 500 examples with a new initialization moves the accuracy by a standard deviation of 0.092, so the
controlrow wobbles between 0.237 and 0.317 although nothing changed. In this experiment, differences of a few hundredths are noise. - A verifier turns 500 labeled examples into full mastery. In round 1,
verifierkeeps 1,394 of the 4,000 pool problems (those with at least one correct sample out of 4), and every kept label is correct (precision 1.000). Test accuracy goes from 0.281 to 0.928, then 0.999 in round 2 and 1.000 in round 4, equal to theoracle, which was trained on true answers for all 4,000 problems. This is the bootstrap of STaR and ReST-EM: a model that is right only occasionally can still teach itself, provided something outside it says which samples were right. - It takes several rounds because the early rounds have little to keep. Round 1 yields data for 1,394 problems; the stronger model of round 2 yields 3,816, and rounds 3 and 4 yield 3,998 and 4,000. The verifier is exact in every round (precision 1.000); what grows is how many problems the current model can solve at least once.
- A weak verifier does not help.
units-onlyaccepts a sample if its units digit is right. The base model usually gets that digit right, so nearly every problem is kept (3,861 of 4,000), but only 0.290 of the kept labels are fully correct, barely above the model’s own accuracy, and test accuracy stays at 0.297 to 0.300, inside the noise ofcontrol. What matters is whether the check rules out the mistakes the model actually makes (here, the other digits), not whether a check exists. - A majority vote cannot separate right from wrong when the model is confidently wrong.
majoritykeeps 3,896 problems with label precision 0.284, the same as the base model’s accuracy of 0.281: the most common answer is right no more often than a single sample. The agreement table shows why: even for the 2,073 problems on which all 8 samples agree, only 0.325 of the answers are right, so agreement measures the model’s consistency, not its correctness. Majority voting helps when the correct answer is the most frequent one more often than a single sample is correct, as with the large models in Huang et al. (2022); a base model that is mostly wrong gets nothing from it. - Unfiltered and self-only training reproduce the base model.
unfilteredends at 0.273 with label precision 0.271, so its labels are as wrong as the model.self-only, which also drops the 500 labeled examples (the “replace” policy of Experiment 1), ends at 0.263. Both differences from the base model’s 0.281 are much smaller than the seed-to-seed standard deviation of those rows (0.069 and 0.077), so I do not read them as measured declines; what is certain is that neither learns anything. - The comparison is controlled.
verifier,units-only,majority,unfilteredandself-onlyshare the model, the data, the number of rounds and the training recipe; only the filter differs, and the filter is where outside information enters. Theoraclerow (1.000) says that the task is learnable from this much data once the labels are right.
Limits: the task is a toy whose algorithm (carrying) can be learned, the verifier is exact, and the 500 labeled examples were chosen to sit near the learning threshold, with 5 seeds. A real verifier has false positives, real problems have many solution paths, and real samples are more diverse. The experiment shows the mechanism, not the size of the gain you would see on a large model.
Putting it into a training pipeline: a checklist
| Question | Practice | Evidence |
|---|---|---|
| Where does the new information in this batch come from? | Write down the outside signal in the filter: verifier, teacher, humans; if you cannot name one, do not expect an improvement | Experiment 2; Llama 3 report: the 405B model gained nothing from its own data, execution feedback made it work |
| Is the verifier reliable? | Measure its false-positive rate on held-out labeled data and prefer executable checks; a verifier that only checks what the model already does is no verifier | units-only in Experiment 2; the exploited verifier in test-time compute |
| Is the real data still there? | Never replace real data with synthetic data: accumulate, or mix enough fresh real samples into every generation, and keep the original real data | Experiment 1; Gerstgrasser et al. (2024), Alemohammad et al. (2023) |
| Is diversity holding up? | Watch the tail: number of distinct words, coverage of rare topics, n-gram repetition; use many seed instructions and filter near-duplicates | Experiment 1; Self-Instruct filters invalid and similar samples |
| Is the eval set clean? | Decontaminate synthetic data too, evaluate on independent human-written held-out sets, and do not let the same teacher write the questions and grade them | Building eval sets, data engineering |
| Do the teacher’s terms allow it? | Before generating training data with someone else’s model, read its terms of use: some services restrict training other models on their outputs | The terms of each service |
Two rules of thumb: start small, closing the loop of generate, filter, train and evaluate on a small model before scaling the data up; and print the filter statistics of every round (how many kept, label precision, diversity). The two tables kept and precision in Experiment 2 are exactly such a dashboard, and they expose trouble earlier than the final accuracy does.
Summary and exercises
- Self-training only gets stronger when new information enters: an outside verifier, a stronger teacher, fresh real data. Without them the model copies itself and accumulates random error.
- Recursive replacement loses the tail of the distribution: a symbol of probability vanishes from samples with probability and does not come back; in Experiment 1, with 10,000 samples per generation, 100 generations leave 104 of 1,000 symbols.
- Accumulating stops losing symbols but cannot recover those missing at generation 0; mixing in 10% fresh data stops the decline, at a worse plateau (0.069 lost, against 0.018 at generation 0).
- In Experiment 2 only the verifier’s information raised test accuracy (0.281 to 1.000 in four rounds). A verifier that checks only the units digit, a majority vote, unfiltered self-training and self-only training all stayed near the base model, because the labels they kept were as wrong as the model itself (label precision 0.289, 0.285, 0.271 and 0.270 in round 4).
- The first question in practice is “where does the new information come from”, and the second is “is the real data still there”.
Quick self-check
1. In Experiment 1, why does a symbol that has vanished from one generation never come back under the replace policy?
- The model deliberately forgets low-probability symbols to save capacity
- The next generation is fitted to samples that do not contain it, so it assigns probability 0, and every later generation samples from a distribution without it
- A verifier filters rare symbols out
- Rounding errors in the floating-point probabilities
Maximum-likelihood fitting gives each symbol its empirical frequency, so a count of 0 becomes a probability of 0. Disappearance is an absorbing state, and a symbol of probability is missing from samples with probability .
2. Which policy keeps the number of live symbols at its generation 0 value in Experiment 1, and why can it not do better?
- Replace, because each generation is a fresh sample
- Mixing in 10% fresh data, because fresh data restores the whole tail
- Accumulate, because the pool always contains the real sample, but symbols that sample never contained stay missing
- None of them
Accumulating never loses a symbol that is already in the pool, so the count stays at 906. The 94 symbols that the real sample at generation 0 did not contain are never recovered.
3. In Experiment 2, majority keeps 3,896 of 4,000 problems, yet accuracy does not move. What explains it?
- The vote threshold is so strict that too few problems are kept
- The model’s mistakes are consistent, so the most common answer is right only about as often as a single sample (precision 0.284 against 0.281)
- Majority voting needs a verifier to run
- Eight samples are too few for a vote
Even for the 2,073 problems on which all 8 samples agree, only 0.325 of the answers are right: agreement measures consistency, not correctness.
4. A teammate proposes filtering synthetic data by the model’s own confidence. What does Experiment 2 suggest?
- It is as good as a verifier, because confident answers are usually right
- Not by itself: confidence comes from the model and adds no outside information, and label precision rose only from 0.284 to 0.325 as agreement went from 4 of 8 samples to 8 of 8
- It only works for small models
- It works as long as the model trains for more steps
A signal that comes from the model cannot tell you where the model is wrong. A check that does not depend on the model, such as an answer key or a unit test, can.
5. Which of these add new information to a self-training loop?
- A unit-test runner that accepts or rejects generated code
- Fresh human-written examples mixed in every round
- Taking the majority answer of many samples
- Retraining from scratch with a different random seed
New information has to come from outside the model: a verifier or fresh real data. A majority vote and a new initialization only reshuffle what the model already knows; the
controlrow retrains with new initializations and does not move.
6. Why did verifier need several rounds to reach 1.000 instead of one?
- The learning rate decays between rounds
- Round 1 can only learn from problems where at least one of 4 samples was right (1,394 of 4,000); the better model then solves more of them in round 2 (3,816), and so on
- The verifier becomes more accurate each round
- The 500 labeled examples are dropped after round 1
The verifier is exact in every round (precision 1.000). What grows is the yield: the number of problems the current model solves at least once.
Exercises:
- A symbol of probability : what is the probability that it never appears in samples? And for ? What does this mean for long-tail knowledge?
- Fit a Gaussian by maximum likelihood on samples, sample the next generation from the fitted distribution, and repeat for 100 generations. By what factor does the expected variance shrink? Why does the typical chain lose more than this average suggests?
- Use the framework of this page to explain the Llama 3 finding: training the 405B model on its own generated data did not help, and adding execution feedback made it work. Which rule of Experiment 2 does execution feedback play?
- Hands-on: change
units_onlyin Experiment 2 so that it checks only the hundreds digit (S[..., 2]), predict the label precision and the final accuracy, then run it to find out. - Design: sketch a synthetic data pipeline for a customer-support assistant, giving for each step the source of information, the filter, how real data is kept, and how it is evaluated.
Reference answers
- , that is 0.368: in every generation there is roughly a one-in-three chance that the symbol drops out of the data; for it is , that is 4.54e-05, which almost never happens. So more data per generation slows the loss of the tail, but under “replace” every generation still has a chance to lose a symbol, and a lost symbol never returns. That is why, in Experiment 1, still leaves only 492 symbols after 100 generations.
- The formula gives a factor of , and the simulated mean variance is 0.370, in agreement; but the median standard deviation is only 0.371, so the typical chain has a variance of only , far below the mean of 0.370. The logarithm of the variance does a random walk with negative drift in each generation, and the mean is pulled up by a few chains with unusually large variance, so the “expectation” overstates the typical chain.
- Among the 405B model’s own generated data, wrong and right solutions are mixed and the model cannot tell them apart, which is Experiment 2’s
unfiltered: training brings no new information. Execution feedback (unit tests and static analysis) judges whether a piece of code is right, which is the role ofverifier: it only answers right or wrong, yet that is enough to keep the wrong ones out of the training set and let the model learn to solve more problems from the ones it already solves. The report also notes that about 20% of the solutions were initially wrong and entered the data only after being corrected with feedback. - The hundreds digit only separates “the sum is at least 100” from “it is not”, and the model is almost always right about it, so this verifier blocks almost nothing; the expected result is close to
unfiltered: nearly all problems are kept, the label precision is about the base model’s accuracy, and the final accuracy shows no clear gain. This is a prediction, not a result run for this page; run it and compare withunits-only. - A reference line of thought: the information source is the real tickets and documents in the support knowledge base, and a teacher model only rewrites them into many phrasings; the filter requires that an answer be supported by the knowledge base (retrieval plus citation checking), and removes duplicates and near-duplicate phrasings; real tickets are always kept and accumulate as new data arrives, with a cap on the share of synthetic data; evaluation uses a human-written held-out set isolated from the training data, plus sampled human review, and watches the coverage of rare question types.
These numbers can be computed with the code on this page (run after the script of Experiment 1):
for n in (10_000, 100_000):
print(f"exercise 1: n = {n}, P(a symbol with p = 1e-4 never appears) = "
f"{(1 - 1e-4) ** n:.3g}")
n, g = 100, 100
sd = gauss_chain(n, g, TRIALS)
print(f"exercise 2: formula {((n - 1) / n) ** g:.3f}, simulated mean var "
f"{(sd ** 2).mean():.3f}, median std {np.median(sd):.3f}")
exercise 1: n = 10000, P(a symbol with p = 1e-4 never appears) = 0.368
exercise 1: n = 100000, P(a symbol with p = 1e-4 never appears) = 4.54e-05
exercise 2: formula 0.366, simulated mean var 0.370, median std 0.371
Further reading
- Wang et al., Self-Instruct: Aligning Language Models with Self-Generated Instructions (2022); Xu et al., WizardLM: Empowering large pre-trained language models to follow complex instructions (2023); Mukherjee et al., Orca: Progressive Learning from Complex Explanation Traces of GPT-4 (2023); Xu et al., Magpie: Alignment Data Synthesis from Scratch by Prompting Aligned LLMs with Nothing (2024): synthesizing instruction data.
- Zelikman et al., STaR: Bootstrapping Reasoning With Reasoning (2022); Singh et al., Beyond Human Data: Scaling Self-Training for Problem-Solving with Language Models (2023, ReST-EM): bootstrapping with a verifier.
- Huang et al., Large Language Models Can Self-Improve (2022); Yuan et al., Self-Rewarding Language Models (2024): label-free self-improvement and the model as its own judge.
- Gunasekar et al., Textbooks Are All You Need (2023); Maini et al., Rephrasing the Web: A Recipe for Compute and Data-Efficient Language Modeling (2024): synthesizing and rewriting pretraining data.
- Shumailov et al., The Curse of Recursion: Training on Generated Data Makes Models Forget (2023); Alemohammad et al., Self-Consuming Generative Models Go MAD (2023); Gerstgrasser et al., Is Model Collapse Inevitable? Breaking the Curse of Recursion by Accumulating Real and Synthetic Data (2024): model collapse, and why accumulating data avoids it.
- Villalobos et al., Will we run out of data? Limits of LLM scaling based on human-generated data (2022): the stock of public human text and the demand of training.
- NVIDIA, Nemotron-4 340B Technical Report (2024): over 98% of the alignment data is synthetic, and the synthetic data pipeline is open-sourced.
- On this site: synthetic data and rejection sampling in the Llama 3 write-up and the DeepSeek-R1 write-up; rejection sampling and over-optimization in reward models; deduplication and mixing in data engineering.
FAQ
- What is synthetic data, and why does LLM training rely on it more and more?
- Synthetic data is data generated by a model or a program and then used to train a model: a strong model writing answers to instructions, a model posing its own problems and solving them, a program producing math problems with known answers, or web pages rewritten in a textbook style. Two reasons drive its use. Public high-quality human text is finite: Villalobos et al. (2022) estimated that, on the trends of the time, training sets would grow to about the size of the stock of public human text between 2026 and 2032. And many skills (reasoning traces, tool use, long context) never had ready-made human data. The Nemotron-4 340B report says that over 98% of its alignment data is synthetic.
- What is model collapse?
- Model collapse is what happens when each generation of a model is trained on the previous generation's output: the tail of the distribution (rare events, symbols and facts) disappears generation by generation and the output becomes more uniform. The cause is finite-sample resampling: a symbol of probability p fails to appear in n samples with probability (1-p) to the power n, and once it is gone the next generation gives it probability 0 for good. In Experiment 1 on this page, fitting a 1,000-symbol Zipf law to 10,000 samples per generation leaves only 104 symbols after 100 generations and loses 0.417 of the real probability mass. Shumailov et al. (2023) saw the tails vanish in variational autoencoders, Gaussian mixture models and language models.
- Can a model get stronger on its own generated data?
- It depends on whether an outside signal is present. With a reliable verifier (an answer checker, unit tests, a theorem prover) it can: in Experiment 2 on this page, verifier-filtered self-training lifts test accuracy from 0.281 to 1.000 after four rounds. Without an outside signal it learns nothing new: unfiltered self-training stays at 0.273 in round 4, and the same compute is better spent on more real data or a better verifier. The Llama 3 report says the same about its 405B model: training on its own generated data was not helpful, and execution feedback (unit tests and static analysis) is what made it work.
- How do you avoid model collapse?
- Three principles. Do not replace real data with synthetic data; keep it and accumulate (Gerstgrasser et al., 2024: accumulating gives the test error an upper bound). Mix enough fresh real data into every generation (Alemohammad et al., 2023: without it, quality or diversity declines generation after generation). Let the filter bring in outside information, such as a verifier, a stronger teacher or human review, and watch the tail of the distribution. In Experiment 1, accumulating never loses another symbol, and mixing in 10% fresh data stops the slide at a plateau that is worse than generation 0: 0.069 of the mass is lost, against 0.018 at generation 0.
- Is synthetic data the same thing as knowledge distillation?
- Distillation is one kind of synthetic data: a student model learns from data or output distributions produced by a teacher, so the ceiling is the teacher. Synthetic data also covers cases with no teacher: a model sets its own problems and solves them, then a verifier or a majority vote filters the results (the bootstrapping of STaR and ReST-EM), and programmatic data. The difference is where the information comes from: distillation draws on a teacher, bootstrapping on a verifier, and both need something outside the model.