Papers · arXiv 2001.08361
Scaling Laws for Neural Language Models
Published cs.LGstat.ML arXivPDF
Summary in three lines
- 🎯 Determine how autoregressive Transformer language model performance scales with model parameters, dataset size, and compute budget.
- 🔧 Train decoder-only Transformers over several orders of magnitude in parameters, data, and compute to fit empirical power laws and critical batch size dynamics.
- 📈 Performance follows smooth power laws across >7 orders of magnitude in compute; compute-efficient training allocates compute primarily to model size () rather than dataset size ().
Abstract
We study empirical scaling laws for language model performance on the cross-entropy loss. The loss scales as a power-law with model size, dataset size, and the amount of compute used for training, with some trends spanning more than seven orders of magnitude. Other architectural details such as network width or depth have minimal effects within a wide range. Simple equations govern the dependence of overfitting on model/dataset size and the dependence of training speed on model size. These relationships allow us to determine the optimal allocation of a fixed compute budget. Larger models are significantly more sample-efficient, such that optimally compute-efficient training involves training very large models on a relatively modest amount of data and stopping significantly before convergence.
Reading guide
Problem and motivation
Language modeling has progressed rapidly with Transformer architectures, but training large models requires substantial compute and data. Prior to this work, it was unclear how performance (measured by cross-entropy loss) depended on architectural shape (depth vs. width), parameter count, dataset size, and training compute. Without quantitative scaling relationships, researchers typically trained smaller models near convergence rather than understanding how to optimally allocate a fixed compute budget.
Key ideas
- Scale dominates architecture: Within broad bounds, Transformer performance depends heavily on the non-embedding parameter count , dataset size , and compute , while architectural hyperparameters like depth, width, and number of attention heads have minimal impact when is fixed.
- Smooth power-law scaling: Cross-entropy test loss scales as a power law with , , and compute across more than six to eight orders of magnitude.
- Sublinear data growth to avoid overfitting: Avoiding overfitting requires scaling dataset size sublinearly with parameters: .
- Compute efficiency means large models stopped early: To maximize performance under a fixed compute budget , one should train very large models and stop significantly before convergence, allocating compute as , batch size , and steps .
Method (with the key equations)
The authors evaluate decoder-only Transformer models on WebText2 (using BPE tokenization, context ). Model size specifically excludes embedding parameters: .
Non-embedding compute per forward-backward pass is approximated as .
Individual Power Laws:
- Parameter-limited:
- Data-limited:
- Compute-limited (at batch size ):
Simultaneous Parameter and Data Scaling:
Training Dynamics and Critical Batch Size: The learning curve fits steps (steps when ):
Optimal Allocations: Efficient training targets a loss approximately above converged loss ().
Results (with the most important numbers)
- Trends hold over 8 orders of magnitude in compute, 6 in parameters, and 2 in data.
- Doubling reduces loss by a factor of .
- Overfitting avoidance threshold: . Increasing model size by requires only about a data increase.
- For a increase in compute budget , compute-efficient training increases model size by (), batch size by (), and training steps by only ().
- Compared to training to near-convergence ( deviation), compute-optimal training uses less compute, more parameters, and fewer parameter update steps.
- Transfer loss to out-of-distribution corpora (Books Corpus, Common Crawl, English Wikipedia) improves smoothly with model size, incurring a nearly constant penalty offset relative to WebText2 validation loss.
Limitations and open questions
- The paper lacks a rigorous theoretical derivation (e.g., statistical physics foundation) explaining the precise exponents.
- The compute scaling omits attention-specific costs proportional to or context-dependent compute when .
- Hyperparameters such as regularization, dropout tuning, and learning rate schedules at extreme scales were held mostly fixed or not tuned per dataset size.
- Extrapolating compute-optimal trends leads to a contradiction where crosses at , parameters, and , signaling that the empirical trends must eventually break down or flatten near the natural language entropy floor.
Key terms
- Non-embedding parameters ($N$)
- The count of Transformer parameters excluding vocabulary and positional embedding matrices, calculated as .
- PF-day
- A unit of compute corresponding to floating point operations per second running for one day, equal to FLOPs.
- Critical batch size ($B_{\text{crit}}$)
- The training batch size providing an optimal tradeoff between compute efficiency and serial training time, scaling inversely with a power of the loss.
- Compute-efficient frontier
- The optimal configuration of model size, batch size, and update steps that minimizes validation loss for a given fixed compute budget.
- Sample efficiency
- The rate at which a model improves per processed data token; larger models achieve a target loss with substantially fewer tokens than smaller models.
- WebText2
- The extended text pre-training dataset of outbound Reddit links through October 2018 used to fit the primary empirical scaling laws.
- Early stopping step ($S_{\text{stop}}$)
- The step at which test loss ceases to improve on a finite dataset due to overfitting, for which the authors derive an empirical lower bound.
Questions
Why exclude embedding parameters when calculating model size $N$?
Excluding vocabulary and positional embeddings produces significantly cleaner and more universal power-law trends across varying depths and parameter counts, showing that embedding parameters can be varied without significantly altering core Transformer capacity.
Should a fixed compute budget be spent on training longer or training a larger model?
It should be spent primarily on training a larger model. Optimally compute-efficient training scales parameters as and steps as , stopping training long before convergence.
How does Transformer aspect ratio (depth vs. width) impact loss?
Performance depends very weakly on the ratio of depth to width or the number of attention heads when non-embedding parameters are held constant; aspect ratio can vary by a factor of 40 with only minor variations in loss.
How does cross-entropy loss transfer to out-of-distribution text?
Transfer loss to other corpora scales with model size at roughly the same power-law rate as on the training distribution, differing mainly by a roughly constant additive penalty.
The overview on this page was written by AI from the paper and may contain mistakes. Read the paper for the details.