∇
Chapter 26 · Section 26.4 · 95 min

Self-rewarding models and synthetic data

This section is about training a model on data that a model wrote. Such data is called synthetic data. Frontier labs now use a great deal of it, because it is cheap, plentiful, and can be aimed at exactly the skills a model lacks. But synthetic data is only as good as whatever decides which of it to keep. We follow that decision through three cases. First an outside check, such as a test suite, decides. Then the model judges its own work. Finally nothing checks at all.

Two results show what is at stake. The first is about a model that grades itself. In January 2024 a team at Meta fine-tuned Llama 2 70B on 3,200 human-written examples of good answers and about 1,600 examples of how to grade an answer. Then they let the model teach itself (Yuan et al. 2024), a loop that §17.5 met briefly as a form of iterative DPO. In each round the model wrote four answers to each of a few thousand new prompts. It graded its own answers on a 5-point scale and was trained to prefer its best answer over its worst. The team measured it on AlpacaEval 2.0, a set of 805 instructions on which GPT-4 compares each answer with GPT-4 Turbo's answer to the same instruction. The fraction of instructions on which GPT-4 prefers the model's answer is its win rate. Over two rounds of self-teaching the win rate went from 9.94% to 15.38% to 20.44%, ahead of Claude 2, Gemini Pro, and GPT-4 0613 on that leaderboard. Over the same rounds the average answer grew from 1,092 to 1,552 to 2,552 characters. Did the model get better, or only longer?

The second result is about the whole field. Models now write much of the text that later models train on. Some of it is deliberate. Over 98% of the data used to align Nemotron-4 340B was synthetic (NVIDIA 2024). Some of it is accidental, as the web fills with model-written pages. Shumailov et al. (2024) trained models on their own outputs, generation after generation. The models degraded, and the rare parts of the data vanished first. The authors called this model collapse, and §8.4 derived its simplest case. Then Gerstgrasser et al. (2024) proved that the error of the same loop stays bounded if each generation's data are added to the old data instead of replacing them. Both results are true. Which one describes the world depends on details you can compute.

This chapter has one lesson so far. A model can learn from its own outputs only when something tells it which outputs were good, and that something must know more than the model's own guesses. §26.1 measured that signal as the generation-verification gap, the accuracy gained by keeping only the outputs a checker accepts. §26.3 showed that training on checked outputs climbs only as far as the checker allows. In this section the checker gets weaker step by step. We compute what a filter buys and what it costs. We derive what a self-judging loop optimizes and why it drifts toward longer answers. And we prove when a loop with no checker collapses and when it does not. By the end you can design a synthetic data pipeline with numbers and defend it in an interview.

Most synthetic data comes from one loop

The loop has four steps. Sample candidate examples from a model, check them, keep what passes, and train on what you kept. §14.2 taught three versions of it that make instruction data, the prompt and response pairs a chat model is fine-tuned on.

  • Growing tasks from seeds. Start from 175 human-written tasks and have a model write new ones. Discard each new task whose wording overlaps too much with a task already in the pool (Wang et al. 2023).
  • Writing the question for a real answer. Take a human-written web document and have a model write the instruction that the document would answer (Li et al. 2023).
  • Letting a chat model invent the user. Give an aligned chat model only the opening of a chat template, the special tokens that start a user's turn. It then writes a plausible user request by itself (Xu et al. 2024).

A fourth source is distillation, in which a stronger model writes the responses that a weaker one is trained on. §8.4 showed the pretraining version, a small code model trained on textbooks that a larger model wrote (Gunasekar et al. 2023). Every one of these pipelines throws most of what it generates away, and what it keeps decides the quality.

When a synthetic dataset disappoints, find the stage that failed before you change the generator. An interviewer who asks you to design a pipeline expects all four stages and a typical failure for each.

What a filter buys, and what it costs

A verifier is any check that accepts or rejects a candidate. Two numbers describe it. Its true positive rate TPRg\mathrm{TPR}_g is the chance that it accepts a correct candidate. Its false positive rate FPRg\mathrm{FPR}_g is the chance that it accepts a wrong one. The subscript gg stands for the verifier, as in §26.1. Here is what the two numbers do to the kept data.

In general, let each candidate be correct with probability pp. The fraction of candidates the verifier accepts is the acceptance rate

A=p TPRg+(1−p) FPRg.A = p\,\mathrm{TPR}_g + (1-p)\,\mathrm{FPR}_g .

In plain words, a candidate is accepted either because it is right and passes, or because it is wrong and slips through. §26.1 proved, by Bayes' rule, that the accepted candidates are correct with probability

prec⁡=p TPRgA.\operatorname{prec} = \frac{p\,\mathrm{TPR}_g}{A}.

This is the filter's precision. The same section showed that prec⁡>p\operatorname{prec} > p exactly when TPRg>FPRg\mathrm{TPR}_g > \mathrm{FPR}_g. So a filter improves the data whenever it accepts right answers more often than wrong ones.

A data engineer needs two more numbers. The first is the cost. Each candidate is accepted with probability AA, independently of the others, so the number of candidates you draw until one is accepted has a geometric distribution, with mean 1/A1/A. That makes 1/A1/A the number of generations one kept example costs. The second is the yield, the number of correct kept examples per candidate, which is p TPRgp\,\mathrm{TPR}_g.

In plain words, precision is what the kept data are worth, and 1/A1/A is what they cost. A stricter filter usually raises both, buying cleaner data at a higher price per example.

How strict must the filter be? Fix the precision you want and solve for the false positive rate.

∂ Proof of the required false positive rate

Precision is at least prec⁡tgt\operatorname{prec}_{\text{tgt}} when p TPRg≥prec⁡tgt(p TPRg+(1−p)FPRg)p\,\mathrm{TPR}_g \ge \operatorname{prec}_{\text{tgt}}\big(p\,\mathrm{TPR}_g + (1-p)\mathrm{FPR}_g\big). Move the p TPRgp\,\mathrm{TPR}_g terms to the left to get (1−prec⁡tgt) p TPRg≥prec⁡tgt(1−p) FPRg(1-\operatorname{prec}_{\text{tgt}})\,p\,\mathrm{TPR}_g \ge \operatorname{prec}_{\text{tgt}}(1-p)\,\mathrm{FPR}_g, and divide by prec⁡tgt(1−p)>0\operatorname{prec}_{\text{tgt}}(1-p) > 0. Every step is reversible. ∎

In plain words, the allowed false positive rate is a product of three numbers. The first is the generator's odds of being right, p/(1−p)p/(1-p). The second is the checker's true positive rate. The third is the odds of error you will tolerate, (1−prec⁡tgt)/prec⁡tgt(1-\operatorname{prec}_{\text{tgt}})/\operatorname{prec}_{\text{tgt}}. The first factor is small when the generator is weak, so a weak generator needs a nearly perfect checker.

There is a second cost, and it is easy to miss. The filter changes which prompts the kept data come from. Let p(x)p(x) be the chance that the generator solves prompt xx, its per-prompt success rate (§18.2). Each prompt keeps samples at its own acceptance rate, p(x)TPRg+(1−p(x))FPRgp(x)\mathrm{TPR}_g + (1-p(x))\mathrm{FPR}_g. Easy prompts keep many samples and hard prompts keep few. So the hardest prompts nearly vanish from the kept data, and so do the skills they teach.

The cell first computes the three filters seen so far, the hand example, one from the interview questions at the end of the section, and the strict checker. Then it measures the second cost on 10,000 prompts. Their success rates are drawn from a Beta(0.5, 0.5) distribution, which piles up near 0 and near 1, so there are many easy prompts and many hard ones.

Python · cell 1

This is why the team behind the phi-4 model generated several answers per question and discarded two kinds of question (Abdin et al. 2024). They dropped questions on which every answer agreed, as too easy. They also dropped questions on which the answers were entirely inconsistent, as too hard or ambiguous. For the rest they used the most common answer as the label.

Reinforcement learning has a related blind spot. Group-relative policy optimization, or GRPO (§18.4), scores each sample against the other samples for the same prompt, so a prompt that is always solved, or never, gives it no signal. In practice, report precision and yield per difficulty bucket, never only on average. An interviewer will give you pp, the true positive rate, and the false positive rate. They will ask for the wrong fraction and the cost, and then ask what the average hides.

Warm-up

What a filter costs

This exercise computes what a filter's output is worth, what it costs, and how strict the filter must be. First implement filter_stats(p, tpr, fpr) for a generator of accuracy p and a verifier with true positive rate tpr and false positive rate fpr. It returns a dict with four keys.

  • "precision", the probability that an accepted sample is correct.
  • "acceptance", the probability that a sample is accepted.
  • "gens_per_kept", the expected number of generations per kept sample.
  • "correct_per_gen", the expected number of correct kept samples per generation.

When nothing is ever accepted, return precision nan, gens_per_kept equal to inf, and zeros for the other two.

Then implement fpr_for_precision(p, tpr, target), the largest false positive rate that still gives precision target. When the generator already meets the target with any checker, the formula gives a value of 1 or more, and you may return it as it is.

Tests, hints, verified solutions, and AI help, with Pro at $7.99 a month.

Verification when the model also writes the tests

Code is the friendliest case for verification, because code can be run. The Llama 3 team found that training the 8B and 70B models on code written by a larger model helped a lot (Llama Team 2024, in the report's section on code). Training the 405B model on code it wrote itself did not help, and could even hurt. That is the self-improvement problem in miniature, since the largest model had no stronger teacher.

What fixed it was execution feedback, a check that actually runs the code. The team generated programming problems from random code snippets and had the model solve them. Every solution went through a parser and a linter, a tool that flags code that is malformed or suspicious without running it. Then it ran in a sandbox, an isolated environment where it cannot do harm, against unit tests that the model also wrote. Failures went back to the model for revision, and only dialogues that passed every check were kept.

The obvious worry is that model-written tests can be wrong. A wrong test that matches a popular bug rewards the bug. One fix lets programs and tests check each other, a method called CodeT (Chen et al. 2022). Sample many programs and many tests from the same model, and run every program on every test. Then look for a large group of programs that behave identically, together with the tests they all pass. Here is a small case first.

In plain words, a program earns credit for every program, itself included, that behaves exactly like it on the tests, multiplied by how many tests that behavior passes. This works because correct programs agree with each other on every input. Wrong programs tend to be wrong in different ways, so they split into many small groups. A wrong test costs the correct group only one test out of many, while every correct test is passed by every correct program.

Neither half alone has both protections. A majority vote over programs is won by a popular bug. A count of passed tests is inflated by wrong tests. On HumanEval, a benchmark of 164 Python problems with hidden tests, CodeT raised the pass@1 of the code-davinci-002 model from 47.0% to 65.8%. Pass@1 is the chance that the one program chosen passes the hidden reference tests. The cell runs the median example.

Python · cell 2

In practice, consensus is how you verify code when no one has written trusted tests, which is the usual case for synthetic problems. An interviewer will ask you to implement it, then ask which bugs it cannot catch. The answer is bugs that most programs and most tests share.

Interview

CodeT dual execution agreement

Implement the consensus selection of the definition above as codet_select(programs, tests). Here programs is a list of Python callables, and tests is a list of (input, expected_output) pairs written by a model, some of them wrong.

  1. Run every program on every test. A program passes a test when f(x) == y. An exception counts as a failed test and must never crash your function.
  2. Group the programs by the exact set of tests they pass.
  3. Score each group by (number of programs in it) times (number of tests passed).
  4. Return the index of the first program of the best group. Break ties in score toward the group whose first program has the lower index.
Tests, hints, verified solutions, and AI help, with Pro at $7.99 a month.

Verifiers, from strongest to weakest

Code is the easy case. The table lists the verifiers available elsewhere, roughly from strongest to weakest. Two abbreviations appear in it. RLVR is reinforcement learning with verifiable rewards, training against an automatic checker of final answers (§18.3). RLAIF is reinforcement learning from AI feedback, in which a model's preferences replace human ones.

verifierwhat it checkswhat it missesused by
proof checker, symbolic engineevery step of a formal proofwhether the statement was the one you meantAlphaGeometry, provers that write proofs in the Lean language
execution against trusted testsbehavior on the tested inputsuntested inputs, efficiency, stylesupervised fine-tuning (SFT) and RL on code with hidden tests
execution against generated tests, with agreementconsensus behaviorbugs shared by most samples and most testsCodeT, Llama 3
final-answer matchthe answer to a problem with a known answerwrong reasoning that lands on the right answermath SFT and RLVR
majority vote over samplesthe most common answera confident shared errorphi-4's labels for its questions
LLM judge or reward modelwhatever its rubric and training capturedits biases (length, style, its own family)filtering instruction data by a judge's score (Chen et al. 2023), self-rewarding, RLAIF

The top row is the purest case of verified synthetic data. The AlphaGeometry system learned olympiad geometry without ever seeing a human proof (Trinh et al. 2024). A symbolic deduction engine, a program that applies the rules of geometry mechanically, was run on random geometric premises. It produced 100 million synthetic theorems with proofs, every one correct by construction. A language model trained only on them learned to propose the extra points and lines that a proof needs, which the engine cannot invent. The system solved 25 of 30 recent olympiad geometry problems, against 10 for the best previous method. The verifier was perfect, so the only limits were how much of geometry the random premises covered and how varied they were.

Synthetic data at real scale

The best of these pipelines share two traits. First, they are anchored in real data. The web-rewriting study kept the original pages in the mix, and found that training on rewrites alone hurt perplexity on domains whose style the rewrites lacked. Second, most of them use a stronger or separate model as the generator. That is distillation, the subject of §20.4, which also covers its on-policy form, in which the student generates and the teacher grades. Diversity needs its own fix, because a model sampled many times tends to say the same few things.

Two cautions carry over from earlier chapters. Generated data can reproduce benchmark questions that the generator memorized. So the decontamination of §8.3 and §22.3 must run on synthetic data too. And a generator's outputs carry its license terms, which chain through every model trained on them (§14.2).

When the model is its own judge

Now take away the outside checker. In a self-rewarding loop, the model that writes the responses also grades them, and its grades become the training signal. The loop is built on iterative DPO (§17.5). DPO, direct preference optimization, trains a model on pairs of responses to the same prompt, one marked better and one worse. It raises the probability of the better one and lowers that of the worse one, each measured relative to a fixed reference model. Iterative DPO repeats this in rounds. Each round samples several responses per prompt from the current model, scores them, pairs the best with the worst, and trains on the pairs (you build such pairs in Exercise 17.5b). A self-rewarding model is iterative DPO in which the model being trained is also the scorer.

In the paper's main runs the new prompts came from a fixed model, Llama 2-Chat 70B shown eight example prompts. The responses and their grades came from the model being trained. Evaluation used outside judges, GPT-4 and the authors themselves, never the model's own scores. That is the only reason we can say anything about whether the model improved.

Why would this work at all? Judging a response is easier than writing a good one. So a judge that agrees with humans on 80% of pairs opens a generation-verification gap, and the loop can climb it. The judge even improved without new judge data, from 78.7% to 81.7%. The authors attribute this to better general instruction following.

And why would it fail? Because the judge's errors are not random. §22.4 measured three biases in language-model judges. They prefer the answer shown first, they prefer longer answers, and they prefer text in their own style. All three can act in a self-rewarding loop, and the length growth above is the one that shows in the published numbers. The length bias is the same one that §16.3 found in learned reward models.

A judge that systematically likes some feature other than quality hands the policy a direction to move in. The next subsection shows that the loop moves further in that direction every round. The same caution applies to RLAIF and to constitutional training (§19.2), where an AI judge also supplies the preferences. There, though, the judge is usually a separate, fixed model guided by written principles.

What the loop optimizes

Each round moves the policy, the model's distribution over responses, toward the responses its judge scores highly. It moves only a little, because DPO keeps the new policy close to its reference. What happens after many rounds? A tiny example shows it.

Here is the general version. Idealize each round as the exact optimum of the KL-regularized objective of §17.1. That objective is the expected reward minus β\beta times the KL divergence from a reference policy, where the KL divergence measures how far one distribution has moved from another. The KL coefficient β>0\beta > 0 sets how far a round may move. In round t+1t+1 the reward is the judge's current score st(x,y)s_t(x, y), and the reference is the previous policy πt\pi_t, one of the two reference choices of §17.5. §17.1 proved that the optimum is the tilted distribution

πt+1(y∣x)∝πt(y∣x)exp⁡ ⁣(st(x,y)/β).\pi_{t+1}(y\mid x) \propto \pi_t(y\mid x)\exp\!\big(s_t(x, y)/\beta\big).

In plain words, every response keeps its old probability, multiplied by a factor that grows with its score.

Proof. By induction on TT. The claim holds for T=1T = 1 by assumption. If it holds for TT, then πT+1∝πTesT/β∝π0exp⁡(∑t<Tst/β)esT/β\pi_{T+1} \propto \pi_T e^{s_T/\beta} \propto \pi_0\exp\big(\sum_{t<T}s_t/\beta\big)e^{s_T/\beta}, which is the claim for T+1T + 1 (the normalizing constants depend only on xx). With st=ss_t = s the exponent is Ts/β=s/(β/T)Ts/\beta = s/(\beta/T), which is the optimum of §17.1 with coefficient β/T\beta/T and reference π0\pi_0. Finally, the ratio πT(y)/πT(y′)\pi_T(y)/\pi_T(y') equals π0(y)π0(y′)eT(s(y)−s(y′))/β\frac{\pi_0(y)}{\pi_0(y')}e^{T(s(y)-s(y'))/\beta}, which tends to infinity whenever s(y)>s(y′)s(y) > s(y'), so all the mass ends on the maximizers of ss. ∎

In plain words, TT rounds of self-rewarding with a fixed judge equal one round of reinforcement learning from human feedback (RLHF), with the judge as the reward model and a KL coefficient TT times smaller. Each round loosens the leash that ties the policy to the starting model. In the limit the policy is whatever the judge likes best.

That is exactly the regime in which §16.5 measured overoptimization. As the policy moves away from its reference, the true reward first rises, then peaks, then falls. In an interview, this theorem answers "why do self-rewarding gains stop after a few rounds, and what would you watch?" Watch the KL divergence from the starting model, and a judge you do not train.

A real judge's score mixes quality with things that are not quality. Describe each response by two features, its content quality qq and its length ℓ\ell. Take the judge's mean score to be s=q+b ℓs = q + b\,\ell, where b≥0b \ge 0 is the judge's length bias, the score it adds per unit of length. The next theorem says exactly what the loop does to each feature when the two features follow a Gaussian distribution under the starting policy.

∂ Proof that the tilt shifts a Gaussian's mean

By the previous theorem πT∝π0ec⊤z\pi_T \propto \pi_0 e^{\mathbf{c}^\top\mathbf{z}} with c=(T/β)a\mathbf{c} = (T/\beta)\mathbf{a}. Complete the square in the exponent,

−12(z−μ)⊤Σ−1(z−μ)+c⊤z=−12(z−μ−Σc)⊤Σ−1(z−μ−Σc)+const.-\tfrac12(\mathbf{z}-\boldsymbol\mu)^\top\boldsymbol\Sigma^{-1}(\mathbf{z}-\boldsymbol\mu) + \mathbf{c}^\top\mathbf{z} = -\tfrac12(\mathbf{z}-\boldsymbol\mu-\boldsymbol\Sigma\mathbf{c})^\top\boldsymbol\Sigma^{-1}(\mathbf{z}-\boldsymbol\mu-\boldsymbol\Sigma\mathbf{c}) + \text{const}.

To check it, expand the right side. Its cross term is z⊤Σ−1(μ+Σc)=z⊤Σ−1μ+z⊤c\mathbf{z}^\top\boldsymbol\Sigma^{-1}(\boldsymbol\mu + \boldsymbol\Sigma\mathbf{c}) = \mathbf{z}^\top\boldsymbol\Sigma^{-1}\boldsymbol\mu + \mathbf{z}^\top\mathbf{c}, which matches the left side, and the remaining terms do not depend on z\mathbf{z}. So πT\pi_T is Gaussian with mean μ+Σc\boldsymbol\mu + \boldsymbol\Sigma\mathbf{c} and the same covariance.

With Σ=(σq2ρσqσℓρσqσℓσℓ2)\boldsymbol\Sigma = \begin{pmatrix}\sigma_q^2 & \rho\sigma_q\sigma_\ell\\ \rho\sigma_q\sigma_\ell & \sigma_\ell^2\end{pmatrix}, the two components of Σa\boldsymbol\Sigma\mathbf{a} are σq2+bρσqσℓ\sigma_q^2 + b\rho\sigma_q\sigma_\ell and ρσqσℓ+bσℓ2\rho\sigma_q\sigma_\ell + b\sigma_\ell^2, which divided by β\beta are the two rates.

Finally E[u]=E[q]−clen(E[ℓ]2+σℓ2)\mathbb{E}[u] = \mathbb{E}[q] - c_{\text{len}}\big(\mathbb{E}[\ell]^2 + \sigma_\ell^2\big). The first term is linear in TT. The second is −clen-c_{\text{len}} times the square of a linear function of TT with positive slope, plus a constant. So the whole is a concave quadratic in TT with a finite maximizer. ∎

In plain words, two things push length up. A length-biased judge does it directly, through the term bσℓ2b\sigma_\ell^2. A correlation between length and quality in the starting policy does it too, through ρσqσℓ\rho\sigma_q\sigma_\ell, even when the judge is unbiased. Tilting toward quality drags along whatever travels with quality. And since the quality gain is linear in the number of rounds while the cost of growing length is quadratic, the true utility must eventually turn down.

For a number, take σq=σℓ=0.15\sigma_q = \sigma_\ell = 0.15, ρ=0\rho = 0, b=0.5b = 0.5, and β=0.1\beta = 0.1. Each round adds 0.0225/0.1=0.2250.0225/0.1 = 0.225 to the mean quality and 0.5×0.0225/0.1=0.11250.5\times 0.0225/0.1 = 0.1125 to the mean length. In practice, the theorem explains why answers can grow in a self-judged loop even when the judge has no length bias at all. An interviewer will ask whether an unbiased judge stops length growth. The ρ\rho term says it does not, whenever longer answers in the starting policy are also better ones.

The cell runs the idealized loop on a grid of 121 responses, with quality and length each taking 11 values in [0,1][0, 1]. Capping quality at 1 makes the downturn come sooner than in the Gaussian model, where the same starting policy and gold score put the peak near round 8. The judge is s=q+b ℓs = q + b\,\ell. The gold score, what a careful reader would give, is u=q−0.8 ℓ2u = q - 0.8\,\ell^2. The printout compares three runs, an unbiased judge (b=0b = 0), a biased judge (b=0.5b = 0.5), and the biased judge with length control.

Before each round, length control fits the judge score as a linear function of length under the current policy, and subtracts the fitted slope times length. That is the idea behind AlpacaEval's length-controlled win rate (Dubois et al. 2024), which §16.6 derived as a logistic regression with a length term.

Python · cell 3

That last result is too good to be general. When length and quality are genuinely correlated, removing the length slope also removes part of the real quality signal. The widget starts from a policy in which length and quality have correlation 0.4, so you can see two effects, length growth under an unbiased judge and the quality that length control gives up.

What happens when a model rewards itself with a judge that likes long answers?
Each round the model favors the answers its own judge scores high. Gold is what a careful reader would score.
Loading interactive figure…

With b=0b = 0 the mean length still climbs, because longer answers start out better and the tilt drags length along with quality. Length control removes the whole length slope, so quality climbs a little more slowly than under the unbiased judge. But length now stays flat, and gold charges for length, so gold ends higher than with the unbiased judge. Length control gives up a little real quality to stop the padding, and whether that pays depends on how much a reader is hurt by length.

The judge noise slider adds a fixed error to each response's score. It stands for the judge's idiosyncratic likes and dislikes. This is not the sampling noise of a single judgment, which averaging removes. An error attached to a response is there every round, and the tilt finds and amplifies exactly the responses the judge overrates. So with b=0b = 0 and enough noise, the judge's score pulls far ahead of gold, and gold ends below what an unbiased judge reaches.

§16.5 called this regressional Goodhart. When you select on a noisy proxy, the winners are partly the ones whose noise happened to be high. Here it is worse than one selection, because every round concentrates further on the few responses with the largest errors. The meta-judge option previews the next subsection, in which the judge is trained too. It multiplies the bias and the noise by 0.65 each round, so they shrink before they compound.

Research

A self-rewarding loop with a biased judge

Rebuild the idealized loop of the cell above and measure what it does. The setup defines the same response grid. Q_GRID and L_GRID hold quality and length (11 values each in [0,1][0, 1]), PI0 is the starting policy, and GOLD is the gold score q−0.8 ℓ2q - 0.8\,\ell^2.

Implement self_reward_rounds(b, beta, rounds, length_control=False). It returns three arrays of length rounds + 1, the policy's mean gold score, mean judge score, and mean length at rounds 0,1,…,0, 1, \dots, rounds. Round 0 is PI0. The judge's score is s=q+b ℓs = q + b\,\ell, and each round sets π←π es/β\pi \leftarrow \pi\, e^{s/\beta}, normalized to sum to one.

With length_control=True, adjust the score before each update. Compute the least-squares slope of ss on ℓ\ell under the current π\pi, which is Cov⁡π(s,ℓ)/Var⁡π(ℓ)\operatorname{Cov}_\pi(s, \ell)/\operatorname{Var}_\pi(\ell), and use s−slope⋅ℓs - \text{slope}\cdot\ell in the update. The judge score you report stays the raw ss.

Read PI0 when the function is called, because one test swaps in a starting policy in which quality and length are correlated. The function must also stay finite for β\beta as small as 0.001.

Tests, hints, verified solutions, and AI help, with Pro at $7.99 a month.

Training the judge too

If the judge is the weak link, improve the judge. Wu et al. (2024) argued that self-rewarding saturates quickly because its training improves the model as a responder and only incidentally as a judge. Their method, meta-rewarding, adds a third role.

Acting as a meta-judge, the same model compares pairs of its own judgments of one response. It sees each pair in both orders, to cancel the preference for whichever comes first. The comparisons give each judgment an Elo-style rating, the kind of rating chess uses to rank players from their wins and losses. The best and worst judgments then form DPO pairs that train the judging skill.

They also changed how response pairs are chosen, to fight length. Responses whose scores fall in a top tier near the maximum count as equally good, and the shortest of them becomes the chosen response. The longest response in a bottom tier becomes the rejected one. And because the meta-judge also liked long judgments, they dropped pairs whose chosen judgment was too long.

Wang et al. (2024) went further and trained a judge with no human preference labels at all. The trick is to build pairs whose answer is known by construction. Take a real user instruction xx. An instruction-following model (Mixtral 8x22B in their experiments) writes a good response ywy^w to it. The same model then writes a slightly different instruction x′x' and a good response yly^l to x′x'. That response is plausible for xx but worse, because it answers a different question.

The judge being trained samples several judgments of the triple (x,yw,yl)(x, y^w, y^l), keeps one that prefers ywy^w, and is fine-tuned on the kept judgments. Then the loop repeats with the improved judge. (In the first iteration Mixtral also wrote the judgments, and from then on the model being trained wrote them.) This is the bootstrapped reasoning of §26.3, training on your own outputs that a check accepted, with judging as the task and the construction of the pair as the check.

Both are real improvements, and both move the problem rather than solve it. The meta-judge is the same model with the same blind spots, so the length bias reappeared one level up. The Self-Taught Evaluator's labels are only as good as the assumption that a response to a modified instruction is worse. That holds for the kind of pairs it builds, and says nothing about subtler failures. An interviewer who hears "no human labels" will ask what anchors the loop, and the honest answer is a held-out human set you never train on.

The PyTorch block shows the basic self-rewarding loop in miniature. A policy over eight canned responses runs four rounds of DPO on pairs labeled by its own length-biased judge. The previous round's model is the reference each round.

🔥 In PyTorchfor a machine with PyTorch

The judge's score climbs from 0.857 to 1.320, and the policy settles on response 7, which is long and good, with a gold score of 0.508. The short response 3, which a careful reader would prefer, has a gold score of 0.768.

Notice the last round. The policy has concentrated on one response. So the best and worst of its four samples are the same response on almost every prompt, and only 2 of 512 pairs survive. This is one way a self-rewarding loop saturates, the problem Wu et al. set out to fix. Once the policy agrees with its judge, the judge has nothing left to teach, whether or not the judge was right. In practice, the number of non-tied pairs per round is a cheap alarm for a self-rewarding loop that has stopped learning.

Model collapse, in a model you can solve

Now remove the checker entirely. Model collapse is the loss of quality when each generation of a model is trained on samples from the previous generation, with nothing to check what is kept. §8.4 derived the simplest case. Fit a Gaussian to MM samples drawn from the previous fit, and repeat. The variance shrinks by a factor (M−1)/M(M-1)/M on average each generation, so it decays to zero and the tails go first. That section also stated that keeping all the old data, instead of replacing it, avoids this.

Here we prove both behaviors in linear regression, a model rich enough to have features and noise, following Dohmatob, Feng & Kempe (2024) and Gerstgrasser et al. (2024). The proofs are short, and they are a common interview question.

One fact makes accumulation easy to handle. The least-squares fit solves the normal equations X⊤X w=X⊤y\mathbf{X}^\top\mathbf{X}\,\mathbf{w} = \mathbf{X}^\top\mathbf{y}, where X⊤X\mathbf{X}^\top\mathbf{X} is called the Gram matrix. Stacking tt copies of X\mathbf{X} gives the Gram matrix t X⊤Xt\,\mathbf{X}^\top\mathbf{X} and the right side ∑iX⊤yi\sum_i\mathbf{X}^\top\mathbf{y}_i. So the accumulated fit is

w^t=1t(X⊤X)−1∑i≤tX⊤yi=Ayˉt,yˉt=1t∑i≤tyi.\hat{\mathbf{w}}_t = \frac1t(\mathbf{X}^\top\mathbf{X})^{-1}\sum_{i\le t}\mathbf{X}^\top\mathbf{y}_i = \mathbf{A}\bar{\mathbf{y}}_t, \qquad \bar{\mathbf{y}}_t = \frac1t\sum_{i\le t}\mathbf{y}_i .

In plain words, fitting all the stacked data is the same as fitting the average label of each input once.

The two theorems below are this example, run for any number of generations.

In plain words, under replacement each generation adds a full dose of fresh noise and keeps all the old doses, so the error grows linearly forever. Under accumulation the newest generation is only a 1/t1/t share of the training set. Its noise enters with coefficient 1/t1/t and its variance with 1/t21/t^2, and those weights have a finite sum. Synthetic data does not stop being noisy. Each new dose of noise is diluted by everything that came before, including the real data. In practice, this is the argument for never deleting the real data a model started from.

∂ Proofs of the replace and accumulate theorems

Replace. Since AX=I\mathbf{A}\mathbf{X} = \mathbf{I}, w^t=A(Xw^t−1+εt)=w^t−1+Aεt\hat{\mathbf{w}}_t = \mathbf{A}(\mathbf{X}\hat{\mathbf{w}}_{t-1} + \boldsymbol\varepsilon_t) = \hat{\mathbf{w}}_{t-1} + \mathbf{A}\boldsymbol\varepsilon_t. So et=et−1+Aεt\mathbf{e}_t = \mathbf{e}_{t-1} + \mathbf{A}\boldsymbol\varepsilon_t, and unrolling from e0=0\mathbf{e}_0 = \mathbf{0} gives the sum (generation 1 is the case w^0=w⋆\hat{\mathbf{w}}_0 = \mathbf{w}^\star). The terms are independent with mean zero, so the cross terms of ∥et∥2\lVert\mathbf{e}_t\rVert^2 have zero expectation and E∥et∥2=∑iE∥Aεi∥2\mathbb{E}\lVert\mathbf{e}_t\rVert^2 = \sum_i\mathbb{E}\lVert\mathbf{A}\boldsymbol\varepsilon_i\rVert^2. Each term is E[ε⊤A⊤Aε]=σ2tr⁡(A⊤A)=σ2tr⁡(AA⊤)\mathbb{E}[\boldsymbol\varepsilon^\top\mathbf{A}^\top\mathbf{A}\boldsymbol\varepsilon] = \sigma^2\operatorname{tr}(\mathbf{A}^\top\mathbf{A}) = \sigma^2\operatorname{tr}(\mathbf{A}\mathbf{A}^\top), and AA⊤=(X⊤X)−1X⊤X(X⊤X)−1=(X⊤X)−1\mathbf{A}\mathbf{A}^\top = (\mathbf{X}^\top\mathbf{X})^{-1}\mathbf{X}^\top\mathbf{X}(\mathbf{X}^\top\mathbf{X})^{-1} = (\mathbf{X}^\top\mathbf{X})^{-1}.

For the Gaussian average we need the mean of an inverse Wishart matrix, the inverse of X⊤X\mathbf{X}^\top\mathbf{X} when X\mathbf{X} has independent standard Gaussian entries. It is E[(X⊤X)−1]=Idf/(m−df−1)\mathbb{E}[(\mathbf{X}^\top\mathbf{X})^{-1}] = \mathbf{I}_{d_f}/(m - d_f - 1) for m≥df+2m \ge d_f + 2. This is a standard identity of multivariate statistics that we state without proof, and it makes the trace average df/(m−df−1)d_f/(m - d_f - 1). You can check it in one dimension. With df=1d_f = 1, X⊤X=∑ixi2\mathbf{X}^\top\mathbf{X} = \sum_i x_i^2 is chi-square with mm degrees of freedom, whose density is xm/2−1e−x/2/(2m/2Γ(m/2))x^{m/2-1}e^{-x/2}/(2^{m/2}\Gamma(m/2)). Then, using Γ(z+1)=zΓ(z)\Gamma(z+1) = z\Gamma(z),

E[1/χm2]=∫0∞xm/2−2e−x/2 dx2m/2Γ(m/2)=2m/2−1Γ(m/2−1)2m/2Γ(m/2)=12(m/2−1)=1m−2,\mathbb{E}[1/\chi^2_m] = \frac{\int_0^\infty x^{m/2-2}e^{-x/2}\,dx}{2^{m/2}\Gamma(m/2)} = \frac{2^{m/2-1}\Gamma(m/2-1)}{2^{m/2}\Gamma(m/2)} = \frac{1}{2(m/2-1)} = \frac{1}{m-2},

which is 1/(m−df−1)1/(m - d_f - 1). ∎

Accumulate. The accumulated fit is Ayˉt\mathbf{A}\bar{\mathbf{y}}_t. For every ii, Ayi=w^i−1+Aεi\mathbf{A}\mathbf{y}_i = \hat{\mathbf{w}}_{i-1} + \mathbf{A}\boldsymbol\varepsilon_i (with w^0=w⋆\hat{\mathbf{w}}_0 = \mathbf{w}^\star). So, subtracting w⋆\mathbf{w}^\star and multiplying by tt,

t et=∑i=1t(ei−1+Aεi).t\,\mathbf{e}_t = \sum_{i=1}^{t}\big(\mathbf{e}_{i-1} + \mathbf{A}\boldsymbol\varepsilon_i\big).

The same identity at t−1t - 1 reads (t−1) et−1=∑i=1t−1(ei−1+Aεi)(t-1)\,\mathbf{e}_{t-1} = \sum_{i=1}^{t-1}(\mathbf{e}_{i-1} + \mathbf{A}\boldsymbol\varepsilon_i). Subtracting the two leaves only the last term of the sum,

t et−(t−1) et−1=et−1+Aεt⟹et=et−1+1tAεt.t\,\mathbf{e}_t - (t-1)\,\mathbf{e}_{t-1} = \mathbf{e}_{t-1} + \mathbf{A}\boldsymbol\varepsilon_t \quad\Longrightarrow\quad \mathbf{e}_t = \mathbf{e}_{t-1} + \frac1t\mathbf{A}\boldsymbol\varepsilon_t .

Unrolling from e0=0\mathbf{e}_0 = \mathbf{0} gives et=∑i≤tAεi/i\mathbf{e}_t = \sum_{i\le t}\mathbf{A}\boldsymbol\varepsilon_i/i. As before the terms are independent with mean zero, and the iith has expected squared norm σ2tr⁡((X⊤X)−1)/i2\sigma^2\operatorname{tr}((\mathbf{X}^\top\mathbf{X})^{-1})/i^2. Summing, and using ∑i≥11/i2=π2/6\sum_{i\ge1}1/i^2 = \pi^2/6 with all terms positive, gives the strict bound. ∎

The cell checks both theorems with df=5d_f = 5 features, m=20m = 20 samples, and noise σ=1\sigma = 1, averaged over 2,000 random designs. There generation 1 has error df/(m−df−1)=5/14=0.357d_f/(m - d_f - 1) = 5/14 = 0.357.

Python · cell 4
Interview

Replace versus accumulate, proved by simulation

Simulate the self-consuming least-squares loop for one fixed design and check it against the two theorems. Implement collapse_errors(X, w_star, sigma, generations, mode, reps=2000, seed=0) for a design X of shape (m, d_f). Generation 1 fits real labels. Every later generation fits labels made by the previous fit plus fresh N(0,σ2)\mathcal{N}(0, \sigma^2) noise. The argument mode is "replace" or "accumulate", as defined above. Return an array with one entry per generation t=1,…,t = 1, \dots, generations, the mean of ∥w^t−w⋆∥2\lVert\hat{\mathbf{w}}_t - \mathbf{w}^\star\rVert^2 over reps independent runs.

Then implement theory(X, sigma, generations, mode), which returns the exact fixed-design formulas from the two theorems.

Tests, hints, verified solutions, and AI help, with Pro at $7.99 a month.

Accumulating everything forever has a cost, since every generation trains on a bigger dataset. Kazdan et al. (2024) studied a middle ground with a fixed compute budget, accumulate-subsample. Real and synthetic data pile up, but each generation trains on a fixed-size random subset of the pile. Their experiments covered Gaussian estimation, kernel density estimation, and language-model fine-tuning. In all of them the test loss of this workflow sat between the other two, degrading slowly rather than explosively. And Dey & Donoho (2024) showed that the π2/6\pi^2/6 bound for accumulation is not an accident of linear regression. It holds across a broad family of standard statistical models.

Why does training on your own outputs collapse when data are replaced, and not when they accumulate?
Least squares with 5 features and 20 inputs. Each generation relabels the inputs with the previous fit plus fresh noise.
Loading interactive figure…

The last experiment holds a lesson the theorems do not state. With κm\kappa m real rows per generation, the real labels pin down only the directions of feature space that those rows span. Two rows cannot span five dimensions, so in the other three directions the model still drifts as if no real data were there. Five real rows are not quite enough either. They span all five directions, but in some designs they cover one of them only weakly, and the error levels off only from about ten rows. Fresh real data must cover what the model is supposed to know. An interviewer who asks "how much real data is enough?" wants to hear both a fraction and a coverage condition.

Tails disappear first

Linear regression with Gaussian noise collapses through variance alone, because least squares is unbiased. Real generators also add a bias, and it has a direction. They under-sample what is rare. Shumailov et al. saw the tails of the original distribution vanish first. The categorical simulation of §8.4, in which a model is a list of category probabilities refit by counting its own samples, showed why. A category that draws zero samples once is gone for good.

What does losing the tail cost a model that is still trained on plenty of data? A simple model of learning by memorization gives an exact answer (Hutter 2021). Dohmatob et al. (2024) used it to show how model collapse changes a scaling law, the power law that relates test error to the amount of training data.

The model has a world of facts with very unequal popularity. Rank the facts from most to least often asked about. Under a Zipf law of exponent 2, fact ii is asked about with probability proportional to 1/i21/i^2. Normalized, fact 1 is 61% of all queries, fact 10 is 0.61%, and fact 100 is 0.0061%. A learner that has seen 1,000 queries has almost surely met fact 10, and has probably never met fact 100.

The formulas for E(D)E(D) and Eq(D)E_{\mathbf{q}}(D) are exact for this idealized model, and the derivation below gives their large-DD form. The model's value is that it isolates one mechanism, rare knowledge appearing too seldom to be learned.

∂ The learning-curve exponent and the tail mass

The exponent. For small PiP_i, (1−Pi)D=eDln⁡(1−Pi)≈e−DPi(1 - P_i)^D = e^{D\ln(1-P_i)} \approx e^{-DP_i}, and the facts that matter have PiP_i of order 1/D1/D, which is small when DD is large. So E(D)≈∑iPie−DPiE(D) \approx \sum_i P_i e^{-DP_i}. Replace the sum by an integral over a continuous rank x≥1x \ge 1, with P(x)=x−βz/ζP(x) = x^{-\beta_z}/\zeta (write ζ\zeta for ζ(βz)\zeta(\beta_z)),

E(D)≈∫1∞x−βzζexp⁡ ⁣(−Dx−βzζ) dx.E(D) \approx \int_1^\infty \frac{x^{-\beta_z}}{\zeta}\exp\!\Big(-\frac{D x^{-\beta_z}}{\zeta}\Big)\,dx .

Substitute u=Dx−βz/ζu = Dx^{-\beta_z}/\zeta. Then x=(D/(ζu))1/βzx = (D/(\zeta u))^{1/\beta_z}, dx=−1βz(D/ζ)1/βzu−1/βz−1dudx = -\frac{1}{\beta_z}(D/\zeta)^{1/\beta_z}u^{-1/\beta_z - 1}du, and the prefactor x−βz/ζx^{-\beta_z}/\zeta is u/Du/D. The limits x=1x = 1 and x=∞x = \infty become u=D/ζu = D/\zeta and u=0u = 0. So

E(D)≈1βz(Dζ)1/βz1D∫0D/ζu−1/βze−u du  ⟶  Γ(1−1/βz)βz ζ1/βz D1/βz−1,E(D) \approx \frac{1}{\beta_z}\Big(\frac{D}{\zeta}\Big)^{1/\beta_z}\frac{1}{D}\int_0^{D/\zeta}u^{-1/\beta_z}e^{-u}\,du \;\longrightarrow\; \frac{\Gamma(1 - 1/\beta_z)}{\beta_z\,\zeta^{1/\beta_z}}\,D^{1/\beta_z - 1},

because as D→∞D\to\infty the integral tends to ∫0∞u(1−1/βz)−1e−udu=Γ(1−1/βz)\int_0^\infty u^{(1 - 1/\beta_z) - 1}e^{-u}du = \Gamma(1 - 1/\beta_z), which is finite since 1−1/βz>01 - 1/\beta_z > 0.

The tail mass. ∑i>kPi≈∫k∞x−βzdx/ζ=k1−βz/((βz−1)ζ)\sum_{i>k}P_i \approx \int_k^\infty x^{-\beta_z}dx/\zeta = k^{1-\beta_z}/((\beta_z - 1)\zeta).

Where the curve bends. The clean error CβzD−(βz−1)/βzC_{\beta_z}D^{-(\beta_z - 1)/\beta_z} meets the floor, of order k−(βz−1)k^{-(\beta_z-1)}, when D(βz−1)/βz≍kβz−1D^{(\beta_z - 1)/\beta_z} \asymp k^{\beta_z - 1}, that is, when D≍kβzD \asymp k^{\beta_z}. The intuition is the same as for the exponent. With DD samples you have seen roughly the facts with Pi≳1/DP_i \gtrsim 1/D, which are the top D1/βzD^{1/\beta_z}. A generator that knows only the top kk stops being useful once you could have learned more than kk facts from real data.

The real fraction. Facts beyond rank kk appear only through the real samples, each of which picks fact ii with probability PiP_i. So a training draw is fact ii with probability κPi\kappa P_i, and (1−κPi)D≈e−(κD)Pi(1-\kappa P_i)^D \approx e^{-(\kappa D)P_i} is the clean term at κD\kappa D samples.

In plain words, in a heavy-tailed world, data are valuable in proportion to the rare facts they contain, and a generator that has lost its tail can teach only what it knows. Its data are worth as much as real data until the learner has absorbed everything the generator knows, and worth nothing after that. With βz=2\beta_z = 2 the constant is C2=Γ(1/2)/(2π2/6)=1.7725/2.565=0.691C_2 = \Gamma(1/2)/(2\sqrt{\pi^2/6}) = 1.7725/2.565 = 0.691, so the clean error falls like 0.691/D0.691/\sqrt D.

Python · cell 5

Truncated generators arise in two ways in practice. Decoding choices cut tails on purpose. Temperature below 1, top-pp, and top-kk sampling all trade diversity for quality. Shumailov et al.'s language-model experiment generated each generation's data by 5-way beam search, which tracks only the five most likely partial outputs and returns the most likely one. That is about as tail-cutting as decoding gets.

Finite training data cut tails by accident. A generator trained on D0D_0 real samples has seen only about the top D01/βzD_0^{1/\beta_z} facts. So its synthetic data are worth at most what D0D_0 real samples were worth. Dohmatob et al. also showed that repeating the loop compounds the loss generation by generation.

In practice, this is the argument against low-temperature sampling when diversity matters. It is also the argument for measuring how well synthetic data cover rare topics, not only their average quality. An interviewer will ask why more synthetic data stopped helping, and the plateau at the tail mass is the answer.

Core

Tails and the bent scaling law

Simulate the memorization model and measure its learning-curve exponent. Implement zipf_missed_mass(beta_z, V, D, k=None, reps=20, seed=0). There are VV facts with true frequencies Pi∝i−βzP_i \propto i^{-\beta_z}, normalized over i=1,…,Vi = 1, \dots, V. The training distribution q\mathbf{q} is PP itself. When k is given, it is instead PP restricted to the top k facts and renormalized. Use rng = np.random.default_rng(seed). For each of reps draws, sample DD training queries with rng.multinomial(D, q), and record the true mass ∑iPi\sum_i P_i of the facts that drew zero queries. Return the mean over the draws.

Then implement fit_exponent(Ds, errors), the least-squares slope of log⁡E\log E against log⁡D\log D.

Tests, hints, verified solutions, and AI help, with Pro at $7.99 a month.

How much fresh real data keeps a loop stable

Accumulation keeps all the real data. What if, instead, each generation gets a fixed fraction κ\kappa of fresh real data and draws the rest from the current model? Go back to the categorical loop of §8.4 (built in Exercise 8.4d). A model is a list of category probabilities, and each generation refits them by counting nn samples. Now each generation draws κn\kappa n samples from the true distribution p0\mathbf{p}_0 and (1−κ)n(1-\kappa)n from the current fit pt\mathbf{p}_t. Track one category ii, with true probability pˉ=p0,i\bar p = p_{0,i} and fitted share pt=pt,ip_t = p_{t,i} after generation tt.

∂ Proof of the stationary variance

Given ptp_t, the count of category ii is a sum of two independent binomials, Bin⁡(κn,pˉ)\operatorname{Bin}(\kappa n, \bar p) from the real draws and Bin⁡((1−κ)n,pt)\operatorname{Bin}((1-\kappa)n, p_t) from the model's own. Dividing by nn,

E[pt+1∣pt]=κpˉ+(1−κ)pt,Var⁡(pt+1∣pt)=κ pˉ(1−pˉ)+(1−κ) pt(1−pt)n.\mathbb{E}[p_{t+1}\mid p_t] = \kappa\bar p + (1-\kappa)p_t, \qquad \operatorname{Var}(p_{t+1}\mid p_t) = \frac{\kappa\,\bar p(1-\bar p) + (1-\kappa)\,p_t(1-p_t)}{n}.

Taking expectations of the first, E[pt+1]=κpˉ+(1−κ)E[pt]\mathbb{E}[p_{t+1}] = \kappa\bar p + (1-\kappa)\mathbb{E}[p_t], and since p0=pˉp_0 = \bar p, induction gives E[pt]=pˉ\mathbb{E}[p_t] = \bar p. Then E[pt(1−pt)]=E[pt]−E[pt2]=pˉ−(vt+pˉ2)=pˉ(1−pˉ)−vt\mathbb{E}[p_t(1-p_t)] = \mathbb{E}[p_t] - \mathbb{E}[p_t^2] = \bar p - (v_t + \bar p^2) = \bar p(1-\bar p) - v_t.

By the law of total variance, vt+1=Var⁡(E[pt+1∣pt])+E[Var⁡(pt+1∣pt)]v_{t+1} = \operatorname{Var}(\mathbb{E}[p_{t+1}\mid p_t]) + \mathbb{E}[\operatorname{Var}(p_{t+1}\mid p_t)]. The first term is (1−κ)2vt(1-\kappa)^2v_t. The second is [κpˉ(1−pˉ)+(1−κ)(pˉ(1−pˉ)−vt)]/n=[pˉ(1−pˉ)−(1−κ)vt]/n\big[\kappa\bar p(1-\bar p) + (1-\kappa)(\bar p(1-\bar p) - v_t)\big]/n = \big[\bar p(1-\bar p) - (1-\kappa)v_t\big]/n. Adding them gives the recursion. Its coefficient is less than 1 in absolute value for n≥1n \ge 1, so vtv_t converges to the fixed point v⋆v^\star that solves v⋆(1−(1−κ)2+(1−κ)/n)=pˉ(1−pˉ)/nv^\star\big(1 - (1-\kappa)^2 + (1-\kappa)/n\big) = \bar p(1-\bar p)/n. Multiplying through by nn and using 1−(1−κ)2=κ(2−κ)1 - (1-\kappa)^2 = \kappa(2-\kappa) gives neffn_{\text{eff}}.

For κ=0\kappa = 0, ptp_t is a martingale, a sequence whose expected next value given the present is the present value, E[pt+1∣pt]=pt\mathbb{E}[p_{t+1}\mid p_t] = p_t. It takes values in the finite set {0,1/n,…,1}\{0, 1/n, \dots, 1\}. A bounded martingale converges, and a convergent sequence in a finite set is eventually constant. From any state strictly between 0 and 1, the next count is binomial and differs from the current one with probability bounded away from zero, so the chain cannot stay at such a state forever. It therefore ends at 0 or 1, which are absorbing. Since its mean stays pˉ\bar p, it ends at 1 with probability pˉ\bar p. ∎

In plain words, fresh data does not stop the drift, but it pulls the fit back toward the truth every generation. The two forces balance at an error equal to that of a single fit on neffn_{\text{eff}} real samples, and for small κ\kappa, neff≈2κnn_{\text{eff}} \approx 2\kappa n. With n=500n = 500 and κ=0.1\kappa = 0.1, neff=95.9n_{\text{eff}} = 95.9. The loop is permanently about as accurate as one fit on 96 real samples. That is worse than the 500 samples it uses each time, and infinitely better than collapse. Population geneticists know the same mathematics as genetic drift with a steady trickle of migrants, the Wright-Fisher model with migration.

Python · cell 6

In practice, a fixed floor of fresh real data in every generation is what turns a collapsing loop into a stable one, and 2κn2\kappa n tells you how much accuracy that floor buys.

Core

Collapse with a little real data

Add fresh real data to the categorical collapse loop of Exercise 8.4d, and watch lost categories come back. Implement collapse_with_real(p0, n, generations, kappa, seed=0). It returns two lists of length generations, the support size (the number of categories with a nonzero count) and DKL(p0∥qt)D_{\mathrm{KL}}(\mathbf{p}_0\Vert\mathbf{q}_t) after each generation.

Use rng = np.random.default_rng(seed) and n_real = int(round(kappa * n)), and start from p0\mathbf{p}_0 as generation 0. Each generation does four things, in this order.

  1. Draw n_real samples from p0 (skip the call when n_real is 0).
  2. Draw n - n_real samples from the current fit (skip the call when it is 0). Use rng.choice(len(p0), size=..., p=...) for both draws.
  3. Add the two count vectors and refit, pt+1\mathbf{p}_{t+1} = counts / n.
  4. For the KL only, smooth the counts as qt=(counts+0.5)/(n+0.5V)\mathbf{q}_t = (\text{counts} + 0.5)/(n + 0.5V), so that lost categories give a finite value.
Tests, hints, verified solutions, and AI help, with Pro at $7.99 a month.

The cleanest general statement is due to Bertrand et al. (2024). Retraining a generative model on a mix of real data and its own samples is stable as long as the synthetic share is small enough. For a model that can fit the data perfectly, that means roughly fewer than one synthetic sample per two real ones. They also proved the converse for the simplest case. A Gaussian refit only on finite samples of its own output always collapses, its covariance shrinking to zero.

Weighing the evidence

The theorems say when a loop is safe in idealized models. This last part lists the ways real loops fail without anyone noticing, reads the experiments on real models, and puts every workflow of the section in one table.

What do real pipelines show? In short, they show what the theorems predict. Replacing data collapses real models, keeping some real data limits the damage, accumulating avoids it, and a verifier prevents it. One more finding matters for practice. Synthetic data helped most when real data were scarce, and when real data were plentiful, adding more synthetic data usually hurt. These are empirical findings in specific settings, and the box below gives the details.

workflowwhat happens to the errorassumptionclosest to
replace with own samplesgrows without bound (linearly in regression)no real data after generation 1self-distillation chains, the alarmist scenario
replace, more synthetic data each generationgrows like ln⁡t\ln tdata grow, old data discardedscaling synthetic data without keeping real data
accumulatebounded by π2/6\pi^2/6 times generation 1everything kept, compute growsthe web, which is not deleted
accumulate, fixed-size subsamplebetween the two, degrades slowlyfixed compute per generationcompute-limited training on a growing web
fresh real fraction κ\kappastationary, like neff≈2κnn_{\text{eff}} \approx 2\kappa n real samplesreal data must span what is taughtcurated mixes with a real-data floor
verified synthetic datacan improve on the generatorverifier with TPRg>FPRg\mathrm{TPR}_g > \mathrm{FPR}_g, enough coveragecode, math, AlphaGeometry, RLVR

Is the internet collapsing? The web behaves like accumulation, since old human text is not deleted and dated snapshots of the crawl exist. So the strong form of collapse is unlikely. But three weaker effects are real.

  • The fraction of fresh human text falls, so new knowledge arrives more slowly.
  • The rarest facts and styles are the first to be underrepresented, which bends data scaling laws long before anything collapses.
  • A lab that cannot tell model-written text from human text cannot choose its mix. That is why provenance, knowing where each document came from, is worth paying for, along with dated crawls and verification.

The 2024 frontier reports that described their data in detail (Llama 3, Nemotron-4, phi-4) all relied heavily on synthetic data. All of them also anchored it in real data and checked it.

Read more

Watch next

🎬 Self Rewarding Language Models · Weizhe YuanThe first author walks through the self-rewarding loop, the judge prompt, and the iteration results, a good companion to the definition and fact boxes.
🎬 MLSS 2026 — Yarin Gal — AI model collapse: the future of knowledge & reasoning in AI · Max Planck Institute for Intelligent SystemsA summer-school lecture on model collapse by a co-author of the Nature paper, covering why tails vanish first and what it means for future training data.
🎬 What Happens When All Training Data is AI Generated? · Mutual InformationA careful, math-first explanation of recursive training on generated data, useful before the replace and accumulate theorems.