Sam Babichenko

Reading notes / Scaling laws

Chinchilla scaling

Hoffmann et al., 2022

Context. Kaplan et al. (2020) fit power laws for language-model loss and concluded that a growing budget should go mostly into model size, Nopt∝C0.73N_{opt}\propto C^{0.73} and Dopt∝C0.27D_{opt}\propto C^{0.27}: ten times the compute means a 5.5 times larger model and only 1.8 times more tokens. GPT-3, Gopher and MT-NLG followed it, with 175B to 530B parameters on roughly 300B tokens each. This paper redoes the allocation with each run's learning-rate schedule matched to its length and most models above 500M parameters, and finds an even split: parameters and tokens should grow in equal proportion. With C≈6NDC\approx6ND fixed and a loss that falls as one power law in NN and another in DD, the optimum balances the two marginal returns, so Nopt∝Cβ/(α+β)N_{opt}\propto C^{\beta/(\alpha+\beta)}. The measured exponents are close, so tokens per parameter stay nearly constant across scales; the value, about 20, is measured. The solvable models in this section derive such exponent pairs from power-law spectra.

Setting. Decoder-only transformers trained for one pass over MassiveText with a cosine schedule that decays the learning rate tenfold; NN counts all parameters, embeddings included, and FLOPs are counted layer by layer (within 10% of 6ND6ND). The object is Nopt(C), Dopt(C)=arg min⁡FLOPs(N,D)=CL(N,D),N_{opt}(C),\,D_{opt}(C)=\operatorname*{arg\,min}_{\mathrm{FLOPs}(N,D)=C}L(N,D), with LL the final smoothed training loss, an unbiased estimate of the test loss because no token is seen twice. Over 400 runs cover 70M to 16B parameters and 5B to 500B tokens.

Main findings. Three estimators of Nopt∝CaN_{opt}\propto C^a, Dopt∝CbD_{opt}\propto C^b give a=0.50, 0.49, 0.46a=0.50,\,0.49,\,0.46 and b=0.50, 0.51, 0.54b=0.50,\,0.51,\,0.54, against Kaplan's 0.730.73 and 0.270.27, and the IsoFLOP method on C4 and on GitHub code gives a=0.50a=0.50 and 0.530.53. At Gopher's budget, 5.76×10235.76\times10^{23} FLOPs, the optimum is 40B to 70B parameters (Approach 1: 67B on 1.5T tokens), where Gopher used 280B on 300B. The test is Chinchilla, 70B parameters on 1.4T tokens with Gopher's compute: it beats Gopher on every Pile subset and averages 67.6% on 5-shot MMLU against 60.0%. Everything is empirical: the power-law frontier is assumed, and only the direction of the prediction is tested at scale.

Step 1

The envelope of matched-schedule training curves scales as C0.50C^{0.50}. For each size, train four runs whose cosine cycles span a 16-fold range of horizons, and at each FLOP value record which run reaches the lowest loss and at which (N,D)(N,D); power-law fits give a=b=0.50a=b=0.50. Every selected point lies in the last 15% of its run, which gives the practical rule of ending a run where its cosine cycle ends. A loss read mid-schedule, before the learning rate has decayed, overstates what that (N,D)(N,D) can reach, and cycles that overshoot the run by more than 25% clearly hurt.

Step 2

IsoFLOP profiles have a clear valley whose minimizer moves as C0.49C^{0.49}. At nine budgets from 6×10186\times10^{18} to 3×10213\times10^{21} FLOPs, vary NN with DD set by the budget and the schedule matched to DD, and fit a parabola in log⁡N\log N to each profile. Every profile has a minimum, and the minimizers follow Nopt∝C0.49N_{opt}\propto C^{0.49}, Dopt∝C0.51D_{opt}\propto C^{0.51}. This is the most direct estimator, though its largest budget is about 200 times smaller than Gopher's.

Step 3

The parametric fit, once correctly optimized, agrees with the other two. Fit L^(N,D)=E+A/Nα+B/Dβ\hat L(N,D)=E+A/N^\alpha+B/D^\beta (entropy of text, finite model, finite one-pass training) to all final losses with a Huber loss on log⁡L\log L and L-BFGS. Under 6ND=C6ND=C the optimum is Nopt=G(C6)βα+β,Dopt=G−1(C6)αα+β,G=(αAβB)1α+β.N_{opt}=G\Big(\frac C6\Big)^{\frac{\beta}{\alpha+\beta}},\qquad D_{opt}=G^{-1}\Big(\frac C6\Big)^{\frac{\alpha}{\alpha+\beta}},\qquad G=\Big(\frac{\alpha A}{\beta B}\Big)^{\frac1{\alpha+\beta}}. As published, the fit gives a=0.46a=0.46 and a 40B optimum at Gopher's budget. Besiroglu et al. (2024), refitting 240 runs digitized from the paper's contour plot, find a fitting error instead: averaging instead of summing the Huber terms made L-BFGS stop early, which the authors confirmed and which explains the implausibly narrow bootstrap interval a∈[0.454,0.455]a\in[0.454,0.455]. Their refit, E=1.82E=1.82, A=482A=482, B=2085B=2085, α=0.348\alpha=0.348, β=0.366\beta=0.366, gives a=0.51a=0.51 with standard error about 0.02. At Gopher's budget (my check) the published fit gives about 40B parameters and 59 tokens per parameter, the refit about 72B and 18. So, if the digitization is faithful, the corrected Approach 3 agrees with Steps 1 and 2 and with how Chinchilla was trained, and the published Approach 3 numbers and their prediction of even smaller models do not stand.

Step 4

Why Kaplan's allocation differs is not settled by this paper. Kaplan trained every model on one fixed-length cosine schedule and read compute-optimal points off intermediate steps, whose mid-schedule losses, the paper argues, undervalue shorter training and push the fit toward larger models. And many of Kaplan's runs are under 100M parameters while the frontier log⁡Nopt\log N_{opt} is concave in log⁡C\log C, so slopes fit on small models overpredict size at large budgets. In the one head-to-head test, at 102110^{21} FLOPs, the 2.80B model chosen by Approach 1 beats the 4.74B model chosen by Kaplan's law, which confirms the allocation without isolating a cause. Pearce and Song (2024; read here from the abstract only) attribute much of the gap to Kaplan counting non-embedding parameters at small scale. The mechanism is our gloss, checked only by a toy calculation: embeddings are a large share of a small model and a shrinking share of a large one, so along the same frontier the non-embedding count grows faster than the total and its fitted exponent comes out above 0.5. Porian et al. (2024; also abstract only) remove Kaplan's exponent by correcting last-layer compute, warmup and optimizer tuning, and report that careful learning-rate decay is not essential, so the schedule explanation remains an untested hypothesis.

Step 5

At equal compute, the smaller model trained longer is better almost everywhere. Chinchilla also swaps Adam for AdamW, drops NFKC normalization from the tokenizer and keeps float32 weight copies in the optimizer, so the comparison mixes allocation with these changes. It lowers bits per byte on all Pile subsets, raises MMLU from 60.0% to 67.6% and BIG-bench from 54.4% to 65.1%, at about a quarter of Gopher's inference compute per token. The language-modelling gains carry a leakage caveat, since Chinchilla sees four times more data, so the paper leans on MMLU and BIG-bench. One pair of large runs confirms the direction of the prediction and says nothing about the exponent.

Consequences and limits. Data becomes the binding constraint: the Approach 1 projections give a compute-optimal 175B model 3.7T tokens and a 1T model 21T tokens, far beyond the corpora then in use, which moved attention to data collection and made "about 20 tokens per parameter" a rule of thumb. The objective is training compute alone, so a model that will serve many queries should be smaller and trained well past 20 tokens per parameter (Sardana and Frankle, 2023). All runs are single-epoch, so repeated data is not covered; the frontier is assumed to be a power law although it bends, which argues for still smaller models; only two runs exist at large scale; and the exponents are less certain than the tables suggest, since the corrected Approach 3 allows 4 to 40 tokens per parameter at 102610^{26} FLOPs.

Terms

C≈6NDC\approx6ND
training FLOPs: about 6 per parameter per token (2 forward, 4 backward)
Nopt∝Ca, Dopt∝CbN_{opt}\propto C^a,\ D_{opt}\propto C^b
compute-optimal allocation; here a≈b≈0.5a\approx b\approx0.5, Kaplan 0.73,0.270.73,0.27
Approach 1 (envelope)
lowest loss per FLOP across runs of fixed sizes and matched schedules
Approach 2 (IsoFLOP)
fixed budget, vary NN; the valley's minimizer gives Nopt(C)N_{opt}(C)
L^=E+A/Nα+B/Dβ\hat L=E+A/N^\alpha+B/D^\beta
Approach 3: entropy, approximation error, optimization/data error
a=β/(α+β)a=\beta/(\alpha+\beta)
the faster the data term decays, the more compute goes to parameters
Matched cosine cycle
schedule length equal to the run's tokens; overshooting by more than 25% clearly hurts
Non-embedding NN
Kaplan's count; excludes vocabulary and position embeddings and their FLOPs
About 20 tokens per parameter
Chinchilla-optimal ratio, roughly constant when a=ba=b
Besiroglu et al. refit
α=0.348\alpha=0.348, β=0.366\beta=0.366, a=0.51±0.02a=0.51\pm0.02; the published fit stopped early

Quiz

  1. Approach 3 originally reported a∈[0.454,0.455]a\in[0.454,0.455] from 100 bootstraps. Why was the interval so narrow, according to the replication and the authors' reply?
  2. The fitted frontier log⁡Nopt\log N_{opt} is concave in log⁡C\log C. What does that imply for extrapolating from small budgets?
  3. The analysis uses the smoothed training loss in place of a held-out loss. Why is that legitimate here?

Sources