Skip to content

Scaling Laws for Neural Language Models

optionalcorefundamentalpaperrubric 9/122020 · ~50 min

Jared Kaplan, Sam McCandlish, Tom Henighan, …, Dario Amodei

Status

TL;DR. Kaplan et al. trained Transformer language models across many sizes and found that test loss falls as a power law in parameters N, data D and compute C, over many orders of magnitude. Shape (depth versus width) matters little. Bigger models are more sample-efficient. They concluded that, for a fixed compute budget, you should train a very large model and stop well before convergence, growing N roughly as C^0.73.

Why it matters now. This paper set the method every scaling study still uses: fit simple power laws on cheap runs and extrapolate to decide the expensive one. Its allocation rule (big models, fewer tokens) shaped GPT-3-era models, and Chinchilla overturned it. For IR and RL work, the same recipe sizes retrievers, rerankers and reward models (see reward-model overoptimization scaling). The cautionary tale matters just as much: a small bias in how you measure short runs can change the answer by a factor of several.

Each resource, when the other two are not the bottleneck, gives a power law (§1.2, non-embedding parameters, loss in nats/token on WebText2):

L(N)=(NcN)αN,L(D)=(DcD)αD,L(Cmin⁡)=(CcCmin⁡)αCL(N) = \left(\frac{N_c}{N}\right)^{\alpha_N},\quad L(D) = \left(\frac{D_c}{D}\right)^{\alpha_D},\quad L(C_{\min}) = \left(\frac{C_c}{C_{\min}}\right)^{\alpha_C}

with αN≈0.076\alpha_N \approx 0.076, αD≈0.095\alpha_D \approx 0.095 and αC≈0.050\alpha_C \approx 0.050. Doubling the model lowers loss by a factor of only 2−0.076≈0.952^{-0.076} \approx 0.95, but the trend holds very steadily.

The two are combined into one law for overfitting (Eq. 1.5):

L(N,D)=[(NcN)αN/αD+DcD]αDL(N, D) = \left[\left(\frac{N_c}{N}\right)^{\alpha_N/\alpha_D} + \frac{D_c}{D}\right]^{\alpha_D}

A separate fit (Eq. 1.6) describes learning curves as a function of steps: L(N,S)=(Nc/N)αN+(Sc/Smin⁡)αSL(N, S) = (N_c/N)^{\alpha_N} + (S_c/S_{\min})^{\alpha_S}, with αS≈0.76\alpha_S \approx 0.76. With C≈6NBSC \approx 6NBS, minimising loss at fixed compute gives N∝C0.73N \propto C^{0.73}, B∝C0.24B \propto C^{0.24} and S∝C0.03S \propto C^{0.03}. Data therefore grows only as about C0.27C^{0.27}. The critical batch size depends on the loss alone, Bcrit=B∗/L1/αBB_{\text{crit}} = B_*/L^{1/\alpha_B} with B∗≈2×108B_* \approx 2\times10^8 tokens.

Kaplan versus Chinchilla: how to spend ten times more compute, and why Kaplan's fit leaned toward bigger models Left: two pairs of bars show how a tenfold compute increase is split. Kaplan's exponents (N proportional to C to the 0.73, D to C to the 0.27) grow the model about 5.4 times and the data about 1.9 times. Chinchilla's exponents (about 0.5 each) grow both about 3.2 times. Right: a sketch of loss against tokens for two runs of the same model. A run whose cosine schedule was set for a much longer horizon, read off early, sits above a run whose schedule ends at that token count. Reading intermediate losses from long schedules overstates the loss of short runs, which makes extra data look less useful and pushes the fit toward larger models. 10× more compute: where does it go? bar length ∝ log of the growth factor Kaplan N ∝ C^0.73, D ∝ C^0.27 params ×5.4 tokens ×1.9 Chinchilla N ∝ C^0.50, D ∝ C^0.50 params ×3.2 tokens ×3.2 Chinchilla rule of thumb: about 20 tokens per parameter (Approach 1 table). Kaplan's overfitting bound: D ≳ 5×10³ · N^0.74, so an 8× bigger model needs only ~5× more data. N counts non-embedding params in Kaplan; all params in Chinchilla. One source of bias: fixed schedules loss tokens seen → D′ gap = loss overstated coloured: long schedule, read off at D′ plain: schedule that ends at D′ Short runs look worse → fit favours bigger N.
Original sketch. Left: how Kaplan's and Chinchilla's exponents split a 10× compute increase between parameters and tokens. Right: why reading early losses from a long cosine schedule overstates the loss of short runs.
  • Joint fit (Table 2). αN=0.076\alpha_N = 0.076, αD=0.103\alpha_D = 0.103, Nc=6.4×1013N_c = 6.4\times10^{13}, Dc=1.8×1013D_c = 1.8\times10^{13}.
  • Data needed to avoid overfitting (Eq. 4.4). D≳5×103 N0.74D \gtrsim 5\times10^3\, N^{0.74} tokens. For a 1B model that is about 23B tokens; for 70B it is about 530B tokens.
  • Allocation (§6). N∝C0.73N \propto C^{0.73}; the theory from the separate fits predicts αC≈0.054\alpha_C \approx 0.054 and N∝C0.71N \propto C^{0.71}, close to the direct measurement.
  • Contradiction point (§6.3). Extrapolating the compute-efficient frontier and the data law, they cross near C∗∼104C^* \sim 10^4 PF-days, N∗∼1012N^* \sim 10^{12} parameters, D∗∼1012D^* \sim 10^{12} tokens and L∗≈1.7L^* \approx 1.7 nats/token.
  • Setup. Models trained for a fixed 2.5×10⁵ steps with 512×1024-token batches, 3,000-step warm-up then cosine decay, on WebText2 (about 22B tokens). This fixed schedule is the detail later work picked apart.
  • Schedule bias. Every run used the same token budget and schedule, so losses at intermediate token counts come from runs whose learning rate had not decayed. Chinchilla (§2) argues this overstates the loss of shorter training and inflates the model exponent.
  • What counts as N. Kaplan excludes embedding parameters. Pearce and Song (TMLR 2024) show that this choice, combined with small model sizes, explains much of the gap to Chinchilla. Porian et al. (NeurIPS 2024) add last-layer FLOPs, warm-up length and per-size optimizer tuning, and recover Chinchilla’s exponent once these are fixed.
  • Loss, not capability. The laws describe next-token loss on one distribution. Whether downstream task accuracy follows a power law is a separate question (see emergent abilities and the mirage rebuttal).
  • Single epoch. Data is never repeated. The data-constrained regime needs its own law.

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

    Use Kaplan's joint fit L(N, D) = [(N_c/N)^(α_N/α_D) + D_c/D]^α_D with α_N = 0.076, α_D = 0.103, N_c = 6.4×10¹³, D_c = 1.8×10¹³. Compute the predicted loss for (a) N = 280B, D = 300B tokens and (b) N = 70B, D = 1.4T tokens. These two runs cost about the same compute. Which does Kaplan's fit prefer, and what did Chinchilla later observe?

    What a strong answer covers
    • α_N/α_D ≈ 0.738. (a) N_c/N ≈ 229, raised to 0.738 gives ≈ 55. D_c/D = 60. The sum is ≈ 115, and 115^0.103 ≈ 1.63.
    • (b) N_c/N ≈ 914, raised to 0.738 gives ≈ 153. D_c/D ≈ 12.9. The sum is ≈ 166, and 166^0.103 ≈ 1.69.
    • Kaplan's fit prefers the large, under-trained model (lower predicted loss). The model term dominates the bracket, so extra parameters buy more than extra data.
    • Chinchilla trained exactly this comparison (Gopher 280B on 300B tokens against Chinchilla 70B on 1.4T) and found the smaller model better on almost every benchmark.
    • Caveat: Kaplan's N excludes embeddings and its losses are WebText2 nats, so the absolute values do not transfer. The ordering is the point.
  2. Derive / compute

    Kaplan fits the critical batch size as B_crit(L) = B*/L^(1/α_B) with B* ≈ 2×10⁸ tokens and α_B ≈ 0.21. Compute B_crit at L = 3.0 and at L = 2.5 nats/token. What does the trend imply for a fixed batch size over a long run?

    What a strong answer covers
    • 1/α_B ≈ 4.76. At L = 3.0: 3.0^4.76 ≈ 187, so B_crit ≈ 1.1M tokens. At L = 2.5: 2.5^4.76 ≈ 79, so B_crit ≈ 2.5M tokens.
    • This matches the paper's statement that B_crit is about 1–2M tokens near convergence for its largest models.
    • B_crit depends on the loss reached, not directly on model size. As loss falls, the gradient noise scale grows and larger batches stop wasting compute.
    • A batch fixed early is too large at the start (wasted compute) and too small late (wasted steps). Batch-size warm-up or ramping follows from this.
  3. Mechanism

    Kaplan finds that larger models reach a given loss in fewer tokens, and concludes that compute-optimal training should use very large models stopped well before convergence. Explain the chain of reasoning from the L(N, S) learning-curve fit to the N ∝ C^0.73 allocation.

    What a strong answer covers
    • Learning curves fit L(N, S) = (N_c/N)^α_N + (S_c/S_min)^α_S. At fixed steps, larger N has lower loss, so per token it learns more.
    • Compute is C ≈ 6NBS. For a fixed C, choose N and S to minimise L. Because the N term keeps falling while the step term flattens quickly (α_S ≈ 0.76 is large), the optimum spends most new compute on N.
    • The result is N ∝ C^0.73, B ∝ C^0.24, S ∝ C^0.03. Steps barely grow, so data D = B·S grows only as about C^0.27.
    • The argument relies on learning curves measured inside runs with one fixed schedule. If those intermediate losses are biased upward for short horizons, data looks less useful than it is.
  4. Critique

    Chinchilla attributes Kaplan's larger model exponent partly to training every run with the same token count and learning-rate schedule. Later work points to non-embedding parameter counts, small model sizes, warm-up length and optimizer tuning. Pick the factor you think matters most and design the experiment that isolates it.

    What a strong answer covers
    • Schedule factor: a cosine schedule set for 130B tokens, read off at D′ ≪ 130B, has not decayed its learning rate, so its loss is higher than a run whose schedule ends at D′. This penalises short runs and favours large N.
    • Parameter-count factor (Pearce and Song, TMLR 2024): counting only non-embedding parameters at small scale bends the fitted frontier toward Kaplan's exponent.
    • Porian et al. (NeurIPS 2024) reproduce Kaplan's law and remove the gap by fixing last-layer compute, warm-up duration and scale-dependent optimizer tuning. They also report that careful learning-rate decay is not essential.
    • Experiment: hold one dataset and grid, then toggle one factor at a time (matched vs fixed schedule; total vs non-embedding N; warm-up scaled vs fixed; tuned vs fixed LR per size). Refit the exponent after each toggle and report bootstrap intervals.
  5. Design

    You have 2,000 A100-hours to decide whether a new LLM-based reranker should be 1B or 3B parameters for a final run of about 10²¹ FLOPs. How would you use Kaplan-style power-law fits on small runs to decide, and which pitfalls from this paper and its critics would you guard against?

    What a strong answer covers
    • Train a ladder of small models (for example 5 sizes over one order of magnitude) with schedules matched to each run's length. Fit loss against N and D, then extrapolate to 10²¹ FLOPs.
    • Fit the metric you can extrapolate (held-out loss of the reranking objective) and map it to nDCG separately. Ranking metrics are thresholded and may not follow a clean power law.
    • Count total parameters and real FLOPs (including the output layer). Tune the learning rate per size, or use a parametrisation such as μP that transfers it.
    • Report uncertainty: bootstrap the fit and check whether 1B and 3B are distinguishable. If not, prefer the smaller model for inference cost.
  6. Research idea

    Kaplan's laws describe pretraining loss on a fixed web distribution. Propose a study of how retrieval quality of a dense retriever scales jointly with encoder size and the number of training query–passage pairs. State the functional form you would fit, the minimal experiment, and what result would falsify it.

    What a strong answer covers
    • Hypothesis: contrastive loss on held-out pairs follows L = E + A/N^α + B/D^β, with D the number of training pairs. nDCG@10 follows from the loss through a monotone link.
    • Minimal experiment: 4–5 encoder sizes × 4–5 data sizes on one corpus (for example MS MARCO), with schedules matched to each run. Evaluate in-domain and on BEIR.
    • Falsification: if the fitted exponents change a lot when the largest grid point is held out, or if out-of-domain nDCG stops improving while loss keeps falling, a single power law does not describe retrieval quality.
    • Extension: add corpus size at test time as a third variable, since retrieval difficulty grows with the number of distractors.

Done with this page?

Status