Skip to content

Scaling Data-Constrained Language Models

Pretraining stage 2 #1corefundamentalpaperrubric 11/122023 · ~50 min

Niklas Muennighoff, Alexander M. Rush, Boaz Barak, …, Colin Raffel

Status

TL;DR. Chinchilla assumes every token is fresh. Muennighoff et al. ask what happens when you run out of unique text and must repeat it. Across more than 400 runs (10M to 9B parameters, up to 1,500 epochs), up to about 4 epochs of repeated data are almost as good as new data. Beyond that, each repetition is worth exponentially less, and the value is mostly gone after about 16 epochs. They fit a scaling law with decaying “effective data” and “effective parameters” and use it to give allocation rules for data-limited training.

Why it matters now. Frontier pretraining is close to the limit of high-quality web text, and domain models (scientific, legal, multilingual retrieval corpora) hit it much sooner. If you are pretraining or continued-pretraining a model for a retrieval domain with a fixed corpus, this paper tells you how many passes are worth it and when to add code, filter harder, or shrink the model. It also gives a baseline that any claim about synthetic data should beat: “is a synthetic token worth more than a repeated one?”

Let UDU_D be the number of unique tokens, DD the total tokens trained on, and RD=D/UD−1R_D = D/U_D - 1 the number of repetitions. The effective amount of data is

D′=UD+UDRD∗(1−e−RD/RD∗)D' = U_D + U_D R_D^{*}\left(1 - e^{-R_D/R_D^{*}}\right)

For small RDR_D this is close to DD; as RD→∞R_D \to \infty it saturates at UD(1+RD∗)U_D(1 + R_D^{*}). A symmetric form defines effective parameters N′N', where UNU_N is the compute-optimal size for UDU_D and RN=max⁡(N/UN−1,0)R_N = \max(N/U_N - 1, 0) counts excess parameters. Plugging D′D' and N′N' into the Chinchilla form gives the fitted law (Appendix A, 182 runs):

L=521N′ 0.35+1488D′ 0.35+1.87,RD∗≈15.4,RN∗≈5.3L = \frac{521}{N'^{\,0.35}} + \frac{1488}{D'^{\,0.35}} + 1.87, \qquad R_D^{*} \approx 15.4,\quad R_N^{*} \approx 5.3

At RD=RD∗R_D = R_D^{*}, repeated tokens are worth on average 1−1/e≈63%1 - 1/e \approx 63\% of fresh ones, so RD∗R_D^{*} acts like a half-life. Because RN∗<RD∗R_N^{*} < R_D^{*}, excess parameters lose value faster than repeated data.

Data-constrained scaling: effective data from repeated epochs A plot of effective data D′, measured in units of unique tokens, against the number of epochs on a log axis from 1 to 100. A dashed curve shows raw tokens (equal to the number of epochs), which grow without limit. The fitted curve D′ = U_D (1 + R* (1 − e^(−R/R*))) with R* = 15.4 stays close to the raw-token curve up to about four epochs, bends, and flattens toward an asymptote of 16.4 unique-token equivalents. The right panel lists the fitted decay constants and the practical rules. Effective data D′ / U_D vs epochs (R* = 15.4) 1416100 epochs = 1 + R_D (log scale) 161116.4 limit U_D (1 + R*) = 16.4 U_D raw tokens (no decay) 4 epochs: 3.73 U_D R = R*: 10.7 U_D Fit on 182 runs (App. A) repeated data: R*_D ≈ 15.4 excess params: R*_N ≈ 5.3 extra params lose value faster Up to ~4 epochs ≈ fresh data: 8.7B model, 4 epochs of 44B → val loss only 0.5% worse than 1 epoch of 178B. Short of data? Spend extra compute on epochs before parameters. Code (up to 50% of tokens) and perplexity filtering also stretch a small budget.
Original sketch from the fitted equation. Effective data tracks raw tokens for the first few epochs, then bends toward a ceiling of 16.4 unique-token equivalents.
  • Few epochs are fine (§5). An 8.7B model trained for 4 epochs on 44B unique tokens reaches validation loss only 0.5% higher than 1 epoch on 178B unique tokens.
  • Allocation (§5). For each data budget tested, the best use of extra compute scales epochs faster than parameters. At 9.3×10²¹ FLOPs and 25B unique tokens, the recommended model has 27% fewer parameters than the Chinchilla model and better loss and downstream scores.
  • Tiny budgets (§5). With 100M unique tokens, the best loss came from about 20–60× more parameters and epochs than the one-epoch optimum (about 7,000× more FLOPs), cutting loss by more than 50%.
  • Code and filtering (§6). Up to 50% Python code did not hurt natural-language tasks. Perplexity filtering (top 25%) helped; 100-character-overlap deduplication did not improve the 19-task average.
  • Setup. GPT-2 architecture, C4 (plus OSCAR for some checks), cosine schedule decaying 10×, no early stopping; up to 900B training tokens per run.
  • High-epoch overfitting. The law has no overfitting term. It misses the loss increase at very high repetition (for example around 44 epochs).
  • One data distribution. Decay constants were fitted mainly on C4. Cleaner or more diverse data may decay differently.
  • Loss and a 19-task average. Memorisation, privacy and contamination costs of repetition are not measured.
  • Synthetic data. The paper predates large-scale synthetic pretraining data (see Phi-4, which repeats synthetic data for many epochs). Whether synthetic tokens follow the same decay is open.
  • Chinchilla — the single-epoch law this extends; the same E + A/N^α + B/D^β form.
  • Over-training scaling laws — the other way to leave the Chinchilla point: more tokens per parameter, still fresh.
  • FineWeb and DCLM — aggressive filtering shrinks the unique pool, which is exactly when repetition rules matter.
  • Phi-4 — trains many epochs over synthetic data and reports that it did not overfit.
  • Kimi K2 — a frontier report that discusses making limited high-quality tokens go further.

Questions to think through

These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.

  1. Derive / compute

    With D′ = U_D + U_D·R*_D·(1 − e^(−R_D/R*_D)) and R*_D = 15.4, compute the effective data, in units of the unique tokens U_D, for 1, 2, 4, 16.4 and 40 epochs (R_D = epochs − 1). What is the limit as epochs → ∞, and what does it mean for a team with 100B unique tokens?

    What a strong answer covers
    • 1 epoch: R_D = 0, D′ = 1.0 U_D. 2 epochs: 1 + 15.4(1 − e^(−0.065)) ≈ 1.97. 4 epochs: 1 + 15.4(1 − e^(−0.195)) ≈ 3.73, against 4 raw.
    • 16.4 epochs (R_D = R*): 1 + 15.4(1 − 1/e) ≈ 10.7 U_D, so each repeated token is worth about 63% of a fresh one on average.
    • 40 epochs: 1 + 15.4(1 − e^(−2.53)) ≈ 15.2 U_D, against 40 raw.
    • Limit: D′ → U_D(1 + R*_D) = 16.4 U_D. With 100B unique tokens, no amount of repetition beats about 1.64T fresh tokens.
    • Repeating 4 times costs about 7% of the token value; repeating 40 times wastes most of the compute.
  2. Mechanism

    The fitted decay constants are R*_D ≈ 15.4 for repeated data but R*_N ≈ 5.3 for excess parameters. Explain what each constant measures and why the smaller R*_N implies that, under a data limit, extra compute should go to epochs faster than to parameters.

    What a strong answer covers
    • R*_N measures how quickly parameters beyond the compute-optimal size for the unique data (U_N) lose value. R*_D measures the same for repeated tokens beyond U_D.
    • A smaller constant means faster decay: an excess parameter becomes useless after fewer "repetitions" of the optimal size than a repeated token does.
    • For a fixed extra compute, spending it on epochs buys more effective D′ than spending it on parameters buys effective N′, so the optimum shifts toward more epochs and a smaller model than Chinchilla suggests.
    • The paper checks this at 9.3×10²¹ FLOPs with 25B unique tokens: the data-constrained optimum has 27% fewer parameters yet better loss and downstream scores than the Chinchilla-suggested model.
  3. What if…

    The paper tests two ways to stretch a small data budget: mixing in code, and filtering. Summarise what each did, explain why deduplication did not help in their setting while perplexity filtering did, and say when you would expect deduplication to matter.

    What a strong answer covers
    • Code: filling up to 50% of tokens with Python code showed no drop on natural-language tasks, which roughly doubles the usable tokens.
    • Both start from about 178B tokens. Perplexity filtering (keep the lowest-perplexity 25% under a Wikipedia-trained LM) leaves 44B tokens, repeated about twice, and helped. Deduplication (drop samples with a 100-character overlap) leaves 21B tokens, repeated about four times, and did not help on the 19 tasks.
    • The paper concludes that filtering pays off mainly on noisy data. One plausible reading is that dedup on C4 removed less noise per token lost, so the extra repetition it forced cancelled its benefit.
    • Deduplication should matter more for memorisation, privacy, and benchmark contamination, which the 19-task average does not measure.
  4. Design

    You want to pretrain a 1B-parameter scientific-literature LM for retrieval-augmented QA. You have 20B unique tokens of filtered papers and enough compute for about 200B training tokens. Use the paper's results to plan the data and model, and say what you would monitor to detect that repetition has started to hurt.

    What a strong answer covers
    • 200B over 20B unique tokens is 10 epochs (R_D = 9). D′ ≈ 1 + 15.4(1 − e^(−9/15.4)) ≈ 7.8 U_D, about 156B effective tokens, so roughly 22% of the token budget is lost to repetition.
    • Options: add code or general web text to raise unique tokens (code up to 50% did not hurt language tasks); filter with perplexity rather than heavy deduplication; or shrink the model, since excess parameters decay faster than repeated data.
    • Keep repetition under about 4 epochs for the highest-value subset if possible.
    • Monitor held-out loss on unseen papers (not on repeated ones), the gap between train and held-out loss, and verbatim memorisation rates. The fit does not predict the loss increase seen at very high epoch counts.
  5. Critique

    The fitted law says repeated data loses value smoothly toward a limit, but the paper itself notes that it fails to predict the loss increase at very high epoch counts, for example around 44 epochs. Why might the functional form miss this, and what experiment would map where it breaks?

    What a strong answer covers
    • The form only allows diminishing returns: D′ is monotone in R_D and saturates. It has no term for overfitting, where more passes raise validation loss.
    • At high repetition the model starts memorising the training set, which the single exponential decay cannot capture.
    • The data also used a single schedule shape (cosine decaying 10×) and no early stopping, which interacts with when overfitting starts.
    • Experiment: for a few model sizes, sweep epochs densely from 4 to 100 on a fixed U_D with matched schedules; fit an extra overfitting term and test whether its onset scales with N/U_D.
  6. Research idea

    LLM-generated synthetic data is often described as a way around the data limit. Propose a study that measures how much a synthetic token is worth in D′ terms compared with a repeated real token, with a falsifiable prediction.

    What a strong answer covers
    • Hypothesis: synthetic rewrites of the same U_D behave like partial repetitions, with their own decay constant R*_syn between repetition and fresh data.
    • Minimal experiment: fixed small U_D; arms with k epochs of real data, real plus k rewrites, and fresh real data of equal size; several model sizes; fit D′ with a separate term for synthetic tokens.
    • Falsification: if synthetic tokens give no more than repeated tokens (R*_syn ≈ R*_D), rewriting adds no information beyond repetition.
    • Control for the generator: knowledge injected by the generator model is a confound, so also test rewrites that are forbidden from adding facts.

Done with this page?

Status