Recursive Training and Model Collapse › Simulating the Closed Loop

Michael BrenndoerferNovember 26, 20266 min read
Language AI HandbookAll chapters
Part 21 of 67Data Governance, Provenance, and Synthetic Ecosystems
Chapter 153Recursive Training and Model Collapse › Simulating the Closed Loop
Reading section 6 of 12 · Simulating the Closed Loop · 6 minSection 6 of 12 · 6 min

Section 6 of 12 · 6 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

We start with Gaussian recursion because the moments derived above have closed forms, allowing direct checks of the simulation's statistics.

The shared style is already seeded above. The following setup imports the plotting helpers; each stochastic experiment uses its own explicit seed.

Now the loop itself. The learner is a two-line maximum likelihood fit; the sampler is rng.normal. That is the whole self-consuming operator.

PythonIn [5]
CollapseExpand
TRUE_MU, TRUE_SIGMA = 0.0, 1.0


def refit_gaussian(samples):
    """Maximum likelihood fit of a univariate Gaussian (ddof=0)."""
    return samples.mean(), samples.std(ddof=0)


def run_closed_loop(n_samples, generations, seed):
    """Train on your own samples, for `generations` rounds."""
    rng = np.random.default_rng(seed)
    mu, sigma = TRUE_MU, TRUE_SIGMA
    mus, sigmas = [mu], [sigma]
    for _ in range(generations):
        samples = rng.normal(mu, sigma, size=n_samples)
        mu, sigma = refit_gaussian(samples)
        mus.append(mu)
        sigmas.append(sigma)
    return np.array(mus), np.array(sigmas)

We run thirty independent replicates with n=50n = 50 samples per generation over sixty generations. These replicates illustrate the range of outcomes; their averages still have Monte Carlo noise. The sampling, fitting, and path construction happen here, before any figure; the rendering cells that follow only draw the stored arrays.

PythonIn [6]
CollapseExpand
N_SAMPLES = 50
GENERATIONS = 60
REPLICATES = 30

runs_mu, runs_sigma = [], []
for rep in range(REPLICATES):
    mu_path, sigma_path = run_closed_loop(N_SAMPLES, GENERATIONS, seed=rep)
    runs_mu.append(mu_path)
    runs_sigma.append(sigma_path)

runs_mu = np.array(runs_mu)  # shape (REPLICATES, GENERATIONS + 1)
runs_sigma = np.array(runs_sigma)
mean_sigma_path = runs_sigma.mean(axis=0)
mean_mu_path = runs_mu.mean(axis=0)

gen = np.arange(GENERATIONS + 1)
c_sigma = np.sqrt(2 / N_SAMPLES) * np.exp(
    gammaln(N_SAMPLES / 2) - gammaln((N_SAMPLES - 1) / 2)
)
analytic_sigma = TRUE_SIGMA * c_sigma**gen
analytic_rms_sigma = TRUE_SIGMA * (1 - 1 / N_SAMPLES) ** (gen / 2)
analytic_mean_spread = TRUE_SIGMA * np.sqrt(1 - (1 - 1 / N_SAMPLES) ** gen)

The first figure shows standard deviation on a log scale. It distinguishes the exact mean curve cntc_n^t from the RMS curve (1−1/n)t/2(1-1/n)^{t/2}.

VisualizationOut [7]
CollapseExpand
Log-scale plot of thirty fluctuating fitted-standard-deviation paths and their mean over sixty generations, with separate geometrically declining exact-mean and RMS reference curves.
Fitted standard deviation over sixty Gaussian replacement generations, with fifty samples per generation. Thin lines show thirty runs and the thick line their mean. The dashed curve is the exact mean $c_n^t$, about 0.40 at generation sixty; the dotted RMS curve is $(1-1/n)^{t/2}$, about 0.55.

The thirty-run mean tracks the exact mean curve; that theoretical curve lies below the RMS curve. The finite-run mean can cross either curve. Individual fitted variances can increase from one generation to the next, and most displayed runs end narrower than they began. Two of the thirty runs still have slightly more spread than the initial Gaussian at generation sixty. The contraction is an expectation and a long-run tendency, rather than a monotonic pathwise rule.

The second figure shows the same thirty runs by their mean rather than their spread.

VisualizationOut [8]
CollapseExpand
Line plot of thirty model means drifting randomly away from zero over sixty generations.
Mean of the same thirty Gaussian recursive-training runs. The means perform a random walk whose step size is set by the current standard deviation divided by sqrt(n). The walk converges to a random location whose limiting RMS displacement is one original standard deviation; at generation sixty the RMS displacement is about 0.84.

The fitted means illustrate why matching pipeline settings is not enough to match a realized trajectory. Different seeds generally produce different centers, while their expectation remains at the true mean. The distribution of those centers, rather than a single run, measures this component of drift.

Let's check the numbers against the closed forms.

ConsoleOut [9]
CollapseExpand
n = 50 samples/generation, 60 generations
  mean sigma ratio: observed 0.365 | theory 0.402
  mean variance ratio: observed 0.199 | theory 0.298
  mean spread: observed 0.925 | theory 0.838

The observed mean standard-deviation ratio is about 0.365, compared with its exact expectation of 0.402. The spread of the fitted means is about 0.925, compared with the population prediction of 0.838. The mean variance ratio averages squared fitted standard deviations; squaring the mean standard deviation computes a different statistic. Thirty runs give a noisy illustration, rather than a precise verification of each expectation.

Each lineage generates 3,000 points over the sixty rounds, but each successor fits only the latest fifty. The fitted standard deviation averages about 36.5% of its initial value across these runs. The earlier 2,950 points have been discarded; they are not a 3,000-point training corpus for the final model.

The Gaussian simulation is deliberately simple, but it isolates the essential statistics. There is no vocabulary, no decoder, and no architecture. There is only a distribution, a sampler, and a maximum likelihood fit. This demonstrates a collapse mechanism without a language-specific architecture. It does not establish that every repeated noisy fit must collapse.

Comments

Add to the conversation

A question, a correction, or an example from your own work.

No comments yet. Be the first to share your thoughts!

Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy