Scaling Laws & Compute-Optimal Training
The science of scaling: Kaplan scaling laws, Chinchilla optimal ratios, compute-performance prediction, over-training for inference efficiency, and planning large-scale training runs.
Prerequisites
Table of Contents
- Learning Objectives
- Notation
- Core Intuition
- Kaplan Scaling Laws (OpenAI)
- Chinchilla Optimal Training
- The Compute-Optimal Frontier
- Over-Training for Inference
- Predicting Performance
- Emergent Abilities & Phase Transitions
- Planning a Training Run
- Common Pitfalls
- Summary
- Exercises
Learning Objectives
- State the power-law scaling relationships for loss vs compute, data, and parameters.
- Derive Chinchilla-optimal allocation between model size and data.
- Explain why over-training (beyond Chinchilla) is optimal for inference-heavy deployment.
- Use scaling laws to predict performance of larger models.
- Plan a training run given a fixed compute budget.
Notation
- — number of parameters
- — number of training tokens
- — total compute (FLOPs)
- — loss (cross-entropy)
Core Intuition
Language model performance follows surprisingly predictable power laws: double the compute → fixed reduction in loss. This means we can predict how a 100B model will perform by training 1B models. The key question: given a fixed compute budget, how should you split it between a larger model vs more data? Chinchilla showed the answer: scale both equally (), contrary to the "make models as large as possible" approach.
Chinchilla Scaling Laws
Kaplan Scaling Laws (OpenAI)
Kaplan et al. (2020): Loss follows power laws in , , and :
Key findings:
- Performance improves smoothly with scale (no plateaus).
- Parameters matter more than data (larger model with less data > smaller with more).
- This led to training VERY large models on relatively little data (GPT-3: 175B params, 300B tokens).
Chinchilla Optimal Training
Hoffmann et al. (2022, DeepMind): Kaplan's conclusion was WRONG. Both parameters and data should scale equally:
The Chinchilla rule: Optimal tokens 20x parameters.
| Compute budget | Optimal | Optimal |
|---|---|---|
| FLOPs | 400M | 8B tokens |
| FLOPs | 1.4B | 28B tokens |
| FLOPs | 4.7B | 94B tokens |
| FLOPs | 16B | 320B tokens |
| FLOPs | 52B | 1.04T tokens |
Implication: GPT-3 (175B params, 300B tokens) was undertrained. The same compute could have been used for a 70B model trained on 1.4T tokens — achieving BETTER performance.
The Compute-Optimal Frontier
Parametric loss model:
where:
- : reducible loss from limited model capacity.
- : reducible loss from limited data.
- : irreducible loss (noise in data).
Optimal allocation (minimize given ):
Chinchilla found (equal scaling).
Over-Training for Inference
Post-Chinchilla insight (LLaMA, 2023): Chinchilla minimizes loss for fixed TRAINING compute. But at deployment, inference cost scales with (not ). A smaller model trained on MORE data has:
- Same training compute.
- Same or better loss.
- MUCH cheaper inference.
LLaMA strategy: Train a 7B model on 1T tokens (143x Chinchilla ratio instead of 20x).
Over-training multiplier :
For (LLaMA-7B at 1T tokens): Uses 7x more training compute than Chinchilla-optimal, but inference is 7x cheaper than the Chinchilla-optimal 50B model.
When to over-train: When inference cost dominates (serving millions of users) vs training cost (one-time).
Predicting Performance
Using scaling laws for planning:
- Train small models (100M-1B) at different scales.
- Fit power law: .
- Extrapolate to target scale.
Reliability: Predictions are accurate to within 5% for 10x extrapolation. Less reliable for 100x+ extrapolation (emergent abilities may not be captured).
Downstream task prediction: Harder. Some tasks show smooth scaling; others show sudden "emergence" at specific scales.
Emergent Abilities & Phase Transitions
Wei et al. (2022): Some capabilities appear suddenly at scale:
- Chain-of-thought reasoning: emerges around 100B.
- Multi-step arithmetic: emerges around 10B.
- Code generation: emerges around 1B.
Debate: Are emergent abilities real (phase transitions) or artifacts of evaluation metrics (smooth underlying improvement, discontinuous metric)?
Schaeffer et al. (2023): Many "emergent" abilities disappear when using continuous metrics instead of threshold-based ones. The underlying capability scales smoothly; it just crosses evaluation thresholds at certain scales.
Planning a Training Run
Given budget (in FLOPs):
- Decide target: Chinchilla-optimal (minimize loss) vs over-trained (minimize inference cost).
- Compute and : given chosen .
- Estimate loss: from small-scale experiments.
- Validate: Train a 1/10 scale model first; verify scaling prediction.
- Budget hardware: Total GPU-hours = .
Example: Budget = FLOPs. Chinchilla: 16B model, 320B tokens. Over-trained (): 7B model, 560B tokens. On 1024 H100s at 50% MFU: days.
Common Pitfalls
Pitfall 1. Blindly following Chinchilla ratios without considering deployment. For a model serving millions of requests, the 7x inference cost savings from over-training easily pays for the extra training compute.
Pitfall 2. Extrapolating scaling laws beyond data quality limits. Scaling laws assume constant data quality. At 10T+ tokens, data quality degrades (more duplicates, noise) — actual performance falls below power-law prediction.
Pitfall 3. Ignoring the constant (irreducible loss). No amount of scaling reduces loss below (entropy of natural language). Estimated nats for English text.
Summary
- Power-law scaling: Loss decreases predictably with compute, parameters, and data.
- Chinchilla rule: Optimal tokens 20x parameters for minimum training loss.
- Over-training: Train smaller models longer for cheaper inference (LLaMA approach).
- Prediction: Small-scale experiments reliably predict large-scale performance.
- Emergence: Some capabilities appear at specific scales (debate on mechanism).
- Scaling laws are the most important tool for planning billion-dollar training runs.
Exercises
Exercise 1. Given a budget of FLOPs: compute the Chinchilla-optimal model size and training tokens.
Exercise 2. LLaMA-2 70B was trained on 2T tokens. Is this over-trained or under-trained by Chinchilla standards? By how much?
Exercise 3. Fit a power law to these data points: (100M, 3.5), (1B, 2.8), (10B, 2.3). Predict loss at 100B.
Exercise 4. Compare total cost (training + 1-year inference) for: (a) Chinchilla-optimal 50B model serving 1M requests/day, vs (b) over-trained 7B model at same quality.
Exercise 5. Design an experiment to test whether chain-of-thought reasoning is truly emergent (discontinuous) or appears emergent due to evaluation metrics.