Kaplan Scaling Laws › Loss vs. Compute

Michael BrenndoerferJanuary 13, 20255 min read
Language AI HandbookAll chapters
Part 23 of 67Scaling Laws
Chapter 163Kaplan Scaling Laws › Loss vs. Compute
Reading section 5 of 15 · Loss vs. Compute · 5 minSection 5 of 15 · 5 min

Book contents

Section 5 of 15 · 5 min read

Kaplan Scaling Laws › Loss vs. ComputeOne section · Sections in this chapter5 / 15 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

The third scaling law relates loss directly to the compute budget. This is perhaps the most practically important relationship because compute (measured in GPU-hours, dollars, or energy consumption) is the fundamental constraint that organizations face when training models. Unlike parameters, which can be chosen freely, or data, which can often be collected or synthesized, compute represents a hard resource limit.

Understanding how loss scales with compute means recognizing that compute is a derived resource, not a fundamental one. You don't directly spend compute; instead, you spend it indirectly by choosing a model size (which determines compute per forward-backward pass) and a number of training steps (which determines how many passes you perform). The compute budget constrains the product of these choices, creating a tradeoff. You can train a large model for few steps or a small model for many steps, but you cannot train a large model for many steps within a fixed compute budget.

When training is optimally allocated between model size and training steps, the loss follows:

L(C)=(CcC)αCL(C) = \left(\frac{C_c}{C}\right)^{\alpha_C}

where:

  • LL: the cross-entropy loss on held-out text
  • CC: the total compute budget measured in PetaFLOP-days (one PetaFLOP-day equals 101510^{15} floating-point operations performed continuously for one day)
  • CcC_c: a fitted constant representing the characteristic compute scale (approximately 3.1×1083.1 \times 10^8 PetaFLOP-days)
  • αC\alpha_C: the compute scaling exponent (approximately 0.050)

The characteristic compute scale Cc≈3.1×108C_c \approx 3.1 \times 10^8 PetaFLOP-days represents an enormous amount of computation, roughly 310 million PetaFLOP-days. To put this in perspective, training GPT-3 required approximately 3,640 PetaFLOP-days, which is about five orders of magnitude smaller than CcC_c. This large characteristic scale ensures that practical training runs operate in the regime where the ratio Cc/CC_c/C is much greater than 1, producing meaningful loss values that decrease predictably with more compute.

The compute exponent is smaller than both αN\alpha_N and αD\alpha_D because compute is a derived resource. It gets split between making the model larger (more parameters) and training longer (more data passes). The compound effect means each 10x increase in compute yields less loss reduction than a 10x increase in parameters or data alone.

The fitted parameters are:

  • αC≈0.050\alpha_C \approx 0.050
  • Cc≈3.1×108C_c \approx 3.1 \times 10^8

To understand why the compute scaling works, consider that total compute is approximately C≈6NDC \approx 6ND. The factor of 6 accounts for roughly two operations per parameter in the forward pass and four in the backward pass (computing gradients for both activations and weights). This relationship comes from the arithmetic of matrix multiplications: each parameter participates in operations during both forward and backward passes, with the backward pass requiring roughly twice the computation of the forward pass to compute gradients. The factor of 6 is an approximation that works reasonably well across typical transformer architectures and training configurations, though the exact multiplier can vary with specific implementation details. This means compute constrains the product of model size and data, forcing a tradeoff between the two.

The compute exponent αC=0.050\alpha_C = 0.050 is smaller than both αN\alpha_N and αD\alpha_D. This makes sense: compute is spent on both larger models and more training steps, so its effect is spread across multiple factors. When you increase compute, you gain both from having more parameters (benefiting from the αN\alpha_N exponent) and from seeing more data (benefiting from the αD\alpha_D exponent), but neither benefit is realized fully because the compute is divided between them. The key insight is that this relationship only holds when you allocate compute optimally, which brings us to Kaplan's most consequential finding.

In[7]:
Code
# Kaplan scaling law parameters for loss vs C
alpha_C = 0.050
C_c = 3.1e8

# Generate compute budgets from 10 to 10M PetaFLOP-days
C_values = np.logspace(1, 7, 100)  # 10^1 to 10^7 PF-days

# Calculate predicted loss
L_C = (C_c / C_values) ** alpha_C
Out[8]:
Visualization
Log-log plot showing test loss decreasing linearly with increasing compute budget.
Power-law relationship between test loss and training compute budget. This law assumes optimal allocation of compute between model size and training duration.