Scaling Laws and Compute Allocation
Training a base model requires several choices that become expensive to revise once the run begins: the architecture, parameter count, data mixture, number of training tokens, optimizer, and schedule. Scaling laws address one part of that planning problem. For a fixed model family and training setup, they estimate how held-out loss changes with model size, data, and compute.
That is narrower than predicting whether a model will be useful. A scaling law can help choose the size of a training run and forecast its validation loss. It does not choose the data, guarantee a downstream capability, or account for serving cost unless those factors are added to the objective. Keeping those boundaries visible is the key to using the method well.
What the forecast measures
Language-model scaling studies usually measure next-token prediction on held-out text. Given a sequence , a model with parameters assigns a probability to each token after seeing the preceding tokens. Its average cross-entropy loss is
Here is the number of evaluated token positions, is the true token at position , is its preceding context, and is the probability assigned by the model. The value is the negative log-probability at position . This is next-token prediction. The average negative log-probability is cross-entropy: it measures the model's surprise on a fixed held-out distribution. With natural logarithms, the unit is nats per token and perplexity is ; with base-2 logarithms, the unit is bits per token and perplexity is .
Lower held-out loss means better probabilistic prediction on that evaluation distribution. Comparisons are meaningful only when the tokenizer, held-out data, and loss convention are held fixed. A small loss improvement may or may not produce a useful change on a particular task.
The word token is used in two different counts. A vocabulary contains token types, while a training run processes token instances. In particular, training tokens are not vocabulary entries, and repeated passes over the same text count again. If a corpus contains unique token instances and is read for full epochs, the run processes approximately training tokens.
From small runs to a loss surface
Across a matched family of models, held-out loss often decreases smoothly as the parameter count and training-token count increase. A commonly used fit is
is a fitted asymptote for the chosen tokenizer and data distribution. The terms and estimate the excess loss caused by limited model capacity and limited training data. The positive constants , , , and , together with , are estimated from smaller runs (Rosenfeld et al. 2020; Hoffmann et al. 2022). A larger exponent means that the corresponding excess-loss term falls faster as its input grows.
The power law applies to excess loss above the fitted floor, not to total loss. For example, holding large and fixed gives . That relationship is a straight line on log-log axes. The two-variable surface is not one universal straight line: model size, data size, and compute each produce a different one-dimensional slice or frontier.
Scaling studies fit this surface on a ladder of affordable runs and then test whether it predicts larger held-out runs. Figure 5.1 illustrates the basic extrapolation. The figure is schematic; a real study needs uncertainty estimates and held-out runs of its own.
The empirical pattern is well established within many model families, but its cause is not settled. Sharma and Kaplan derive a power law in a restricted manifold-regression setting, with exponent for intrinsic data dimension (Sharma and Kaplan 2022). Michaud et al. propose a different hypothesis: discrete skills learned in frequency order can aggregate into a smooth loss curve (Michaud et al. 2023). Brill explores how related regimes can arise in synthetic percolation-based data (Brill 2024). These are possible explanations under particular assumptions, not proof that architecture and optimization no longer matter.
Turning a compute budget into model and data sizes
For a dense decoder-only Transformer in a regime dominated by parameter-dependent matrix multiplications, training compute is often approximated by
is the number of training floating-point operations (FLOPs), is the number of parameters active for each token, and is the number of processed training tokens. The factor near six accounts roughly for a forward pass and its backward pass. It is a planning approximation, not a bill: attention, output layers, sparse routing, rematerialization, communication, and hardware utilization can all move actual time and cost away from it (Kaplan et al. 2020; Hoffmann et al. 2022).
At a fixed compute budget , choosing also fixes . Substituting that constraint into the loss fit gives
Increasing lowers the capacity term but leaves fewer tokens for training; decreasing does the reverse. This creates the U-shaped tradeoff in Figure 5.2. Under this particular loss and compute model, the minimum has a closed form:
Here the star marks the loss-minimizing allocation predicted by the fit. These are the compute-optimal and : the pair with the lowest predicted loss under the stated training-compute budget. The exponents determine how additional compute is divided. A constant token-to-parameter ratio emerges only when ; it is not a universal consequence of power-law scaling.
Kaplan and Chinchilla estimated different frontiers
Kaplan et al. found smooth language-model scaling and estimated that the compute-optimal parameter count should grow approximately as , leaving for data (Kaplan et al. 2020). Here denotes the training-compute budget. That estimate favored increasingly large models trained on comparatively few tokens.
Hoffmann et al. ran a broader set of iso-compute experiments and found exponents near one half for both model size and data (Hoffmann et al. 2022). Their 70B parameter Chinchilla model was trained on 1.4T tokens, about twenty tokens per parameter, and outperformed several larger models trained with similar compute. The useful conclusion is that the models of that period were undertrained on data. “Twenty tokens per parameter” is the configuration of that demonstration and a practical rule of thumb, not a physical constant.
Later analyses help explain the disagreement without making it disappear. Kaplan counted non-embedding parameters, whereas Chinchilla used total parameters. Pearce and Song show that this accounting choice, combined with the smaller scale of Kaplan's experiments, reproduces much of the difference in the reported exponents (Pearce and Song 2024). Other experimental and fitting choices still matter.
The Chinchilla paper also used three estimation methods. Besiroglu et al. found that the published coefficients for its parametric third method fit reconstructed data poorly and conflict with the other two methods; the reported confidence intervals would require more than 600,000 runs, rather than the likely fewer than 500 (Besiroglu et al. 2024). Their refit again gives a near-even allocation, but with meaningful uncertainty. A scaling prescription should therefore name the fit, its experimental range, and its uncertainty instead of presenting one ratio as settled.
The broad result, that loss often scales predictably within a controlled model family, is much stronger than any single estimate of the optimal token-to-parameter ratio. The fitted coefficients depend on the tokenizer, data distribution, architecture, optimizer, parameter accounting, and range of experimental runs. Far outside that range, a narrow confidence interval from the fit can understate the uncertainty of the extrapolation.
Deployment changes the objective
Chinchilla minimizes training loss for a fixed training-compute budget. A model that will serve many requests faces a different optimization problem because training is paid once while inference is paid repeatedly. A simplified lifetime cost is
Here is the expected lifetime volume of served tokens, or another consistently defined request unit, and is the average compute or monetary cost per unit for a model of size . For dense models, that cost generally grows with the active parameter count, although batching, sequence length, and hardware also matter.
Under a target-quality constraint and large expected demand, it can be cheaper overall to train a smaller model for longer than the training-compute optimum. Sardana et al. tested this reasoning across 47 models and found such allocations for scenarios with roughly a billion expected requests (Sardana et al. 2024). This is not a third way to divide the same fixed training budget. It changes the objective from lowest loss for fixed training FLOPs to lowest lifetime cost for fixed quality and demand.
Serving demand reaches backward into pre-training. If a model will generate a large volume of tokens, spending more once on training can reduce every later inference bill. The relevant quantities are target quality, expected demand, latency, and hardware, not a token-to-parameter ratio by itself. Serving economics are developed in Chapter 31.
Finite data changes the choice again
Inference-aware training assumes that more useful training tokens are available. Sometimes the binding constraint is the supply of unique high-quality text. In that case, a run must decide how often to repeat the corpus as well as how large to make the model.
Muennighoff et al. found little loss penalty from repeating constrained data for up to roughly four epochs at fixed compute in their experiments. Beyond that range, repeated tokens had diminishing value. Their fitted allocation still favored smaller models trained for more epochs than a naive application of the single-pass Chinchilla law would suggest (Muennighoff et al. 2023). The result is not that every fourth pass is free; it is evidence from a particular range of models, corpora, and compute budgets.
A 2026 preprint studies heavier repetition and adds an explicit overfitting penalty to the loss law (Lovelace et al. 2026). In experiments up to 1B parameters and 16 epochs, Lovelace et al. found regimes where further repetition became counterproductive and additional compute was better spent on capacity. Strong weight decay reduced their fitted repetition penalty by about 70%, but it worsened the single-epoch frontier and helped only after a data- and compute-dependent crossover. This is promising recent evidence, not yet a universal recipe.
The three planning questions are therefore distinct:
- With fixed training FLOPs and enough fresh data, choose and to minimize held-out loss.
- With a lifetime deployment objective, include expected serving demand and cost.
- With fixed unique data, model the declining value and overfitting risk of repeated epochs.
How to run a scaling study
A useful fit starts with controlled experiments, not a formula copied from a different model family.
- Fix the comparison. Keep the tokenizer, held-out distribution, data mixture, architecture family, optimizer, and loss definition consistent.
- Build a scale ladder. Train several model sizes at several compute budgets, including multiple parameter-token allocations at each budget.
- Use completed, comparable runs. A short run with the wrong learning-rate schedule can make a model look capacity-limited when it is merely under-optimized.
- Hold runs out from fitting. A curve that explains its own input points but misses larger held-out runs is not a reliable extrapolator.
- Fit more than one plausible form. Report sensitivity to exclusions, rounding, parameter definitions, and the assumed compute model.
- Carry uncertainty into the allocation. Give a range of plausible and , then test nearby choices instead of treating the numerical minimum as exact.
Maximal-update parametrization (muP) can reduce one part of the experimental cost. Under its width-dependent parameterization, many hyperparameter optima can transfer between different widths in a matched model family (Yang et al. 2021). It does not guarantee transfer across depth, architecture, data, optimizer, or batch changes; the target configuration still needs a validation run.
Test the allocation
The cell below evaluates the fixed-compute tradeoff with the rounded coefficients from the Besiroglu et al. refit. They are useful for reproducing this example, not as defaults for another training program. Change the exponents or compute budget and rerun the cell to see how the optimum moves.
import numpy as np
import matplotlib.pyplot as plt
# Rounded coefficients from Besiroglu et al. (2024).
E, A, B = 1.8172, 482.01, 2085.43
alpha, beta = 0.3478, 0.3658
C = 1e19
kappa = 6.0
def predicted_loss(N, D):
return E + A / N**alpha + B / D**beta
N = np.logspace(7.5, 11, 400)
D = C / (kappa * N)
L = predicted_loss(N, D)
best_index = np.argmin(L)
best_N = N[best_index]
best_D = D[best_index]
plt.figure(figsize=(5, 3))
plt.plot(N, L, label="predicted held-out loss")
plt.axvline(best_N, color="tab:orange", linestyle="--", label="predicted optimum")
plt.xscale("log")
plt.xlabel("parameters N")
plt.ylabel("loss")
plt.legend()
plt.tight_layout()
plt.show()
print(f"N* = {best_N:.2e} parameters")
print(f"D* = {best_D:.2e} training tokens")
print(f"D*/N* = {best_D / best_N:.1f} tokens per parameter")
What the scaling fit does not tune
The loss surface chooses a model-data allocation only after the training recipe has been fixed. The optimizer, learning-rate schedule, and batch size need their own experiments.
Optimizer. AdamW decouples weight decay from Adam's gradient update and remains a common baseline (Loshchilov and Hutter 2019). It stores first- and second-moment estimates for each optimized parameter, so optimizer state is a major memory cost in large runs. Muon instead orthogonalizes momentum updates for matrix-shaped hidden-layer weights; it is not a curvature or second-order method. Its authors report about twice the compute efficiency of AdamW in their scaling experiments and use AdamW for embeddings, normalization parameters, and the output head (Liu et al. 2025). Kimi K2 later used a Muon variant in a model with roughly one trillion total parameters (Kimi Team 2025). These are strong demonstrations, not proof that one optimizer wins for every architecture or data mixture.
Learning-rate schedule. A cosine schedule assumes a planned end point and decays toward it. warmup-stable-decay (WSD) uses a warmup, a long stable plateau, and a decay that begins when training is about to stop. MiniCPM used this design to continue training from the plateau and compare several token budgets without restarting every run (Hu et al. 2024). The choice affects the validity of the scaling comparison: runs at different budgets must be evaluated at comparable points in their schedules.
Batch size. A batch is the set of token examples used for one optimizer update. Larger batches expose more data parallelism and can reduce the number of updates needed to reach a target loss. The benefit is not proportional forever. The gradient noise scale predicts a critical batch size near the knee where larger batches begin trading compute efficiency for fewer sequential steps (McCandlish et al. 2018). The noise scale often grows as loss falls, so a useful batch size may change during the run. Figure 5.3 shows the shape; it is not a hard failure threshold.
Keeping a long run stable
A predicted final loss is worthless if the run diverges before reaching it. Stability controls address different signals rather than forming one universal recovery recipe.
- z-loss penalizes the squared log of the softmax normalizer, discouraging all output logits from drifting together to large absolute values. PaLM used it as a stability control (Chowdhery et al. 2023).
- query-key normalization (QK-norm) normalizes query and key vectors before their dot product, limiting attention-logit growth. Small-scale proxy experiments reproduce this large-run instability and show that the mitigation can be tested cheaply (Wortsman et al. 2023).
- Global-norm gradient clipping rescales an unusually large gradient before it reaches the optimizer. Gradient norms, activation norms, and held-out loss still need to be monitored because clipping can hide a deteriorating run rather than repair its cause.
- Frequent checkpoints make hardware failures and diagnosed optimization failures recoverable. A restart policy must record the optimizer state, data position, and schedule position, not only the model weights.
Published reports illustrate why claims should be precise. DeepSeek-V3 reported no irrecoverable loss spikes and no rollbacks over its 14.8T-token run (DeepSeek-AI 2024). Kimi K2 reported zero loss spikes after adding QK-clip to Muon (Kimi Team 2025). Those are results from two training systems, not a guarantee that the same controls will transfer unchanged.
Distributed execution, checkpoint storage, numerical precision, and failure recovery are developed in Chapter 10. This chapter's boundary is the training recipe: the scaling fit proposes a destination, while optimization and systems engineering determine whether the run reaches it.
Before committing the run
The decision record for a large training run should state:
- the held-out distribution, tokenizer, and exact loss definition;
- the model family, parameter count convention, and training-token count;
- the measured scale ladder and which runs were held out from fitting;
- the fitted form, coefficient uncertainty, and extrapolation distance;
- whether the objective covers training FLOPs, wall-clock time, monetary cost, lifetime serving, or some combination;
- the unique-data budget and expected number of repeated epochs;
- the optimizer, schedule, batch policy, and stability gates.
That record turns a scaling law from an impressive curve into an auditable allocation decision. It also makes the forecast falsifiable: after the run, the observed held-out loss can be compared with the interval that justified the investment.
Further reading
- Kaplan et al., “Scaling Laws for Neural Language Models,” 2020. arXiv:2001.08361Establishes that language-model loss falls as a power law in model size, dataset size, and compute, and that compute-optimal training favors very large models trained on relatively little data, stopped before convergence.
- Hoffmann et al., “An Empirical Analysis of Compute-Optimal Large Language Model Training” (Chinchilla), 2022. arXiv:2203.15556Finds near-equal compute-optimal scaling of model size and training tokens in its experiments; the compute-matched 70B Chinchilla model, trained on 1.4T tokens, outperforms several larger models.
- Yang et al., “Tensor Programs V: Tuning Large Neural Networks via Zero-Shot Hyperparameter Transfer” (muP), 2021. arXiv:2203.03466Introduces muP, under which many hyperparameter optima can transfer across width in a matched model family, greatly reducing full-scale tuning cost.
- Loshchilov & Hutter, “Decoupled Weight Decay Regularization” (AdamW), 2019. arXiv:1711.05101Shows L2 regularization and weight decay are not equivalent for Adam, and that decoupling weight decay from the gradient update (AdamW) improves generalization.
- McCandlish et al., “An Empirical Model of Large-Batch Training” (critical batch size), 2018. arXiv:1812.06162Introduces the gradient noise scale to predict the critical batch size, beyond which larger batches stop reducing the number of training steps and waste compute.
- Muennighoff et al., “Scaling Data-Constrained Language Models,” 2023. arXiv:2305.16264Finds little loss penalty from up to roughly four repeated epochs at fixed compute in its experiments, then models the diminishing value of further repetition and excess parameters.
- Hu et al., “MiniCPM: Unveiling the Potential of Small Language Models with Scalable Training Strategies” (warmup-stable-decay schedule), 2024. arXiv:2404.06395Presents small (1.2B/2.4B) models that rival 7B-13B LLMs, using model wind-tunnel scaling experiments and a Warmup-Stable-Decay learning-rate schedule that enables continuous training.
- Chowdhery et al., “PaLM: Scaling Language Modeling with Pathways” (z-loss, stability at scale), 2023. arXiv:2204.02311Reports the 540B-parameter PaLM model, defines model FLOPs utilization for large-scale training, and documents its distributed training system and stability measures.
- Jordan et al., “Muon: An Optimizer for Hidden Layers in Neural Networks,” 2024. kellerjordan.github.ioIntroduces Muon, an optimizer for hidden layers that orthogonalizes momentum-based updates, setting training-speed records on NanoGPT and CIFAR-10.
- Liu et al., “Muon is Scalable for LLM Training,” 2025. arXiv:2502.16982Shows the Muon optimizer scales to large LLMs by adding weight decay and tuning the per-parameter update scale, reaching about 2x the compute efficiency of AdamW; trains Moonlight, a 16B MoE model, on 5.7T tokens.
- Kimi Team, “Kimi K2: Open Agentic Intelligence” (Muon (as MuonClip) at trillion-parameter scale), 2025. arXiv:2507.20534Kimi K2 is a 1T-total, 32B-active MoE model pre-trained on 15.5T tokens with MuonClip, a Muon variant whose QK-clip removes attention-logit blowups, with zero loss spikes over the run.
- DeepSeek-AI, “DeepSeek-V3 Technical Report” (14.8T-token training stability; no irrecoverable spike or rollback reported), 2024. arXiv:2412.19437Reports DeepSeek-V3, a 671B-parameter Mixture-of-Experts model with 37B active per token, trained on 14.8T tokens with fp8 matmuls and auxiliary-loss-free load balancing, rivaling closed models at low cost.
- Rosenfeld et al., “A Constructive Prediction of the Generalization Error Across Scales,” 2020. arXiv:1909.12673Proposes the parametric envelope form of the generalization error as a power law in model size and data size plus an irreducible floor, fit across vision and language, predating its language-model specialization.
- Besiroglu et al., “Chinchilla Scaling: A Replication Attempt,” 2024. arXiv:2404.10102Replicates the Chinchilla parametric fit and finds its third estimate inconsistent with the paper's own first two, with confidence intervals so narrow they would require hundreds of thousands of runs rather than the few hundred actually performed.
- Pearce & Song, “Reconciling Kaplan and Chinchilla Scaling Laws,” 2024. arXiv:2406.12907Attributes the Kaplan-Chinchilla disagreement largely to Kaplan counting non-embedding rather than total parameters at small scale; once embeddings are included and scale grows, the optimal exponent converges to the Chinchilla estimate.
- Lovelace et al., “Prescriptive Scaling Laws for Data Constrained Training,” 2026. arXiv:2605.01640In experiments up to 1B parameters and 16 epochs, adds an explicit repetition penalty and finds regimes where more capacity beats further repetition; stronger weight decay reduces the penalty but pays a single-epoch cost.
- Sharma & Kaplan, “Scaling Laws from the Data Manifold Dimension,” 2022. arXiv:2004.10802Derives the scaling exponent from the intrinsic dimension of the data manifold, predicting that loss falls as a power law whose rate is set by how many dimensions the data effectively occupies.
- Michaud et al., “The Quantization Model of Neural Scaling,” 2023. arXiv:2303.13506Proposes a discrete-skill hypothesis for neural scaling, validates it on synthetic tasks, and presents tentative evidence that language-model scaling may show related behavior.
- Brill, “Neural Scaling Laws Rooted in the Data Distribution,” 2024. arXiv:2412.07942Uses synthetic percolation-based regression data to explore how discrete-skill and data-manifold scaling regimes can arise on opposite sides of a threshold.
Comments
Log in to comment