Scaling Laws for Language Models
Volume III, Chapter 12 — Part I. Power-law scaling of loss with compute, parameters, and data: Chinchilla optimal allocation, Kaplan vs. Hoffmann laws, and theoretical implications for LLM training.
Prerequisites
Table of Contents
- Learning Objectives
- Prerequisites
- Notation
- Core Intuition
- Empirical Scaling Laws
- Loss as a Function of Compute
- Loss as a Function of Model Size and Data
- The Chinchilla Optimal Allocation
- Kaplan vs. Chinchilla Recommendations
- Breaking Scaling Laws
- Worked Examples
- Connection to the Broader Curriculum
- Common Pitfalls and Misconceptions
- Research Perspective
- Summary of Takeaways
- Exercises
Learning Objectives
After reading this chapter, you should be able to:
- State the power-law form of scaling: , .
- Define training compute FLOPs and the compute-optimal frontier.
- Derive Chinchilla's optimal allocation: train smaller models on more tokens.
- Contrast Kaplan et al. (2020) vs. Hoffmann et al. (2022) recommendations.
- Explain implications for Tokenization and pretraining budget.
Prerequisites
- Maximum Likelihood Estimation — cross-entropy loss
- Tokenization — tokens as data unit
Notation
- — Number of model parameters
- — Training tokens (dataset size)
- — Compute budget (FLOPs)
- — Cross-entropy loss (nats per token)
- — Empirical scaling exponents
Core Intuition
LLM performance improves predictably with scale — not linearly, but via power laws. Doubling compute yields predictable (diminishing) loss reduction. Scaling laws quantify these relationships, enabling budget allocation: given a compute budget, how large should the model be and how many tokens should it see?
The Chinchilla result (Hoffmann et al., 2022) overturned prior wisdom: for compute-optimal training, model size and data should scale equally — most models were undertrained.
Series context. Volume III, Chapter 12 (Pretraining).
Neural Scaling Laws
Empirical Scaling Laws
Definition 1 (Cross-Entropy Loss). Pretraining minimizes:
Definition 2 (Power Law). Empirically, loss scales as:
where (parameters, data tokens, compute), , is irreducible loss.
Loss as a Function of Compute
Definition 3 (Training Compute). Approximate FLOPs:
where = non-embedding parameters, = training tokens. Factor 6 accounts for forward + backward pass.
Theorem 1 (Kaplan et al., 2020). For optimal allocation at fixed :
Smooth log-linear improvement over orders of magnitude in compute.
Loss as a Function of Model Size and Data
Separate scaling:
with , (Chinchilla estimates).
Combined (Hoffmann et al.):
where is irreducible entropy of natural language.
The Chinchilla Optimal Allocation
Problem. Minimize subject to (fixed compute).
Theorem 2 (Chinchilla Optimality). At compute-optimal training:
Corollary 1. Parameters and tokens should scale equally with compute: (rough rule of thumb).
Proof sketch. Lagrange optimization on (6) with constraint . Equal scaling exponents when both terms contribute equally at optimum.
Kaplan vs. Chinchilla Recommendations
- Kaplan et al. — Scale faster than — Larger models, less data
- Chinchilla — Scale and equally — Smaller models, ~4× more data
Example. GPT-3 (175B params, 300B tokens) was undertrained by Chinchilla standards. Optimal: ~70B params on ~1.4T tokens for same compute.
Breaking Scaling Laws
Proposition 1 (Limits). Scaling laws are empirical — may break due to:
- Data exhaustion (finite high-quality text)
- Architecture bottlenecks
- Inference cost constraints
- Diminishing returns on downstream tasks vs. pretraining loss
Emergent abilities (Wei et al.) may appear at scale — not captured by smooth loss curves alone.
Worked Examples
Example 1: Compute Budget
FLOPs. Chinchilla: , tokens.
Example 2: Power Law
If , doubling reduces loss by factor (5.5%).
Connection to the Broader Curriculum
- Tokenization — token counting for
- LoRA — efficient adaptation post-pretraining
- DPO — alignment after scale
- Linear Regression — log-log linear fits
Common Pitfalls and Misconceptions
Pitfall 1: Confusing pretraining loss with downstream task performance.
Pitfall 2: Using Kaplan scaling in post-Chinchilla era.
Pitfall 3: Ignoring inference cost when scaling .
Pitfall 4: is approximate (depends on architecture).
Research Perspective
Kaplan et al. (2020). Chinchilla (Hoffmann et al., 2022). Llama 2/3 follow Chinchilla-optimal ratios. Open questions: data quality scaling, mixture-of-experts compute accounting.
Summary of Takeaways
- Compute —
- Parameters —
- Data —
- Chinchilla —
Next: DPO
Exercises
Exercise 1. Fit power law to given data points in log-log space.
Exercise 2. Derive Chinchilla optimum from (6) with Lagrange multipliers.
Exercise 3. For , estimate .
Exercise 4. Compare GPT-3 training to Chinchilla recommendation.
Exercise 5. Why is significant?
Exercise 6. Relate scaling laws to Bias–Variance.
Exercise 7. MoE: how does effective differ from total parameters?
Exercise 8. When do scaling laws predict diminishing returns?