esolang
Learn · Ideas2 languages show it

Model collapse

Train a model on its own output, then train the next one on that, and so on. The rare things vanish first, then everything else.

●●○ moderate · where to see it

The idea

A language model learns a distribution from data. If you generate text with it, then train a new model on that text, the new model learns a slightly wrong copy of the old distribution. Repeat, and the errors add up. Shumailov, Shumaylov, Zhao, Papernot, Anderson and Gal called this model collapse ("AI models collapse when trained on recursively generated data", Nature 631, 2024; first on arXiv in 2023 as "The Curse of Recursion").

Read the story

They describe two stages.

  • Early collapse. The tails go. Rare words, rare styles, minority cases stop being produced. This is easy to miss, because the common cases still look fine.
  • Late collapse. The distribution shrinks to a narrow lump that looks little like the original. Variety is gone.

Three kinds of error drive it, sampling error (a finite sample misses rare things, and what is never sampled can never be learned back), expressivity error (the model cannot represent the true distribution exactly) and learning error (training does not find the best fit). The first one alone is enough.

Alemohammad and colleagues (2023) found the same thing in image models and called it MAD, model autophagy disorder. Gerstgrasser and colleagues (2024) showed that keeping the real data and adding the generated data, instead of replacing it, avoids the collapse in their settings.

How it works

The smallest model counts words, then writes a new text by sampling from the counts.

The smallest model counts words, then writes a new text by sampling from the counts. In Python 3.

import random, collections
random.seed(1)
corpus = ['the']*8 + ['cat']*4 + ['sat']*3 + ['on','a','mat','today','quietly']
for gen in range(61):
    c = collections.Counter(corpus)                  # "train": count the words
    words, weights = zip(*c.items())
    corpus = random.choices(words, weights, k=20)    # "generate": 20 words from the counts

Distinct words in corpus at each generation.

Gen01102040
Words left86321

At generation 1, mat and quietly are already gone (early collapse). By generation 40 corpus is the twenty times (late collapse). A word that drops to zero can never come back, because the model only knows what it saw. Biologists know this as genetic drift; in a small population, each variant eventually goes extinct or takes over.

The same happens to numbers. Fit a mean and standard deviation to 10 samples, draw 10 new samples from the fit, refit, and repeat. In one run the standard deviation went 1.0 → 0.29 (gen 10) → 0.002 (gen 50) → 0.0.

Seen in

  • bff. When replicators take over, the paper tracks where every byte came from, and the number of distinct origins falls sharply as copies of a few crowd out the rest. Not model collapse, but the same loss of variety.

Try this

  1. Run the word script with k=200 instead of 20. How much longer do the rare words survive?
  2. Add "real data" by mixing 5 words from the original corpus into the 20 each generation. Does any word still go extinct?
  3. Hard: what is the smallest share of real data that keeps every word alive for 300 generations?

Further

  • I. Shumailov et al., "AI models collapse when trained on recursively generated data", Nature 631 (2024); earlier version arXiv:2305.17493.
  • S. Alemohammad et al., "Self-Consuming Generative Models Go MAD" (2023), arXiv:2307.01850.
  • M. Gerstgrasser et al., "Is Model Collapse Inevitable? Breaking the Curse of Recursion by Accumulating Real and Synthetic Data" (2024).
  • Model collapse on Wikipedia

Where to see it