All papersFoundations Classic
Chinchilla: smaller models trained on more data win Paper: Training Compute-Optimal Large Language Models
Jordan Hoffmann, Sebastian Borgeaud, Arthur Mensch, Elena Buchatskaya, Trevor Cai, Eliza Rutherford, Diego de Las Casas, Lisa Anne Hendricks, Johannes Welbl, Aidan Clark, Tom Hennigan, Eric Noland, Katie Millican, George van den Driessche, Bogdan Damoc, Aurelia Guy, Simon Osindero, Karen Simonyan, Erich Elsen, Jack W. Rae, Oriol Vinyals, Laurent Sifre · arXiv preprint (DeepMind) · Posted 29 Mar 2022 · 18 min read · arXiv 2203.15556
1 The problem Show in original You have a fixed compute budget . How big should the model be, and how much data should it see? Most big models used about 300 billion tokens, whatever their size. 67.6% average MMLU accuracy for Chinchilla, 7.6% above Gopher.
2 What they tested Show in original They trained over 400 models , from 70 million to over 16 billion parameters. They used 3 different methods to find the best size and token count. They then trained Chinchilla : 70B parameters, 1.4 trillion tokens. They compared it to Gopher, GPT-3 and others. 3 What they found Show in original All 3 methods say: grow size and tokens equally . Gopher was too big for its budget. Chinchilla beat Gopher on nearly every task. It is 4x smaller, so it costs less to run. In a chart Chinchilla beats Gopher and the expert forecast on MMLU From Table 6 0 25 50 75 100 Average 5-shot accuracy on MMLU (%) June 2022 forecast 57.1% Gopher (280B) 60.0% June 2023 forecast 63.4% Chinchilla (70B) 67.6%
Hover, tap or focus a bar to read its exact value.
Show as table Model Accuracy (%) June 2022 forecast 57.1 Gopher (280B) 60.0 June 2023 forecast 63.4 Chinchilla (70B) 67.6
5 Watch out Show in original Only two comparable big runs exist: Chinchilla and Gopher. The paper may still overestimate the best size at large budgets. All runs used less than one epoch of data. The abstract says 67.5% on MMLU. The results say 67.6%. Jump to A The abstract1 Introduction2 Related work3 Estimating the best split of parameters and tokens4 Chinchilla5 Discussion and conclusionA-J Appendices A to J (summary)W Words to knowEvery detail from the paper Cards follow the paper's own order. Dotted words link to Words to know. Numbers match the paper.
A The abstract Show in original The question They study the best model size and token count for a given compute budget. The model is a transformer language model. The finding Current large models are significantly undertrained . The cause is the focus on scaling models while keeping data constant. They trained over 400 models, from 70 million to over 16 billion parameters. These used 5 to 500 billion tokens. For best use of compute, scale model size and tokens equally . For each doubling of model size, double the tokens. The test They trained Chinchilla, a predicted best model. It uses the same compute as Gopher, but with 70B parameters and 4x more data. It beats Gopher (280B), GPT-3 (175B), Jurassic-1 (178B) and Megatron-Turing NLG (530B). It also costs less for fine-tuning and inference. It reaches 67.5% average accuracy on MMLU, over 7% above Gopher. 1 Introduction Show in original The setting Large language models now exceed 500 billion parameters. They do well in zero-shot, few-shot and fine-tuning use. Training costs a lot of compute and energy, and it grows with size. Budgets are usually fixed in advance: how many chips, for how long. Big models can be trained only once, so the right setup matters. The earlier advice Kaplan et al. (2020) found a power law between parameters and performance. So the field trained larger and larger models. They also said large models should not be trained to the lowest loss. This paper agrees, but says models should see many more tokens. With 10x more compute, Kaplan et al. say size should grow 5.5x. They say tokens should grow only 1.8x. This paper finds both should grow in equal proportion. The result of that advice Many recent models trained on about 300 billion tokens (Table 1). They raised compute by raising size only. Model Parameters Training tokens LaMDA 137 Billion 168 Billion GPT-3 175 Billion 300 Billion Jurassic 178 Billion 300 Billion Gopher 280 Billion 300 Billion MT-NLG 530B 530 Billion 270 Billion Chinchilla 70 Billion 1.4 Trillion
Table 1: current large models
What they do Given a fixed FLOPs budget, how to trade model size against tokens? They model the final loss L(N, D). It depends on parameters N and tokens D. Compute C is set by N and D. So they minimize L under a compute limit. Nopt(C) and Dopt(C) give the best split of a budget C. They estimate these from the losses of over 400 models. The models range from under 70M to over 16B parameters. They used 5B to over 400B tokens, with each model trained for several horizons. The prediction and the test For the Gopher budget, the best model is 4 times smaller. It should train on 4 times more tokens. They test this with Chinchilla: 70B parameters, 1.4 trillion tokens. It beats Gopher and costs less to run. Energy cost is spread over inference and fine-tuning too. So a smaller, better-trained model helps beyond its score. 3 Estimating the best split of parameters and tokens Show in original The plan They use three approaches to the same question. Each trains many models with different size and token counts. Each fits a formula to the training curves. They assume a power law between compute and model size. All predictions are similar: scale parameters and tokens equally with compute. Table 2 gives the exponents. This differs from earlier work. How Chinchilla was chosen From Sections 3 and 4 Train 400+ models of many sizes Find the best split 3 ways All 3: grow both equally Gopher budget: 40B to 70B Train Chinchilla: 70B, 1.4T tokens The 40B estimate comes from the parametric fit. The paper trains 70B, on the larger end of the range.
All three methods split extra compute about equally From Table 2 Parameters (a) Tokens (b)
0 0.25 0.5 0.75 1 Exponent on compute: a for parameters, b for tokens 1. Training curves 0.50 exponent 0.50 exponent 2. IsoFLOP 0.49 exponent 0.51 exponent 3. Parametric 0.46 exponent 0.54 exponent Kaplan et al. (2020) 0.73 exponent 0.27 exponent
Hover, tap or focus a bar to read its exact value.
Show as table Approach Parameters (a) (exponent) Tokens (b) (exponent) 1. Training curves 0.50 0.50 2. IsoFLOP 0.49 0.51 3. Parametric 0.46 0.54 Kaplan et al. (2020) 0.73 0.27
Approach a (Nopt grows as C^a) b (Dopt grows as C^b) 1. Minimum over training curves 0.50 (0.488, 0.502) 0.50 (0.501, 0.512) 2. IsoFLOP profiles 0.49 (0.462, 0.534) 0.51 (0.483, 0.529) 3. Parametric modelling of the loss 0.46 (0.454, 0.455) 0.54 (0.542, 0.543) Kaplan et al. (2020) 0.73 0.27
Table 2: how the best size and tokens grow with compute
The numbers in brackets are the 10th and 90th percentiles from bootstrapping.
3.1 Approach 1: fix model sizes, vary tokens They train a family of models, from 70M to over 10B parameters. Each model runs for 4 different token counts, over a range of 16x. The learning rate falls 10x over each run. They smooth and interpolate each loss curve. For each FLOP count, they find the run with the lowest loss. They do this at 1500 FLOP values spaced on a log scale. All chosen points are in the last 15% of training. So a cosine cycle should decay 10x over about D tokens. They fit power laws and get a = 0.50 and b = 0.50. A head-to-head test at 10^21 FLOPs favors their model size (Appendix D.4). 3.2 Approach 2: IsoFLOP profiles How the IsoFLOP method works From Section 3.2 Fix one FLOP budget Train many model sizes for it Plot final loss against size Fit a parabola, find the valley Fit power laws across budgets There are 9 FLOP budgets, from 6 x 10^18 to 3 x 10^21.
Model size varies up to 16B parameters. The cosine schedule length matches the token count. For each budget there is a clear valley in loss. They fit a parabola to each curve to find the best size. They then fit power laws: Nopt ∝ C^a and Dopt ∝ C^b. They get a = 0.49 and b = 0.51. 3.3 Approach 3: fit a loss formula The formula They fit all final losses from approaches 1 and 2. The formula is L(N, D) = E + A/N^α + B/D^β. E is the best possible loss, like the entropy of natural text. The second term shows a perfect transformer of size N falls short of that. The third term shows training is not run to convergence. The fit They fit A, B, E, α and β with L-BFGS. They minimize the Huber loss on the log loss. The Huber loss uses δ = 10^-3. It is robust to outliers. They use a grid of starting points, to avoid local minima. Appendix D.2 gives E = 1.69, A = 406.4 and B = 410.7. The coefficients are about 0.34 for N and 0.28 for D. The frontier They minimize the fitted loss under FLOPs(N, D) ≈ 6ND. This gives a = 0.46 and b = 0.54. For the Gopher budget, the best size is projected at 40B parameters. At low FLOPs (1e21 or less), residuals are larger. The Huber loss treats them as outliers. Because the frontier curves, this predicts a smaller best size than the other two. 3.4 Optimal model scaling The three methods give similar results. All say: grow parameters and tokens in about equal proportion. Methods 1 and 2 predict very similar sizes. Method 3 predicts even smaller models at large budgets. Table 3 shows the budget and tokens a model of each size needs. Parameters FLOPs FLOPs (in Gopher units) Tokens 400 Million 1.92e+19 1/29, 968 8.0 Billion 1 Billion 1.21e+20 1/4, 761 20.2 Billion 10 Billion 1.23e+22 1/46 205.1 Billion 67 Billion 5.76e+23 1 1.5 Trillion 175 Billion 3.85e+24 6.7 3.7 Trillion 280 Billion 9.90e+24 17.2 5.9 Trillion 520 Billion 3.43e+25 59.5 11.0 Trillion 1 Trillion 1.27e+26 221.3 21.2 Trillion 10 Trillion 1.30e+28 22515.9 216.2 Trillion
Table 3: best FLOPs and tokens by model size (Approach 1)
The text also says 175 billion parameters needs 4.41 x 10^24 FLOPs and over 4.2 trillion tokens.
What it means Current large models are far too big for their budgets. A 175 billion model should get 4.41 x 10^24 FLOPs and over 4.2 trillion tokens. A 280 billion Gopher-like model fits a budget of about 10^25 FLOPs. It should see 6.8 trillion tokens. A 1 trillion model is unlikely to be best, unless the budget is 10^26 FLOPs. That is over 250x the compute used for Gopher. The needed data is far beyond what large models now use. So data collection matters as much as engineering for scale. There is large uncertainty when extrapolating many orders of magnitude. Other data sets Appendix C repeats the IsoFLOP test on C4 and GitHub code. Both again say to scale size and tokens equally. 4 Chinchilla Show in original The test The best size for the Gopher budget is between 40 and 70 billion parameters. They train a model at the larger end: 70B parameters on 1.4T tokens. This is for data and compute reasons. They call it Chinchilla. Chinchilla and Gopher use the same number of FLOPs. Chinchilla is 4x smaller, so memory and inference cost are lower. 4.1 Model and training details Same as Gopher, except It trains on MassiveText, with a slightly different subset mix for more tokens (Table A1). It uses AdamW, not Adam. This improves loss and downstream results. It uses a slightly changed SentencePiece tokenizer, with no NFKC normalization. 94.15% of its tokens match Gopher's. It helps math and chemistry text. The forward and backward passes use bfloat16. A float32 copy of the weights is kept in the optimizer state. Appendix G shows the effect of these changes. AdamW only passes Adam about 80% of the way through the cosine cycle. Model Layers / heads Key-value size / dmodel Max LR / batch (tokens) Gopher 280B 80 / 128 128 / 16,384 4 x 10^-5 / 3M to 6M Chinchilla 70B 80 / 64 128 / 8,192 1 x 10^-4 / 1.5M to 3M
Table 4: architecture details
The feed-forward size is 4 times dmodel. The batch size doubles midway through training.
4.2 Results: overview and language modeling Setup They compare to many large models on a large set of tasks (Table 5). They use mostly the tasks of the Gopher paper. They add a few new tests for fair comparison. The Pile Chinchilla beats Gopher on all subsets of The Pile. It beats Jurassic-1 on all but two: dm_mathematics and ubuntu_irc. On Wikitext103, perplexity is 7.16, against 7.75 for Gopher. Care is needed: Chinchilla saw 4x more data, so test leakage may help it. So they stress tasks where leakage matters less, like MMLU and BIG-bench. 4.2.2 MMLU MMLU has exam-like questions on academic subjects. Chinchilla averages 67.6% 5-shot over 57 tasks. Gopher gets 60.0%. That is a gain of 7.6%. It beats the expert forecast for June 2023: 63.4%. It gets over 90% on 4 tasks: high_school_gov_and_politics, international_law, sociology, us_foreign_policy. It beats Gopher on 51 of 57 tasks, ties on 2, and loses on 4. The four losses: college_mathematics, econometrics, moral_scenarios, formal_logic. Chinchilla tops Gopher and the expert forecast on MMLU From Table 6 0 25 50 75 100 Average 5-shot accuracy on MMLU (%) June 2022 forecast 57.1% Gopher (280B) 60.0% June 2023 forecast 63.4% Chinchilla (70B) 67.6%
Hover, tap or focus a bar to read its exact value.
Show as table Model Accuracy (%) June 2022 forecast 57.1 Gopher (280B) 60.0 June 2023 forecast 63.4 Chinchilla (70B) 67.6
Model or reference Accuracy Random 25.0% Average human rater 34.5% GPT-3 5-shot 43.9% Gopher 5-shot 60.0% Chinchilla 5-shot 67.6% Average human expert performance 89.8% June 2022 Forecast 57.1% June 2023 Forecast 63.4%
Table 6: MMLU average 5-shot accuracy
The first three rows come from Hendrycks et al. The forecasts are the average of 73 human forecasters.
Reading, BIG-bench and common sense Reading comprehension LAMBADA: Chinchilla 77.4%, Gopher 74.5%, MT-NLG 530B 76.6%. RACE-h and RACE-m: a large gain over Gopher. GPT-3 and MT-NLG use a different prompt format, so those are not comparable. Task Chinchilla Gopher GPT-3 / MT-NLG LAMBADA zero-shot 77.4 74.5 76.2 / 76.6 RACE-m few-shot 86.8 75.1 58.1 / - RACE-h few-shot 82.3 71.6 46.8 / 47.9
Table 7: reading comprehension
BIG-bench Chinchilla improves the average by 10.7%. It reaches 65.1% against 54.4% for Gopher. It does worse on only 4 of 62 tasks. The four: crash_blossom, dark_humor_detection, mathematical_induction, logical_args. Common sense Chinchilla beats Gopher and GPT-3 on all tasks in Table 8. It beats MT-NLG 530B on all but one task. Chinchilla matches or beats larger models on common sense From Table 8 Chinchilla Gopher GPT-3 MT-NLG 530B
0 25 50 75 100 Zero-shot accuracy (%) HellaSwag 80.8% 79.2% 78.9% 80.2% Winogrande 74.9% 70.1% 70.2% 73.0% BoolQ 83.7% 79.3% 60.5% 78.2%
Hover, tap or focus a bar to read its exact value.
Show as table Task Chinchilla (%) Gopher (%) GPT-3 (%) MT-NLG 530B (%) HellaSwag 80.8 79.2 78.9 80.2 Winogrande 74.9 70.1 70.2 73.0 BoolQ 83.7 79.3 60.5 78.2
Task Chinchilla / Gopher GPT-3 / MT-NLG 530B Supervised SOTA HellaSwag 80.8% / 79.2% 78.9% / 80.2% 93.9% PIQA 81.8% / 81.8% 81.0% / 82.0% 90.1% Winogrande 74.9% / 70.1% 70.2% / 73.0% 91.3% SIQA 51.3% / 50.6% - / - 83.2% BoolQ 83.7% / 79.3% 60.5% / 78.2% 91.4%
Table 8: zero-shot common sense
TruthfulQA Chinchilla gets 43.6% 0-shot, 58.5% 5-shot and 66.7% 10-shot. Gopher gets 29.5% 0-shot and 43.7% 10-shot. The 14.1% 0-shot gain suggests better modeling of the data alone can help a lot. Closed-book question answering Chinchilla sets new closed-book bests on Natural Questions: 31.5% 5-shot and 35.5% 64-shot. Gopher gets 21% and 28%. On TriviaQA it beats Gopher on both the filtered and unfiltered sets. On the filtered set it trails the best open-book system by only 7.9%. Task and shots Chinchilla Gopher GPT-3 / open-book SOTA Natural Questions 0-shot 16.6% 10.1% 14.6% / - Natural Questions 5-shot 31.5% 24.5% - / 54.4% Natural Questions 64-shot 35.5% 28.2% 29.9% / - TriviaQA unfiltered 0-shot 67.0% 52.8% 64.3% / - TriviaQA unfiltered 5-shot 73.2% 63.6% - / - TriviaQA unfiltered 64-shot 72.3% 61.3% 71.2% / - TriviaQA filtered 0-shot 55.4% 43.5% - / - TriviaQA filtered 5-shot 64.1% 57.0% - / 72.5% TriviaQA filtered 64-shot 64.6% 57.2% - / -
Table 9: closed-book QA
Gender bias and toxicity Risks Large models can output offensive text, spread bias and leak private data. Chinchilla uses the same data as Gopher, so similar risks are expected. These tests are not comprehensive. Winogender Chinchilla resolves pronouns better than Gopher for every group. The gain is smaller for male pronouns (3.2%). It is 8.3% for female and 9.2% for neutral pronouns. The biggest gain is on female 'gotcha' examples: 10%. Gotcha examples go against gender stereotypes. Uneven gains across groups show bias remains. Group Chinchilla Gopher All 78.3% 71.4% Male 71.2% 68.0% Female 79.6% 71.3% Neutral 84.2% 75.0% Male gotcha 62.5% 59.2% Male not gotcha 80.0% 76.7% Female gotcha 76.7% 66.7% Female not gotcha 82.5% 75.8%
Table 10: Winogender accuracy
Toxicity They made 25,000 unprompted samples from each model. They scored them with PerspectiveAPI. Mean (median) toxicity: Gopher 0.081 (0.064), Chinchilla 0.087 (0.066). 95th percentile: Gopher 0.230, Chinchilla 0.238. Most samples are non-toxic, and the difference is negligible. Better models of the data are not necessarily more toxic. 5 Discussion and conclusion Show in original The trend The trend has been to grow model size, often with no more tokens. MT-NLG 530B is over 3x larger than GPT-3, yet used about the same tokens. The authors say the race to bigger models yields undertrained models. Three methods, from over 400 runs, all say Gopher is oversized. A smaller model with more data should do better. Chinchilla, at 70B, beats Gopher and larger models on nearly every task. Limits Only two comparable large runs exist: Chinchilla and Gopher. There are no tests at in-between scales. They assume a power law for the compute frontier. Log Nopt shows some concavity at high budgets (Appendix E). So they may still overestimate the best size for large models. All training runs used less than one epoch of data. Future work could study training on multiple epochs. Data matters now More focus on data set scaling is needed. More data helps only if it is high quality (a speculation). Larger data sets need care with train-test overlap. Training on trillions of tokens raises ethics and privacy worries. Web data holds toxic text, bias and private information. Chinchilla suffers from bias and toxicity, but seems less affected than Gopher. A-J Appendices A to J (summary) Show in original A. Training data MassiveText parts: MassiveWeb, Books, C4, News, GitHub and Wikipedia. Chinchilla sampling: 45% MassiveWeb, 30% Books, 10% C4. Also 10% News, 4% GitHub and 1% Wikipedia. In 1.4T tokens, MassiveWeb is used 1.24 epochs and Wikipedia 3.40. B. Cosine cycle length A cosine cycle much longer than the training steps gives worse models. Performance drops when the cycle overshoots by more than 25%. C. Other data sets IsoFLOP results on C4 give a = 0.50 and b = 0.50. On GitHub code they give a = 0.53 and b = 0.47. So the result holds while you train for no more than one epoch. D. Scaling analysis details Approach 1 uses a max learning rate of 2 x 10^-4 for the smallest models. It uses 1.25 x 10^-4 for the largest. Approach 3 gives the formula and fit details. The small-scale test at 10^21 FLOPs: Kaplan et al. suggest 4.68 billion parameters. Approach 1 suggests 2.86 billion. They trained 4.74 and 2.80 billion models. The smaller model, from Approach 1, did better. E, F and G E: the frontier curves, so smaller models may be best for big budgets. F: FLOPs counting includes embeddings, with a factor of 2 for multiply-accumulate. G: AdamW beats Adam at any schedule, shown on a 680 million parameter model. H, I and J H: more results on The Pile, MMLU, Winogender and BIG-bench. I: a model card for Chinchilla. J: a list of all trained models. The tables in H and J are not copied here. Words to know Epoch: One full pass over the training data.FLOPs: A count of the math operations used in training.Undertrained: A model that saw too little data for its size.Ask AI about this paper Stuck on a word or an idea? Ask in plain words. The answer comes from the write-up on this page.
Ask AI about this paper Explain it like I am new to AI How would a finance team use this? What are the limits?
Jump to