On Gopher's compute budget, a 70B model trained on 1.4 trillion tokens beat the 280B Gopher trained on 300 billion. The rule behind it: grow parameters and tokens together, about 20 tokens per parameter. A second paper adds a third knob: the bits that store each number.
Pick a model, or drag the size. The compute stays fixed at Gopher's budget, so a bigger model sees fewer tokens. Find the bottom of the valley. Then we build, piece by piece, the 6ND rule, three ways to find the optimum, the closed-form frontier, overtraining and precision.
You need a little Python and what a loss curve is. We build the rest from zero.
Session 22 of Georgia Tech CS 8803, LLM seminar. It rests on two papers: Hoffmann, Borgeaud, Mensch and 19 co-authors at DeepMind, Training Compute-Optimal Large Language Models (2022), and Kumar, Ankner, Spector, Bordelon, Muennighoff, Paul, Pehlevan, Ré and Raghunathan, Scaling Laws for Precision (2024). Every idea is re-taught here in our own words and devices.
Losses are predicted by the paper's fitted formula L(N, D) = 1.69 + 406.4/N0.34 + 410.7/D0.28 (Section 3.3), not measured. The curve spends 5.76×1023 FLOPs by the 6ND rule. Gopher and Chinchilla sit at their real token counts, so each lies a little off the curve.
Chapter 0
See why the split between model size and data is decided once, before training
A lab reserves a cluster for three months. That fixes the budget: a count of floating-point operations, or FLOPs. Before the run starts, someone picks two numbers: the parameter count and the number of training tokens. A run this large happens once. There is no second try.
From 2020 to 2022 most labs gave the same answer. They kept about 300 billion tokens and spent extra compute on a bigger model. Here are the five largest dense models of early 2022.
Each bar is one published model. Switch the view. Watch the token column stay flat while the parameter column grows.
Sizes and token counts from the Chinchilla paper, Table 1.
What does a run cost? Call the parameter count N and the number of training tokens D. On each token, the forward pass costs about 2 FLOPs per parameter (a multiply and an add). The backward pass costs about twice that.
C is about six times N times D.
Multiply the parameter count N by the token count D. Multiply by 6. That is the training compute C.
Chinchilla: N = 70 billion, D = 1.4 trillion. C = 6 × 70×109 × 1.4×1012 = 5.88×1023 FLOPs. The paper's own layer-by-layer count for Gopher's budget is 5.76×1023, so the rule is 2% high here.
Many pairs (N, D) cost the same C. This session asks: which pair gives the lowest loss? Gopher sits at 300 / 280 = 1.07 tokens per parameter (D divided by N). The paper's answer is about 20.
Failure. A model too big for its data. Symptom: a smaller model trained with the same FLOPs beats it. Measure: tokens per parameter. Fix: choose N and D together from a fitted law, as Chapters 1 to 4 do.
Chapter 1
Read the best model for each FLOP count off the lower edge of many training runs
The paper finds the optimum three separate ways, and trusts it because all three agree. It trains over 400 models, from 70 million to over 16 billion parameters. Approach 1 reuses whole training curves:
Each grey line is one model size trained longer and longer. The teal line is the lowest loss at each FLOP count. Drag the budget and see which size wins.
Illustrative: the curves come from the paper's fitted formula of Chapter 3, with D = C / 6N, for 7 sizes from 70M to 10B. Real runs are noisy and the paper smooths them before taking the minimum.
How does the winner grow with the budget? Call the compute-optimal parameter count Nopt. Assume it grows as a power of the budget C, with an exponent a.
N-opt is proportional to C to the a.
Multiply the budget C by some factor. Then Nopt grows by that factor raised to the power a. The rest of the compute goes to tokens.
Approach 1 finds a = 0.50 (Table 2). Grow C ten times: Nopt grows 100.50 = 3.16 times, say from 1B to 3.16B, and the tokens also grow 3.16 times. Kaplan et al. (2020) had a = 0.73: the model grows 100.73 = 5.4 times and the tokens only 100.27 = 1.9 times.
| Source | a (Nopt ∝ Ca) | b (Dopt ∝ Cb) |
|---|---|---|
| Approach 1, fixed-model curves | 0.50 (0.488 to 0.502) | 0.50 (0.501 to 0.512) |
| Kaplan et al. (2020) | 0.73 | 0.27 |
Table 2 of the paper. Brackets: 10th to 90th percentile over 100 bootstrap resamples of 80% of the data.
Why did Kaplan's study disagree? Its runs all used one cosine learning-rate schedule set for 130 billion tokens. A run read off at 10 billion tokens still had a high learning rate. So its loss looked worse than a run that had decayed. That made small-data training look weak and pushed the fit toward bigger models. Chinchilla matched each schedule to its run length, and every envelope point came from the last 15% of a run.
Failure. A schedule longer than the run. Symptom: short runs look bad. Measure: compare against a run whose cosine ends where it stops. Fix: decay the learning rate 10× over about the number of tokens you train on.
Chapter 2
Fix the budget, vary the model size, and find the bottom of the valley
Approach 2 fixes the budget first. Pick a budget C. Train several model sizes, each on D = C / 6N tokens, so every run costs the same. Plot the final loss against model size. "Iso" means equal: every point on an IsoFLOP profile costs the same FLOPs.
The curve has a valley. Too small a model cannot hold what the data teaches. Too big a model runs out of compute before it reads enough tokens. The paper used 9 budgets from 6×1018 to 3×1021 FLOPs, with sizes up to 16B.
Few runs land exactly on the floor. So the paper fits a parabola to each valley and takes its lowest point, the vertex.
Three runs, each twice the size of the last. The dashed parabola passes through them. Slide the runs away from the floor and watch the vertex drift.
Losses from the paper's fitted formula of Chapter 3, so the true minimum is known. Budgets are the low, middle and high end of the paper's 9.
Where is the vertex? Space three sizes evenly on a log scale, a step h apart. Call their final losses y1, y2 and y3. The vertex sits a distance Δx from the middle size.
Delta x equals minus h times y-three minus y-one, over two times y-three minus two y-two plus y-one.
Subtract the outer losses to get the slope. Combine all three to get the curvature. Divide the slope by twice the curvature, multiply by h, and flip the sign. Move that far from the middle size.
At C = 1020 FLOPs, sizes 501M, 1B and 2B (h = 0.3) give y = 2.60262, 2.60813, 2.65442 from the fitted formula. Slope 0.05181, curvature 0.04078. Δx = −0.3 × 0.05181 / 0.08155 = −0.19. The vertex is at 109 − 0.19 = 645M parameters. A fine scan of the formula also finds 645M.
Fitting Nopt ∝ Ca to the 9 vertices gives a = 0.49 (0.462 to 0.534) and b = 0.51 (0.483 to 0.529). That matches Approach 1, from different runs and a different way of reading them.
Failure. Runs that miss the floor. Symptom: all three losses slope the same way. With sizes 2B, 4B and 8B at 1020, the same recipe says 701M, 9% too high. Fix: train sizes on both sides of the dip. The paper checked that every budget showed a clear minimum.
Chapter 3
Write one formula for the loss of any model size and data size, and fit it to every run
Approach 3 writes one formula for the final loss of any (N, D). It fits that formula to every final loss from Approaches 1 and 2. The formula follows a split of the loss into three parts:
Call the floor E. Give the size gap a scale A and an exponent α. Give the data gap a scale B and an exponent β.
L of N and D equals E, plus A over N to the alpha, plus B over D to the beta.
Shrink A by N to the power alpha. Shrink B by D to the power beta. Add both gaps to the floor E. The sum is the predicted loss.
Chinchilla, N = 70B and D = 1.4T: size gap 0.0835, data gap 0.1632, so L = 1.69 + 0.0835 + 0.1632 = 1.937. Gopher, N = 280B and D = 300B: 0.0521 and 0.2511, so L = 1.993. Gopher's extra size cut the size gap by 0.03, but its short data left a data gap 0.09 bigger.
Grey is the floor, warm is the size gap, purple is the data gap. Drag N and D, or pick a real model. See which gap is larger.
The paper's fitted constants (Section 3.3 and Appendix D.2). The small-model preset (400M on 8B tokens) is a row of Table 3.
The fit minimises a Huber loss between the predicted and observed log loss, with L-BFGS started from a grid of guesses. Huber counts a small miss as its square and a large miss in a straight line, so a few bad runs cannot drag the fit. The paper uses δ = 10−3. Larger δ overfit the cheap runs and predicted the large held-out runs badly.
A check you can run: A and B enter the formula linearly. Fix E, α and β. Two points, (400M, 8B) and (67B, 1.5T), give two equations in two unknowns. Solving them returns A = 406.4 and B = 410.7. With the losses rounded to four decimals you get 406.0 and 411.0.
Failure. A formula that fits small runs but bends wrong at scale. Measure: hold out the largest runs and predict them. Fix: tune the fit on held-out large runs, as the paper did when it chose δ.
Chapter 4
Turn the fitted loss into the best size and data for any budget
With L(N, D) fitted, the best split is calculus. Put D = C / 6N into the loss. Now it depends on N alone. Take the derivative, set it to zero and solve for N.
Call the answer Nopt(C). The paper writes it with a constant G and an exponent a, both built from the fitted α, β, A and B.
N-opt of C equals G times C over six, to the a. And a equals beta over alpha plus beta.
Divide the budget C by 6. Raise it to the power a. Multiply by G. That is Nopt. The tokens are what the budget has left: Dopt = C / 6Nopt.
At Gopher's budget, C = 5.76×1023: C / 6 = 9.6×1022. Raised to 0.452 that is 2.39×1010. Times G = 1.345, Nopt = 32 billion parameters, on D = 3.0 trillion tokens. The paper's Figure 4 says 40 billion; Chapter 4's failure explains the gap.
Since a and b are close, D / N barely moves with the budget. Approach 1's own frontier (Table 3) shows it:
| Parameters | FLOPs | Tokens | Tokens per parameter |
|---|---|---|---|
| 400 million | 1.92×1019 | 8.0 billion | 20.0 |
| 10 billion | 1.23×1022 | 205.1 billion | 20.5 |
| 67 billion | 5.76×1023 (Gopher's) | 1.5 trillion | 22.4 |
| 175 billion | 3.85×1024 | 3.7 trillion | 21.1 |
| 1 trillion | 1.27×1026 | 21.2 trillion | 21.2 |
| 10 trillion | 1.30×1028 | 216.2 trillion | 21.6 |
Six of the nine rows of Table 3 (Approach 1). Check a row with 6ND: 6 × 10×109 × 205.1×109 = 1.23×1022. The 67B row gives 6.03×1023, 5% above its listed budget, because 67B and 1.5T are rounded.
Warm is the best model size, purple the best token count. Drag the budget across ten powers of ten. Switch approach and watch the ratio.
Approach 1: both grow as C0.5 through its Gopher-budget point, 67B on 1.5T tokens (Table 3). Approach 3: the closed form above with the printed, rounded constants; the paper's unrounded fit gives 40B at Gopher's budget.
At Gopher's budget the three approaches say: 67B on 1.5T tokens (Approach 1, Table 3), 63B on 1.4T (Approach 2, Figure 3) and 40B (Approach 3, Figure 4). The paper concludes "between 40 and 70 billion parameters" and trained Chinchilla at the top: 70B on 1.4T tokens, exactly 20 tokens per parameter.
Failure. Trusting one rounded constant. The printed α = 0.34 and β = 0.28 have two decimals. Anywhere inside that rounding the same closed form gives 22 to 47 billion at Gopher's budget. Measure: vary each constant within its last digit. Fix: compare methods and build inside the band they share.
Chapter 5
Train the model the law recommends, on the same compute, and compare
A fitted law is a guess until someone trains the model it recommends. DeepMind trained Chinchilla on the same FLOPs as its own Gopher.
| Model | Layers | Heads | Head size | dmodel | Tokens |
|---|---|---|---|---|---|
| Gopher 280B | 80 | 128 | 128 | 16,384 | 300 billion |
| Chinchilla 70B | 80 | 64 | 128 | 8,192 | 1.4 trillion |
Table 4 and Table 1 of the paper. Same depth and head size; half the width and half the heads.
Is the compute matched? By 6ND, Gopher costs 6 × 280×109 × 300×109 = 5.04×1023 and Chinchilla 5.88×1023. The paper counts FLOPs layer by layer instead (Appendix F) and states that both models used the same number. Its count for that budget is 5.76×1023. For the sizes in Table A4, the layer count differs from 6ND by 1% to 10%.
Other things changed too, so this is not a one-variable test. Chinchilla used AdamW instead of Adam, a slightly different data mix, and a tokenizer without NFKC normalisation (94.15% of tokens shared). Both computed in bfloat16 with a float32 copy of the weights.
Blue is Gopher, teal is Chinchilla. Pick a benchmark. Both bars cost the same training FLOPs.
MMLU 5-shot (Table 6), BIG-bench average of 62 tasks (Section 4.2.4), RACE-h few-shot (Table 7), TruthfulQA 0-shot (Section 4.2.5), BoolQ 0-shot (Table 8), WikiText-103 perplexity (Section 4.2.1, lower is better).
On MMLU, Chinchilla scored 67.6% against Gopher's 60.0%. That beat the June 2023 forecast of 63.4% made by 73 human forecasters. It was better on 51 of the 57 subjects, the same on 2 and worse on 4. On WikiText-103 the paper warns that 4× more data may leak test text, so it puts more weight on MMLU and BIG-bench.
Chinchilla is also 4× smaller. A forward pass costs about 2N FLOPs per token, so each token it serves costs about a quarter of Gopher's.
Failure. Reading a win with several changes as a pure scaling win. Measure: list every difference between the runs. Fix: ablate them; Appendix G tests the optimiser changes on their own.
Chapter 6
Price in serving, and see why labs train small models far past 20 tokens per parameter
Chinchilla's rule minimises training compute only. A deployed model also pays for every token it serves. A forward pass costs about 2N FLOPs per token, so serving T tokens costs 2NT. Set that equal to the training cost 6ND, and T = 3D. Gopher's serving matches its training cost after 900 billion tokens. Chinchilla's matches after 4.2 trillion.
Past that point, a smaller model wins on total cost. So labs now train small models far past 20 tokens per parameter. The precision paper cites Llama-3-8B at about 2,000 and the Gemma-2 series at over 1,000. Training a model on far more tokens than the compute-optimal count is called overtraining.
What does overtraining give up? Call the tokens per parameter r (r = D / N). Under the 20-tokens rule, a model of size Neq costs 6 × Neq × 20Neq = 120Neq2 FLOPs. Ask which Neq costs the same as your run.
N-eq over N equals the square root of r over twenty.
Divide your tokens per parameter r by 20. Take the square root. That is how many times bigger a model the same compute would buy at the Chinchilla ratio. N cancels, so it holds at any size.
Llama-3-8B: N = 8B, r = 2,000, so D = 16T tokens. Its compute is 6 × 8×109 × 16×1012 = 7.68×1023 FLOPs. √(2,000 / 20) = 10, so that compute would train an 80B model at 20 tokens per parameter. The lab chose 8B because serving it costs a tenth as much.
Drag the tokens per parameter. Four bars show what changes against a Chinchilla-style run of the same model, on a log scale.
Our arithmetic from 6ND, 2N FLOPs per served token and the 20-tokens rule. The fragility bar uses the precision paper's fitted exponent γD = 0.5068 (Chapter 7): same model, same bits, more data.
Overtraining also hits a data wall. Table 3's 10-trillion-parameter model needs 216.2 trillion tokens, which the paper calls "far beyond what is currently used". The paper also lists its own limits:
Failure. Overtrain, then quantize for serving. Symptom: the compressed model loses more quality than expected. Measure: loss before and after quantization. Fix: Chapter 7.
Chapter 7
Measure what fewer bits cost, after training and during it
The model stores every number in some count of bits: its precision. Fewer bits mean less memory and, on suitable hardware, faster maths. Kumar et al. (2024) ask what bits do to loss. They train 465 OLMo-style models on Dolma, 30M to 220M parameters on 1.5B to 26B tokens, in 3 to 16 bits.
There are two ways to use fewer bits:
First finding. Call the extra loss that PTQ adds δPTQ, and the precision after rounding Ppost. The paper fits a scale CT and three exponents.
Delta-PTQ equals C-T times D to the gamma-D, over N to the gamma-N, times e to the minus P-post over gamma-post.
Raise D to gamma-D and divide by N to gamma-N. Scale by C-T. Shrink by one fixed factor for every bit Ppost. Since gamma-D and gamma-N are close, the damage roughly tracks tokens per parameter.
Same 8B model, same bits, 100 times more data: 16T tokens against 160B. N, CT and Ppost cancel in the ratio, so the damage grows 1000.5068 = 10.3 times.
The fit has R2 = 0.97 (Figure 2). Past a critical data size, more pretraining makes the quantized model worse, even while the unquantized loss keeps falling.
Second finding. Low-precision training acts like having fewer parameters. Call the effective parameter count Neff, the training precision P, and a fitted sensitivity γ.
N-eff equals N times one minus e to the minus P over gamma.
Divide the bits P by gamma. Take e to minus that. Subtract it from one. Multiply N by the result to get Neff.
Weights at P = 4 bits, gamma-w = 2.6745: e−1.496 = 0.224, so the share is 0.776. A 70B model trained with 4-bit weights acts like a 54B one. At 8 bits the share is 0.950; at 16 bits, 0.997.
The three parts multiply: Neff = N × (share for weights) × (share for activations) × (share for KV cache). Put Neff in place of N in the Chinchilla formula and the loss follows.
Each curve is one part of the model; the teal curve is all three multiplied. Drag the bits. Watch which part falls first.
The paper's fitted γ for each part, with the per-part offset n that Appendix K says the fit adds: share = 1 − e−P/γ + n. That reading of the offset reproduces the paper's 3-bit instability and its 7 to 8 bit optimum (Chapter 8).
Failure. Activations or KV cache at 3 bits. The paper's runs there often diverged, so it does not fit them. Measure: watch the loss for spikes. Fix: keep those parts at 4 bits or more.
Chapter 8
Spend one budget across parameters, tokens and bits, and find the best training precision
Bits cost compute too. The paper scales Chinchilla's cost linearly in the training precision P:
C = (6 / 16) · N · D · P at P = 16 bits this is 6ND
Now fix P. How do the best N and D move against Chinchilla's full-precision answer, NCh? Call the average of the three sensitivities γ̄ (gamma-bar), 1.9475.
N-star of P over N-Ch is proportional to one minus e to the minus P over gamma-bar, raised to minus three alpha over alpha plus beta, times P to the minus beta over alpha plus beta.
Lower P shrinks the bracket, and the negative power turns that into a bigger N*. Lower P also frees compute. Both say: if you must train in low precision, add parameters before data.
The paper ties alpha = beta = 0.4965. From 16 to 4 bits the bracket goes from 0.99973 to 0.87177. N*(4) / N*(16) = (0.99973 / 0.87177)1.5 × (16 / 4)0.5 = 1.228 × 2 = 2.46. The full fit, with its offsets, is steeper: the device gives 4.6, in line with the paper's warning that below 4 bits models must grow "more than 4x".
Now let P move too. Setting all three derivatives to zero removes C from the equation for the best P. So the compute-optimal precision does not depend on the budget. The paper finds it "around 7-8 bits". If N is fixed in advance, as in a model family with set sizes, the best precision instead grows with log C.
The curve is the best loss at each training precision for one budget. The pink dot is your precision, the teal ring the best one. Drag the budget in both modes and watch whether the ring moves.
Computed live from the paper's fitted constants (Appendix K: A = 4,299, B = 18,060, E = 2.7648, α = β = 0.4965, per-part γ and offsets) under C = (6/16)NDP. The constants come from runs of 30M to 220M parameters; the paper says to trust the trends, not the numbers.
Two practical messages follow. Training in 16 bits spends compute on bits the model barely uses. Pushing below 4 bits forces the model to grow faster than the saved FLOPs can pay for. The paper's footnote adds that real speedups are less than linear in bits, because of systems overhead.
Failure. Training in 16 bits out of habit. Symptom: nothing visible; you pay for unused bits. Measure: a small IsoFLOP sweep over precision. Fix: about 7 to 8 bits when N is free; more bits for a fixed-size model that is heavily overtrained.
Chapter 9
Keep the terms, the numbers, the code and the open questions in one place
Chinchilla showed that parameters and tokens should grow together, about 20 tokens per parameter, and proved it by beating Gopher on the same compute. The precision paper treats bits as a third resource: fewer bits shrink the effective parameter count, data makes later rounding hurt more, and 7 to 8 bits is the fitted training optimum. Both papers use one method: fit a small formula to many runs, then minimise it.
| Term | Meaning | Number to remember |
|---|---|---|
| 6ND | training FLOPs for N parameters on D tokens | Chinchilla: 5.88×1023 |
| Tokens per parameter | D / N | Gopher 1.07; Chinchilla 20 |
| Exponents a, b | Nopt ∝ Ca, Dopt ∝ Cb | 0.50 / 0.50 (Approach 1); Kaplan 0.73 / 0.27 |
| Parametric loss | E + A/Nα + B/Dβ | 1.69, 406.4, 410.7, 0.34, 0.28 |
| Gopher's budget | the best size by method | 67B, 63B, 40B; built 70B on 1.4T |
| MMLU | 5-shot average, 57 subjects | 60.0% to 67.6% |
| Overtraining | r far above 20 | Llama-3-8B about 2,000; Neq/N = √(r/20) = 10 |
| δPTQ | loss added by rounding after training | grows as D0.5068: 100× data, 10.3× damage |
| Neff | parameters still useful at P bits | weights at 4 bits: 0.776 (main-text form) |
| Best training precision | N, D, P all free | 7 to 8 bits, for any budget |
pythonimport math E, A, B, alpha, beta = 1.69, 406.4, 410.7, 0.34, 0.28 # Chinchilla, Approach 3 def loss(N, D): # nats per token return E + A / N**alpha + B / D**beta def frontier(C): # best N and D for budget C (FLOPs) a = beta / (alpha + beta) G = (alpha * A / (beta * B)) ** (1 / (alpha + beta)) N = G * (C / 6) ** a return N, C / (6 * N) def n_eff_share(P, gamma=2.6745): # weights, main-text form return 1 - math.exp(-P / gamma) print(loss(70e9, 1.4e12), loss(280e9, 300e9)) # 1.937 1.993 print(frontier(5.76e23)) # (3.22e10, 2.98e12): 32B on 3.0T print(math.sqrt(2000 / 20), 100 ** 0.5068) # 10.0 10.3 print(n_eff_share(4), n_eff_share(8)) # 0.776 0.950
| Session | Link to the (N, D, P) frame |
|---|---|
| 01 Pretraining data | supplies the tokens D, and their quality |
| 04 Mixture of experts | separates total N from compute per token |
| 08 Attention sinks | the same KV cache, under eviction instead of rounding |
| 15 Test-time scaling | spends compute at inference, outside 6ND |
| 21 Calibration | two models with equal loss can be calibrated differently |
Chinchilla: only two large runs, a hint that large optima are still too big, and no runs that repeat data. The precision paper: small models (up to 220M fitted, 1.7B validated), integer-type fits checked on floating point, loss only (no downstream tasks), a fixed architecture, and a cost model that real hardware does not reach. Both say the functional forms matter more than the constants.
Credit: Session 22 of Georgia Tech CS 8803, LLM seminar. Papers: Training Compute-Optimal Large Language Models (Hoffmann et al., arXiv 2203.15556) and Scaling Laws for Precision (Kumar et al., arXiv 2411.04330). The toy curves and our own arithmetic are labelled where they appear.
Teach it back: open Present or Teach and explain why Gopher was too big for its compute. Then go back to the valley and find its floor before you press Chinchilla.