Scaling Laws

2 min read

Scaling laws describe how LLM performance (loss) improves predictably as you increase model size, data, and compute.

Kaplan et al. (2020) power laws:

L(N)NαN,L(D)DαD,L(C)CαCL(N) \propto N^{-\alpha_N}, \quad L(D) \propto D^{-\alpha_D}, \quad L(C) \propto C^{-\alpha_C}

where NN = parameters, DD = dataset size, CC = compute (FLOPs), and LL = cross-entropy loss.

Key finding: loss decreases as a smooth power law in each factor, spanning many orders of magnitude. No ceiling in sight (so far).

Chinchilla scaling (Hoffmann et al., 2022):

  • For a given compute budget, there is an optimal ratio of model size to data
  • Chinchilla law: tokens should scale linearly with parameters (~20 tokens per parameter)
  • Previous models (GPT-3) were undertrained — too large for the data they saw
  • Led to smaller, better-trained models (Chinchilla, LLaMA)

Fitting a scaling law: the loss-vs-compute curve needs an irreducible loss term L\mathcal{L}_\infty (the entropy of the data) — otherwise the fit implies L0\mathcal{L} \to 0 as CC \to \infty. Taking logs linearizes it:

L(C)=L+βCα    log(L(C)L)=logβαlogC\mathcal{L}(C) = \mathcal{L}_\infty + \beta C^{-\alpha} \implies \log(\mathcal{L}(C) - \mathcal{L}_\infty) = \log\beta - \alpha\log C

Optimal hyperparameters scale too, e.g. LR(C)=βCα\text{LR}(C) = \beta C^{-\alpha}. Fitting is done by least squares (minimizing squared residuals S=i(yif(xi))2S = \sum_i (y_i - f(x_i))^2): linear least squares has the closed form β=(XX)1Xy\beta = (X^\top X)^{-1}X^\top y; the power-law fit above, once linearized, is solved the same way (otherwise non-linear least squares via iterative refinement).

Maximal update parameterization (μP): hyperparameters tuned at small width don't transfer to large width because standard parameterization gives updates of inconsistent magnitude as width grows. μP adjusts per-layer initialization and learning rates so the magnitude of updates relative to weights stays constant across widths — letting you tune cheaply at small scale and transfer to large.

Practical implications:

  • Performance is predictable from small-scale experiments → can plan large training runs
  • More compute always helps (if allocated correctly between N and D)
  • Emergent abilities may appear at scale (e.g., in-context learning, chain-of-thought reasoning)

Open questions: do scaling laws hold for reasoning? For alignment? For specialized domains?

See also: Pretraining, Supervised Fine-Tuning

Linked from