Model collapse: Difference between revisions

From testwiki
Jump to navigation Jump to search
imported>Pancho507
See also: Added generation loss
 
(No difference)

Latest revision as of 21:12, 10 January 2025

Template:Short description Model collapseTemplate:Refn is a phenomenon where machine learning models gradually degrade due to errors coming from uncurated training on the outputs of another model, including prior versions of itself.[1][2][3][4] Such outputs are known as synthetic data.

Shumailov et al.[1] coined the term and described two specific stages to the degradation: early model collapse and late model collapse. In early model collapse, the model begins losing information about the tails of the distribution – mostly affecting minority data. Later work highlighted that early model collapse is hard to notice, since overall performance may appear to improve, while the model loses performance on minority data.[5] In late model collapse, the model loses a significant proportion of its performance, confusing concepts and losing most of its variance.

Mechanism

Using synthetic data as training data can lead to issues with the quality and reliability of the trained model.[6][7] Model collapse occurs for three main reasons – functional approximation errors, sampling errors, and learning errors.[1] Importantly, it happens in even the simplest of models, where not all of the error sources are present. In more complex models the errors often compound, leading to faster collapse.

Disagreement over real-world impact

Model collapse in generative models is reduced when data accumulates.

Some researchers and commentators on model collapse warn that the phenomenon could fundamentally threaten future generative AI development: As AI-generated data is shared on the Internet, it will inevitably end up in future training datasets, which are often crawled from the Internet. If training on "slop" (large quantities of unlabeled synthetic data) inevitably leads to model collapse, this could therefore pose a difficult problem.[8]

However, recently, other researchers have disagreed with this argument, showing that if synthetic data accumulates alongside human-generated data, model collapse is avoided.[9] The researchers argue that data accumulating over time is a more realistic description of reality than deleting all existing data every year, and that the real-world impact of model collapse may not be as catastrophic as feared.[10]

An alternative branch of the literature investigates the use of machine learning detectors and watermarking to identify model generated data and filter it out.[11][12]

Mathematical models of the phenomenon

1D Gaussian model

In 2024,[1] a first attempt has been made at illustrating collapse for the simplest possible model — a single dimensional normal distribution fit using unbiased estimators of mean and variance, computed on samples from the previous generation.

To make this more precise, we say that original data follows a normal distribution X0𝒩(μ,σ2), and we possess M0 samples Xj0 for j{1,,M0}. Denoting a general sample Xji as sample j{1,,Mi} at generation i, then the next generation model is estimated using the sample mean and variance:

μi+1=1MijXji;σi+12=1Mi1j(Xjiμi+1)2.

Leading to a conditionally normal next generation model Xji+1|μi+1,σi+1𝒩(μi+1,σi+12). In theory, this is enough to calculate the full distribution of Xji. However, even after the first generation, the full distribution is no longer normal: It follows a variance-gamma distribution.

To continue the analysis, instead of writing the probability density function at each generation, it is possible to explicitly construct them in terms of independent random variables using Cochran's theorem. To be precise, μ1 and σ1are independent, with μ1𝒩(μ,σ2M0) and (M01)σ12σ2Γ(M012,12), following a Gamma distribution. Denoting with Z Gaussian random variables distributed according to 𝒩(0,1) and with Si random variables distributed with 1Mi11Γ(Mi112,12), it turns out to be possible to write samples at each generation as

Xj0=μ+σZj0,

Xj1=μ+σM0Z1+σS1Zj1,

and more generally

Xjn=μ+σM0Z1+σM1S1Z2++σMn1S1××Sn1Zn+σS1××SnZjn.

Note, that these are not joint distributions, as Zn and Sn depend directly on Zjn1, but when considering Xjn on its own the formula above provides all the information about the full distribution.

To analyse the model collapse, we can first calculate variance and mean of samples at generation n. This would tell us what kind of distributions we expect to arrive at after n generations. It is possible to find its exact value in closed form, but the mean and variance of the square root of gamma distribution are expressed in terms of gamma functions, making the result quite clunky. Following,[1] it is possible to expand all results to second order in each of 1/Mi, assuming each sample size to be large. It is then possible to show that

1σ2Var(Xjn)=1M0+1M1++1Mn1+1+𝒪(Mi2).

And if all sample sizes Mi=M are constant, this diverges linearly as n:

Var(Xjn)=σ2(1+nM);𝔼(Xjn)=μ.

This is the same scaling as for a single dimensional Gaussian random walk. However, divergence of the variance of Xjn does not directly provide any information about the corresponding estimates of μn+1 and σn+1, particularly how different they are from the original μ and σ. It turns out to be possible to calculate the distance between the true distribution and the approximated distribution at step n+1, using the Wasserstein-2 distance (which is also sometimes referred to as risk):

𝔼[𝕎22(𝒩(μ,σ2),𝒩(μn+1,σn+12))]=32σ2(1M0+1M1++1Mn)+𝒪(Mi2),

Var[𝕎22(𝒩(μ,σ2),𝒩(μn+1,σn+12))]=12σ4(3M02+3M12++3Mn2+ij4MiMj)+𝒪(Mi3).

This directly shows why model collapse occurs in this simple model. Due to errors from re-sampling the approximated distribution, each generation ends up corresponding to a new step in a random walk of model parameters. For a constant sample size at each generation, the average distance from the starting point diverges, and in order for the end distribution approximation to be accurate, or for the distance to be finite, the sampling rate Mi needs to increase superlinearly, i.e. one needs to collect increasingly more samples over time, perhaps quadratically. However, even in that case the expected distance after n steps remains non-zero and the only case in which it does in fact end up being zero is when sampling is infinite at each step. Overall, this only shows us how far on average one ends up from the original distribution, but the process can only "terminate", if the estimated variance at a certain generation becomes small enough, effectively turning the distribution into a delta function. This is shown to occur for a general gaussian model[6] in the subsection below. Empirical investigation has confirmed this theoretical analysis.[13]

N-D Gaussian model

Furthermore, in the case of multidimensional model with fully synthetic data, exact collapse can be shown.[6][1]

Linear regression

In the case of a linear regression model,[14][15] scaling laws and bounds on learning can be obtained.

Statistical language model

In the case of a linear softmax classifier for next token prediction,[16] exact bounds on learning with even a partially synthetic dataset can be obtained.

Impact on large language models

In the context of large language models, research found that training LLMs on predecessor-generated text — language models are trained on the synthetic data produced by previous models — causes a consistent decrease in the lexical, syntactic, and semantic diversity of the model outputs through successive iterations, notably remarkable for tasks demanding high levels of creativity.[17]

See also

Notes

Template:Reflist

References

Template:Reflist