Papers · arXiv 2203.15556
Training Compute-Optimal Large Language Models
Summary in three lines
- 🎯 Determine the optimal trade-off between model parameters and training tokens under a fixed compute budget.
- 🔧 Empirically fit scaling laws across >400 transformer runs using minimum-loss envelopes, IsoFLOP slices, and parametric loss modeling.
- 📈 Parameters and tokens should scale equally (, ). The 70B Chinchilla model trained on 1.4T tokens matches Gopher's compute budget and achieves 67.6% on MMLU.
Abstract
We investigate the optimal model size and number of tokens for training a transformer language model under a given compute budget. We find that current large language models are significantly undertrained, a consequence of the recent focus on scaling language models whilst keeping the amount of training data constant. By training over 400 language models ranging from 70 million to over 16 billion parameters on 5 to 500 billion tokens, we find that for compute-optimal training, the model size and the number of training tokens should be scaled equally: for every doubling of model size the number of training tokens should also be doubled. We test this hypothesis by training a predicted compute-optimal model, Chinchilla, that uses the same compute budget as Gopher but with 70B parameters and 4 more more data. Chinchilla uniformly and significantly outperforms Gopher (280B), GPT-3 (175B), Jurassic-1 (178B), and Megatron-Turing NLG (530B) on a large range of downstream evaluation tasks. This also means that Chinchilla uses substantially less compute for fine-tuning and inference, greatly facilitating downstream usage. As a highlight, Chinchilla reaches a state-of-the-art average accuracy of 67.5% on the MMLU benchmark, greater than a 7% improvement over Gopher.
Reading guide
Problem and motivation
Prior work (notably Kaplan et al., 2020) suggested that when compute increases, model parameters should scale aggressively () while token count increases much more slowly (). Consequently, large models like GPT-3 (175B), Jurassic-1 (178B), Gopher (280B), and MT-NLG (530B) were consistently trained on around 300 billion tokens. However, this left large models significantly undertrained relative to their computational investments. This work revisits the trade-off: for a fixed compute budget , how should parameter count and token count be allocated to minimize test loss?
Key ideas
- Equal scaling: For every doubling of model parameters, training tokens should also double (, ).
- Cosine schedule alignment: Learning rate schedules must match the actual training horizon. Using intermediate points from a run decayed over a fixed long horizon (e.g., 130B tokens) overestimates loss for smaller token counts and skews empirical scaling estimates.
- Downstream efficiency: Training a smaller model on substantially more tokens yields identical or better accuracy at pretraining compute parity while dramatically cutting memory footprint, fine-tuning costs, and inference latency.
Method (with the key equations)
The authors evaluate over 400 models (70M to 16B parameters, trained across 5B to 500B tokens) using three complementary strategies:
Minimum over training curves: Vary the horizon over 4 durations for fixed model architectures. Extract the envelope of minimum loss per FLOP and fit power laws: yielding , .
IsoFLOP profiles: Fix total FLOP count across 9 discrete budgets ( to ) with cosine decay aligned to the horizon. Fit parabolas over parameter counts to find the loss minima, yielding , .
Parametric loss fitting: Model the smoothed loss using a risk decomposition: where represents natural text entropy, represents representation suboptimality, and captures early stopping/finite data suboptimality. Minimizing Huber loss on log residuals gives , , , , . Under the constraint :
Results (with the most important numbers)
- Chinchilla 70B: Trained with the same FLOP budget as Gopher ( FLOPs, or under exact accounting) using 70B parameters and 1.4 trillion tokens.
- MMLU Benchmark: Chinchilla reaches 67.6% average 5-shot accuracy, outperforming Gopher (60.0%), GPT-3 (43.9%), and surpassing the June 2023 human expert forecast (63.4%). It achieves accuracy on 4 distinct MMLU tasks.
- Downstream benchmarks: Outperforms Gopher on BIG-bench (65.1% vs 54.4%), LAMBADA (77.4% vs 74.5%), and closed-book Natural Questions (31.5% 5-shot vs 24.5%).
- Bias and Toxicity: Unprompted toxicity remains comparable between Gopher and Chinchilla (median 0.064 vs 0.066), while Winogender accuracy improves from 71.4% to 78.3% overall.
Limitations and open questions
- Only two large-scale frontier points at parity were directly verified (Gopher 280B vs Chinchilla 70B) due to training cost.
- The analysis assumes single-epoch training on web datasets; behavior when repeating data across multiple epochs was left unexplored.
- There is empirical evidence of slight negative curvature (concavity) in at high compute budgets, suggesting power laws may still slightly overestimate optimal model size.
Key terms
- Chinchilla
- A 70-billion parameter autoregressive language model trained on 1.4 trillion tokens using the compute budget of Gopher.
- Gopher
- A 280-billion parameter transformer language model trained on 300 billion tokens that serves as the compute-equivalent baseline.
- IsoFLOP profiles
- A methodology where model parameter count is varied while holding total training FLOPs constant to locate the loss-minimal parameter size.
- Compute-optimal frontier
- The mathematical curve relating available training FLOPs to the optimal allocation of parameter count and training token volume.
- Parametric loss function
- The statistical decomposition of LM loss into irreducible Bayes entropy, parameter capacity deficit, and token sample optimization error.
- Huber loss
- A robust loss function used in Approach 3 to fit empirical LM runs while attenuating the effect of residual outliers at small compute scales.
- MassiveText
- The multi-domain pretraining corpus containing web pages, books, news, code, and Wikipedia used to train both Gopher and Chinchilla.
- FLOPs calculation
- The multiply-accumulate operation budget, calculated as approximately across forward and backward passes or through layer-by-layer accounting.
Questions
Why did Kaplan et al. conclude parameters should scale faster than tokens?
Kaplan et al. used a fixed learning rate cosine schedule (e.g. decayed to 130B tokens) and used intermediate un-converged training evaluations for smaller token points. Because cosine learning rate schedules degrade if the cycle length significantly exceeds the total steps, those intermediate losses were artificially high, underestimating the effectiveness of training smaller models on fewer tokens.
What is the rule of thumb for compute-optimal scaling according to Chinchilla?
Both the number of model parameters and the number of training tokens should be scaled in approximately equal proportions: for every increase in compute, model size should increase by and training tokens should increase by .
How many tokens are recommended to train a compute-optimal 175B model?
According to the paper's predictions, a 175-billion parameter model requires roughly 3.7 to 4.3 trillion tokens and to FLOPs to be compute-optimal, far exceeding the 300 billion tokens typically used for GPT-3.
What architecture changes were made between Gopher and Chinchilla?
Beyond reducing the layer count and hidden dimension from 280B to 70B, Chinchilla swapped the Adam optimizer for AdamW, maintained float32 master weights in the distributed optimizer state, and removed NFKC normalization from the SentencePiece tokenizer.
The overview on this page was written by AI from the paper and may contain mistakes. Read the paper for the details.