8.1 Neural Scaling Laws and Loss Forecasts
A team expects a 3.4% drop in validation loss if it doubles its training budget. What exactly falls by 3.4%? On a curve with a positive floor, the loss above the floor and the total loss have different percentage changes. You can work through the difference with two budgets before using a fitted curve to price a larger run.
What the experiments measured
Hestness et al. found ranges where test error followed a power law as training data grew across several domains [1]. Kaplan et al. measured language-model cross-entropy under three different constraints. They reported exponents around 0.076 for non-embedding parameter count with ample data, 0.095 for dataset size with large models and early stopping, and 0.050 for optimally allocated training compute with ample data. Their equations (1.1–1.3) fitted power laws directly to total test loss over the measured range [2].
An exponent alone cannot tell a team how to spend a new compute budget. Kaplan et al. favored increasing model size faster than dataset size. Hoffmann et al. later varied both parameter count and training tokens and found that the two should increase by roughly the same factor along their compute-optimal frontier. Doubling both uses about four times the training compute under the dense-model approximation . The relationship is conditional on the training setup and objective [2] [4].
What a fitted floor can tell you
One possible forecast for total held-out cross-entropy, in nats per token, is
is a positive compute budget in fixed units, is a positive amplitude, is a positive exponent, and is the asymptote assumed by this model. Hoffmann et al. included an additive term in their joint fit over parameters and training tokens. Their idealized interpretation relates it to the expected uncertainty of the next token given its context [4]. With only a few measured budgets, several combinations of floor and exponent can explain almost the same losses. A fitted therefore carries estimation uncertainty. Changing the tokenizer, available context or evaluation distribution can also change what a loss per token measures.
Compare total loss with excess loss
Take the illustrative curve with a dimensionless compute budget. Moving from to takes total loss from 9.443 to 9.173 nats per token. Subtract the assumed floor of 1.5 at both budgets and excess loss moves from 7.943 to 7.673. Both fall by about 0.271 nats per token using unrounded values. The same decrease amounts to 2.87% of total loss and 3.41% of excess loss because the starting values differ.
The excess loss traces a straight line on logarithmic axes: . The total includes the additive floor, so its slope changes. In the calculator below, increase the starting budget by a factor of ten. Which percentage drop stays the same when you double that new budget?
What changes when compute doubles?
Compare two budgets on the example curve. The dashed line shows excess loss above the assumed floor of 1.5 nats per token.
| Loss | C | 2C | Decrease |
|---|---|---|---|
| Total loss | 9.443 | 9.173 | 2.87% |
| Excess loss | 7.943 | 7.673 | 3.41% |
Extrapolating with Constraints and Uncertainty
Keep the tokenizer, data snapshot, architecture family and evaluation procedure fixed across pilots. Vary model size and token budget and replicate runs with different seeds. Tune the learning rate and warmup at each scale so a poorly optimized pilot does not masquerade as a scaling effect.
This PyTorch fit uses five illustrative validation losses. It fits the four smaller runs, constrains the amplitude and exponent to be positive, and keeps the floor between zero and the smallest training-point loss. It predicts the held-out fifth point before looking at its loss. Budgets count operations: 1 ExaFLOP = 1,000 PetaFLOPs.
import torch
import torch.nn as nn
import torch.nn.functional as F
compute_pf = torch.tensor([10., 30., 100., 300., 1_000.])
validation_loss = torch.tensor([4.65, 4.02, 3.52, 3.18, 2.91])
class ConstrainedPowerLaw(nn.Module):
def __init__(self, min_observed_loss):
super().__init__()
self.raw_amplitude = nn.Parameter(torch.tensor(1.0))
self.raw_exponent = nn.Parameter(torch.tensor(-2.0))
self.raw_floor_fraction = nn.Parameter(torch.tensor(0.0))
self.register_buffer("min_loss", min_observed_loss)
def forward(self, compute):
amplitude = F.softplus(self.raw_amplitude)
exponent = F.softplus(self.raw_exponent)
floor = self.min_loss * torch.sigmoid(self.raw_floor_fraction)
return amplitude * compute.pow(-exponent) + floor
training_compute = compute_pf[:-1]
training_loss = validation_loss[:-1]
model = ConstrainedPowerLaw(training_loss.min())
optimizer = torch.optim.Adam(model.parameters(), lr=1e-2)
for _ in range(5_000):
prediction = model(training_compute)
loss = F.mse_loss(torch.log(prediction), torch.log(training_loss))
optimizer.zero_grad()
loss.backward()
optimizer.step()
with torch.no_grad():
forecast = model(compute_pf[-1]).item()
actual = validation_loss[-1].item()
print(f"forecast={forecast:.3f}, actual={actual:.3f}, error={forecast - actual:+.3f}")
The code gives a forecast of 2.921 against an illustrative held-out loss of 2.910, an overestimate of 0.011 nats per token. The held-out error tests whether four smaller points forecast a run about 3.3 times larger than the largest training point. To estimate uncertainty with replicated pilots, bootstrap whole runs within each scale and refit. Report the spread of forecast losses, the leave-largest-out error, and the largest compute ratio you have checked. For a budget decision also compare downstream evaluations and GPU-hours based on achieved FLOP/s, including evaluation, checkpointing and restarts.
Why a smooth loss curve can coexist with a jump in accuracy
Consider a two-option question. If the model raises the probability of the correct option from 0.49 to 0.51, its log loss on the answer falls from about 0.713 to 0.673 nats. Yet choosing the most probable option changes the score for this one question from zero to one. On a benchmark, the size of a jump also depends on how many items cross such a boundary. Schaeffer et al. showed how the scoring rule can produce apparent thresholds in the settings they studied [3]. Examine item-level probabilities and task scores together before interpreting a change in capability.
Quizzes
Quiz 1: A pilot reports parameters including embeddings. Can you insert that count into Kaplan’s parameter-limited fit?
First recover the non-embedding count used for that fit. The embedding share can differ across models, especially when the vocabulary size changes. Match the counting convention and evaluation data before comparing the loss.
Quiz 2: A fitted curve approaches 1.5 nats per token. What evidence would support using that value in a larger forecast?
Check a larger held-out run and see how much the estimated floor moves when you change the pilot subset or seed. Several floors can fit the same narrow range. Estimating the entropy of the token source would require separate evidence about its distribution.
Quiz 3: A team doubles both model size and token count. Under the dense training approximation, how much compute should it budget?
About four times the original compute because the two factors multiply. Hoffmann et al. reported similar growth factors along their empirical optimum. The absolute number of tokens per parameter depends on the recipe and objective.
Quiz 4: Why does doubling compute cut excess loss by the same percentage at every starting point in the example?
The ratio of excess losses is at every budget. Total loss includes the fixed 1.5 nats per token. As the excess shrinks, the floor makes up more of the total and the percentage reduction in total loss gets smaller.
References
- Hestness, J., et al. (2017). Deep Learning Scaling is Predictable, Empirically. arXiv:1712.00409.
- Kaplan, J., et al. (2020). Scaling Laws for Neural Language Models, §1.2. arXiv:2001.08361.
- Schaeffer, R., et al. (2023). Are Emergent Abilities of Large Language Models a Mirage?. arXiv:2304.15004.
- Hoffmann, J., et al. (2022). Training Compute-Optimal Large Language Models, §3. arXiv:2203.15556.