Scaling Laws & the Compute-Data-Parameters Tradeoff
Suppose you are given a fixed compute budget of floating-point operations. You are asked to train the best possible language model. Should you build a massive model and train it briefly? Or should you build a small model trained on a flood of text? This question, once answered by intuition and trial and error, is now answered differently. A remarkably clean empirical law provides the answer: test loss falls as a power law in model size, dataset size, and compute. The exponents of these power laws tell you exactly how to split a budget between parameters and data. Scaling laws matter because pretraining a large language model is expensive. It is also essentially non-refundable — a wasted run costs millions of dollars and weeks of cluster time. Before scaling laws were characterized, practitioners guessed at architecture and dataset sizes. They often trained models that were badly imbalanced: too large for the data they saw, or too small to exploit the compute available. The discovery that loss scales predictably changed this. Researchers could run small, cheap experiments, fit a curve, and extrapolate to the regime they actually care about. They could do this without ever training the expensive final model more than once. The big picture is that a pretrained autoregressive language model's test loss is not a mysterious function of architecture tweaks. It is, to a good approximation, governed by three numbers: parameter count , training tokens , and compute . Fixing any two and varying the third produces smooth, predictable curves. These curves hold across many orders of magnitude. This predictability let organizations plan multi-million-dollar training runs with confidence. It also reframed pretraining as an optimization problem over an explicit budget constraint, rather than a craft. This article develops the empirical power-law form of scaling. It derives the compute-optimal allocation between and under a fixed compute budget. It contrasts the original Kaplan-style scaling laws with the later Chinchilla revision. Finally, it works through the arithmetic that lets you actually plan a training run from a budget alone.
- Pretraining loss falls approximately as a power law in parameters , data , and compute , over many orders of magnitude.
- Compute is well approximated as for dense Transformer training with backpropagation.
- Under a fixed compute budget, there is a compute-optimal split between and — growing one without the other wastes compute.
- Early scaling laws (Kaplan et al.) favored large models on relatively little data; the Chinchilla study showed both should scale roughly equally with compute.
- Undertrained large models (like the original GPT-3) leave performance on the table that smaller, longer-trained models can capture more cheaply.
- Scaling laws let researchers extrapolate from small, cheap experiments to predict the loss of a model orders of magnitude larger, before ever training it.
Pretraining loss is a predictable power law in compute, and for any fixed compute budget there is a specific, computable split between model size and training tokens that minimizes loss.
The idea
A scaling law in this context is an empirical relationship of the form
where is the cross-entropy test loss (in nats or bits per token) of a Transformer language model, is a resource — parameter count , dataset size in tokens , or training compute — and and are constants fit from data. Plotted on log-log axes, this relationship is a straight line: decreases linearly in . The exponent is the scaling exponent; larger means faster returns to additional resource. The crucial move is to hold two of effectively unconstrained and vary the third, then fit separate power laws , , and . Because these laws hold over several orders of magnitude — often four to five decades of or — a curve fit on models with to parameters reliably extrapolates to models with parameters, well outside the fitted range. This is what makes scaling laws practically powerful: they convert an expensive extrapolation question ("how good will a 500B-parameter model be?") into a cheap curve-fitting exercise using dozens of small, fast training runs. The second half of the idea is compute-optimal allocation. Since is (approximately) a fixed product of and , and both and independently push loss down, a fixed compute budget can be spent many ways: a huge model on little data, a tiny model on huge data, or something balanced in between. The scaling laws for and jointly determine an optimal point , that minimizes loss for that budget — and this optimal split itself follows a power law in . Two major empirical studies of this optimum — Kaplan et al. (2020) and Hoffmann et al. (2022, the "Chinchilla" paper) — reached different conclusions about the exponents, with major practical consequences, discussed below.
How it works
Step 1: Fix the compute-loss relationship. For a dense Transformer trained with the standard forward-plus-backward pass, the compute cost per training token is approximately FLOPs: roughly for the forward pass (one multiply-add per parameter, per token, dominated by matrix multiplications) and roughly for the backward pass (twice the forward cost, since gradients must be computed with respect to both activations and weights). Training on tokens for one epoch (or total token-steps, possibly with repetition) therefore costs
This holds independent of the exact split between and — it only assumes a dense architecture where the forward pass cost per token scales linearly in (true for standard Transformers when the token count is large relative to attention's quadratic term, which is usually small next to the linear feed-forward and projection costs).
Step 2: Fit the marginal power laws. Train a family of models varying (holding effectively unlimited, i.e., large enough not to bottleneck), and separately vary (holding large enough not to bottleneck). Fit
using least squares on the log-log data. Empirically (Kaplan et al.), and for GPT-2/GPT-3-style Transformers, meaning loss decreases slowly but steadily and predictably as either resource grows — a factor of 10 in buys roughly a reduction in loss's excess over its floor, all else fixed.
Step 3: Combine into a joint law. A common joint form (Kaplan et al.) is
which reduces to the marginal laws in the appropriate limits and captures the fact that once one resource is abundant, the other becomes the bottleneck (diminishing returns saturate against whichever resource is scarcer).
Step 4: Solve the compute-optimal allocation problem. Given a compute budget , minimize subject to . This is a constrained optimization: substitute into and minimize over alone (a one-dimensional calculus problem, solvable by setting ). The solution takes the power-law form
(the exponents must sum to one because and both and are themselves power laws in ). The value of (equivalently ) is the crux of the entire debate: Kaplan et al. found (model size should absorb most of a compute increase, data barely grows), while Hoffmann et al.'s Chinchilla analysis found (parameters and data should scale in equal proportion).
Step 5: Use the law to plan a real run. Given a compute budget (often fixed by hardware-hours available), compute and from the fitted exponents, then choose an architecture (depth, width, number of heads) that hits the target and a training corpus of size tokens. This turns the “what should we train?” design question into arithmetic. ```
# Fitting and using a compute-optimal scaling law function FIT_SCALING_LAW(models):
# models: list of (N_i, D_i, C_i, loss_i) from completed small-scale training runs
# Step 1: fit marginal laws holding one resource near-unconstrained (alpha_N, N_c) <- LEAST_SQUARES_LOGLOG( x = [m.N for m in models if m.data_unconstrained], y = [m.loss for m in models if m.data_unconstrained]) (alpha_D, D_c) <- LEAST_SQUARES_LOGLOG( x = [m.D for m in models if m.model_unconstrained], y = [m.loss for m in models if m.model_unconstrained])
# Step 2: fit joint law L(N, D) on the full grid of runs (alpha_N, alpha_D, N_c, D_c) <- FIT_JOINT_LOSS(models, init=(alpha_N, alpha_D, N_c, D_c)) return (alpha_N, alpha_D, N_c, D_c) function COMPUTE_OPTIMAL_SPLIT(C, alpha_N, alpha_D, N_c, D_c):
# Minimize L(N, C/(6N)) over N == solve dL/dN = 0 analytically or numerically best_loss <- INFINITY best_N <- NONE for N in LOG_SPACE(low=1e6, high=1e13, num_points=10000): D <- C / (6 N) loss <- JOINT_LOSS(N, D, alpha_N, alpha_D, N_c, D_c) if loss < best_loss: best_loss <- loss best_N <- N N_star <- best_N D_star <- C / (6 N_star) return (N_star, D_star, best_loss) function PLAN_TRAINING_RUN(compute_budget_flops, alpha_N, alpha_D, N_c, D_c): (N_star, D_star, predicted_loss) <- COMPUTE_OPTIMAL_SPLIT( compute_budget_flops, alpha_N, alpha_D, N_c, D_c) architecture <- CHOOSE_ARCHITECTURE(target_params = N_star) corpus <- SELECT_CORPUS(target_tokens = D_star) return (architecture, corpus, predicted_loss) ``` The pseudocode has two honest edge cases worth flagging. `LEAST_SQUARES_LOGLOG` requires strictly positive losses above an irreducible floor (an "entropy floor" representing the true entropy of natural language); fits are usually done on , and if is misestimated the whole exponent shifts. `COMPUTE_OPTIMAL_SPLIT`'s grid search is a stand-in for the closed-form solution obtainable by calculus — real implementations solve analytically for whichever joint-loss functional form they've chosen, since a grid search over 10,000 points is not exact and can miss the true minimum between points.
Complexity & correctness
Fitting cost. Fitting a single marginal power law is ordinary least squares in log-log space after the substitution : this is a linear regression with two parameters, solvable exactly in time for data points via the normal equations, or per gradient step for iterative fitting. The joint law over has more parameters (, sometimes an irreducible floor ) and is fit by nonlinear least squares (e.g., L-BFGS), typically converging in tens of iterations over a grid of a few hundred training runs — negligible compute compared to the runs themselves. The dominant cost of the whole scaling-law methodology is running the family of small models used to generate the fitting data, but these are chosen to be orders of magnitude cheaper than the target run, which is the entire point.
Why the exponent-sum identity holds. Given and the two candidate solutions , , correctness of follows directly from substitution:
For this to hold as an identity in (not just at one point), the exponents on both sides must match, forcing . This is not an empirical finding but an algebraic constraint — any correctly fit compute-optimal frontier must satisfy it, and it serves as a sanity check on fitted exponents (Chinchilla's and Kaplan's both satisfy it).
Deriving the optimal split via Lagrange multipliers. To see why an interior optimum exists (rather than "always spend everything on " or vice versa), consider the joint loss in the simplified additive-in-logs form
as a local approximation when neither resource dominates. Minimizing subject to via a Lagrange multiplier :
This naive additive approximation actually predicts at the optimum, which is not quite the empirical picture — the real joint loss function is not additive but has the "harmonic-sum" saturating shape from Step 3, where increasing alone with fixed eventually saturates (loss bottoms out at the -dependent floor). Solving the true constrained optimization on the saturating form yields
which is why the ratio of the fitted marginal exponents , not their absolute values, determines the compute-optimal split — a small change in how and are estimated (e.g., using a bigger, more diverse validation set, or correcting for learning-rate schedule artifacts) can swing substantially, which is exactly what happened between the Kaplan and Chinchilla studies.
Why Chinchilla revised Kaplan's exponent. The Chinchilla paper (Hoffmann et al., 2022) identified two methodological issues in the earlier fit: Kaplan et al. fit using models trained with a learning-rate schedule tuned for a fixed, large number of steps regardless of , which understates the achievable loss of smaller models (they were effectively undertrained relative to their optimal schedule), and it fit over a narrower range of at each . Correcting the learning-rate schedule per model size and training over three independent methodologies (fixing and varying ; fixing training FLOPs and varying ; and fitting a parametric joint loss surface directly) all converged on , i.e., parameters and data should scale at the same rate as compute grows — a substantially more data-hungry prescription than Kaplan's.
Honest tradeoffs. Scaling laws are extrapolations, not proofs; they assume the power-law form continues to hold far outside the fitted range, an assumption that can break down (e.g., data quality bottlenecks, or the eventual exhaustion of high-quality text corpora, mean cannot grow indefinitely in practice regardless of what the law prescribes). They also describe training loss/perplexity, not downstream task accuracy directly — a compute-optimal model by the scaling-law criterion is not automatically the best model for every deployment (inference cost, latency, and fine-tuning behavior are separate constraints the law does not model, since a smaller model trained longer is often cheaper to serve even at equal training loss).
Worked example
Suppose a lab has a fixed budget of FLOPs and wants to compare what the Kaplan-style law and the Chinchilla-style law each prescribe.
Step 1 — Kaplan-style split (, ). Using the fitted proportionality constants from Kaplan et al. (approximately, reading off their published fits):
Plugging in gives a ratio , and , so parameters — roughly a 4-trillion-parameter model. This is (deliberately, to illustrate the point) an extreme figure, larger than any model actually deployed, because Kaplan's fit was later shown to overweight parameter growth; real GPT-3-scale planning under this law targeted the hundreds-of-billions range with correspondingly modest data.
Step 2 — corresponding data budget under Kaplan. tokens — about 13 billion tokens, strikingly small for a multi-trillion-parameter model (for comparison, GPT-3, at 175B parameters, was trained on roughly 300B tokens, already showing the tension: Kaplan's own prescription, taken to its logical extreme, implies models even more undertrained-relative-to-size than GPT-3 actually was).
Step 3 — Chinchilla-style split (). Hoffmann et al.'s fitted law gives approximately
(constants fit in Hoffmann et al.'s Table 3; units chosen so is in FLOPs). Plugging in : , giving billion parameters and billion tokens.
Step 4 — sanity check via the constraint. Verify for the Chinchilla answer: , matching the budget to within rounding — the constraint holds, confirming the split is a valid point on the compute frontier (not merely a plausible-looking pair of numbers).
Step 5 — compare implied predictions. The actual Chinchilla model, trained by Hoffmann et al. at a smaller compute budget than GPT-3's successor Gopher, used 70 billion parameters and 1.4 trillion tokens (a compute-matched comparison to Gopher's 280 billion parameters trained on only 300 billion tokens) and outperformed the much larger, more compute-equal Gopher on nearly every downstream benchmark — the empirical confirmation that at fixed compute, Gopher-style large-and-undertrained was suboptimal relative to smaller-and-longer-trained.
| Quantity | Kaplan-style prescription | Chinchilla-style prescription |
|---|---|---|
| at | ||
| at | ||
| Tokens per parameter | ||
| Practical verdict | Severely undertrained models | Balanced, matches observed optimum |
The "tokens per parameter" row is the number practitioners actually remember: the Chinchilla result is often summarized as "train on roughly 20 tokens per parameter" (165B/330B in this toy example's units works out closer to 20 with the paper's exact fitted constants) — a rule of thumb directly derived from setting in the frontier equations.
Common pitfalls & traps
| Pitfall | Why it happens | Consequence |
|---|---|---|
| Confusing with an exact hardware FLOP count | The formula ignores attention's quadratic cost, embedding lookups, and hardware utilization (MFU) | Underestimates true compute for long-context models; real MFU is often 30-50%, not 100% |
| Extrapolating a fitted power law far beyond the fitted range without re-checking assumptions | Power laws are empirical fits, not physical laws; they can bend at extreme scale ("emergent" breaks) | Silent mispredictions for frontier-scale runs unless periodically re-validated with new data points |
| Ignoring the learning-rate-schedule confound (the original Kaplan bug) | Small models trained with a schedule tuned for large models look artificially undertrained | Skews vs ratio, biasing the compute-optimal split |
| Treating "compute-optimal" as "best for deployment" | The law optimizes training loss only, not inference cost or latency | A compute-optimal model per Chinchilla may still be worse to serve than a smaller, longer-trained, slightly higher-loss model |
| Assuming infinite high-quality data is available to hit | Chinchilla-optimal grows with ; text corpora are finite | Forces either data repetition (with diminishing or even harmful returns past a few epochs) or accepting a data-constrained, suboptimal |
Pioneers & history
Origins · 1 minJared Kaplan and how this was discovered
Trained as a theoretical physicist, Kaplan brought power-law thinking from statistical physics and quantum field theory to neural-network training curves, co-authoring "Scaling Laws for Neural Language Models" (2020) at OpenAI, which established that Transformer loss follows smooth power laws in parameters, data, and compute across seven orders of magnitude — reframing model design as a fitting problem rather than pure architecture search.
Where this matters
Scaling laws are now a standard planning tool at every organization training frontier language models. Compute budgets for models like GPT-4-class systems, PaLM, LLaMA, and their successors are allocated using compute-optimal (or deliberately inference-optimal, over-trained-beyond-Chinchilla) heuristics derived directly from this line of research; LLaMA's authors, for instance, explicitly chose to train smaller models on far more tokens than Chinchilla-optimal would suggest, because a slightly higher training loss was an acceptable price for a model cheap enough to serve at scale — a direct, documented application of the tradeoff analyzed here. Cloud providers and AI labs use scaling-law extrapolation to decide, months in advance, how many GPU-hours to reserve and how large a training corpus to curate, since the fitted curves let them predict the final loss (and, empirically, downstream benchmark performance) of a run before it starts. The same methodology — small, cheap proxy experiments extrapolated via power-law fits — has since been extended to vision Transformers, multimodal models, reinforcement-learning-from-human-feedback pipelines, and even to predicting the compute needed to reach a target level of "emergent" capability on reasoning benchmarks, making scaling-law analysis a load-bearing part of nearly every large-scale pretraining pipeline built on top of the autoregressive language modeling paradigm.
Ask the tutor: How would the compute-optimal split change if we account for the fixed extra cost of inference at deployment, not just training?
Are scaling laws a proof that bigger models are always better?
No. Scaling laws describe how pretraining loss changes as resources grow, holding the resource allocation optimal for the budget; they do not claim that an arbitrarily large model is better than a well-matched smaller one. In fact, the central lesson of the Chinchilla study is the opposite: an oversized model trained on too little data can be worse, at equal compute, than a smaller model trained longer. Scaling laws are best read as "if you're going to spend compute , here is the loss-minimizing way to spend it," not "more parameters is unconditionally good." Downstream task performance, inference cost, and deployment constraints are separate axes the basic scaling law does not directly optimize.
Why does the compute formula use 6N rather than something architecture-specific?
The factor of 6 comes from counting multiply-accumulate operations in the forward and backward passes of a dense Transformer, where nearly all compute is spent in matrix multiplications whose cost per token scales linearly with the parameter count . The forward pass costs about FLOPs per token (one multiply and one add per parameter), and backpropagation costs roughly twice that, about , because gradients must be computed with respect to both weights and activations. This total of per token is architecture-agnostic in the sense that it holds for any dense Transformer dominated by linear layers; it becomes a looser approximation for models with very long context, where the attention mechanism's quadratic cost in sequence length can become non-negligible.
What is an "irreducible loss" or entropy floor, and why does it matter for fitting?
Natural language has some intrinsic unpredictability — even a perfect model cannot achieve zero cross-entropy loss, because human language contains genuine ambiguity and randomness. This floor, often denoted , is the loss an ideal model would asymptotically approach as . Scaling-law fits typically model the excess loss as the power-law quantity, since fitting the raw loss directly would bias the exponent estimate — the power law describes how quickly you approach the floor, not the floor's value itself. Misestimating shifts the fitted exponents and can distort extrapolations, which is one reason scaling-law papers report careful ablations over how is estimated.
How does the compute-optimal frontier relate to the idea of "emergent abilities" in large language models?
Emergent abilities refer to capabilities (like multi-step arithmetic or certain reasoning benchmarks) that appear to activate suddenly past some model scale, rather than improving smoothly. Scaling laws describe smooth, continuous improvement in pretraining loss, and that smooth loss improvement is the mechanism underlying emergence — many "sudden" capability jumps are better explained as a continuous underlying loss improvement crossing a discrete evaluation threshold (e.g., getting an entire multi-step answer exactly right), rather than a true discontinuity in the model's internal competence. Scaling laws are silent on which specific capabilities will emerge at which scale; they only govern the aggregate loss, and predicting which downstream benchmarks track loss closely remains an active empirical question.
Do scaling laws apply the same way to fine-tuning as to pretraining?
Pretraining scaling laws describe loss on a broad, diverse corpus and generally require very large token counts to be informative; fine-tuning operates on much smaller, task-specific datasets and behaves differently, often saturating quickly or overfitting well before the pretraining-style power law would predict. Some scaling-law-style analyses exist for fine-tuning and transfer (relating pretraining loss to downstream fine-tuned performance), but the clean -- power law derived for pretraining does not transfer directly to the fine-tuning regime without separate calibration, since fine-tuning data is typically far more limited and far less diverse than pretraining corpora.
Why did GPT-3-era models train on relatively few tokens per parameter compared to later Chinchilla-informed models?
GPT-3 (175B parameters, roughly 300B training tokens, about 1.7 tokens per parameter) was trained before the Chinchilla study, guided partly by the earlier Kaplan-style scaling laws, which — due to the learning-rate schedule confound discussed above — implied that scaling parameters mattered more than scaling data. Under that earlier guidance, spending a fixed compute budget mostly on parameter count seemed compute-optimal. The Chinchilla correction showed this was a significant underinvestment in data; models trained after 2022 (LLaMA and its successors, for instance) systematically use far higher tokens-per-parameter ratios, often 20 or more, directly incorporating the revised exponent.
Can scaling laws predict loss for a completely new architecture before training it at scale?
Only partially, and with caution. Scaling laws are typically fit separately for each architecture family, since different architectures (dense Transformers, mixture-of-experts models, state-space models) can have different exponents and different effective compute-per-parameter relationships (e.g., a mixture-of-experts model activates only a subset of parameters per token, breaking the simple formula unless is reinterpreted as "active parameters"). Researchers routinely refit scaling laws for each new architecture family using small-scale proxy runs before trusting extrapolations, precisely because the exponents are empirical and architecture-dependent rather than universal constants.