Study the paper
Scaling Laws for Neural Language Models
Lessons, visuals, quizzes, flashcards, and resources—organized in teaching order.
Transformer Parameter and Compute Scaling
Optimal Compute Allocation Scaling Relations
Optimal Compute Allocation Scaling Relations
Source equation
This set of scaling relations determines how to optimally allocate an increased compute budget among the model size (number of non-embedding parameters ), the batch size , and the number of training steps . The total number of tokens processed during training is given by .
Sources
S1.E7
N∝CαCmin/αN,B∝CαCmin/αB,S∝CαCmin/αS,D=B⋅Sformulae-sequenceproportional-to𝑁superscript𝐶superscriptsubscript𝛼𝐶minsubscript𝛼𝑁formulae-sequenceproportional-to𝐵superscript𝐶superscriptsubscript𝛼𝐶minsubscript𝛼𝐵formulae-sequenceproportional-to𝑆superscript𝐶superscriptsubscript𝛼𝐶minsubscript𝛼𝑆𝐷⋅𝐵𝑆N\propto C^{\alpha_{C}^{\rm min}/\alpha_{N}},\quad B\propto C^{\alpha_{C}^{\rm min}/\alpha_{B}},\quad S\propto C^{\alpha_{C}^{\rm min}/\alpha_{S}},\quad D=B\cdot S\quad (1.7)
N\propto C^{\alpha_{C}^{\rm min}/\alpha_{N}},\quad B\propto C^{\alpha_{C}^{\rm min}/\alpha_{B}},\quad S\propto C^{\alpha_{C}^{\rm min}/\alpha_{S}},\quad D=B\cdot S\quadSources
S1.E7
N∝CαCmin/αN,B∝CαCmin/αB,S∝CαCmin/αS,D=B⋅Sformulae-sequenceproportional-to𝑁superscript𝐶superscriptsubscript𝛼𝐶minsubscript𝛼𝑁formulae-sequenceproportional-to𝐵superscript𝐶superscriptsubscript𝛼𝐶minsubscript𝛼𝐵formulae-sequenceproportional-to𝑆superscript𝐶superscriptsubscript𝛼𝐶minsubscript𝛼𝑆𝐷⋅𝐵𝑆N\propto C^{\alpha_{C}^{\rm min}/\alpha_{N}},\quad B\propto C^{\alpha_{C}^{\rm min}/\alpha_{B}},\quad S\propto C^{\alpha_{C}^{\rm min}/\alpha_{S}},\quad D=B\cdot S\quad (1.7)
N\propto C^{\alpha_{C}^{\rm min}/\alpha_{N}},\quad B\propto C^{\alpha_{C}^{\rm min}/\alpha_{B}},\quad S\propto C^{\alpha_{C}^{\rm min}/\alpha_{S}},\quad D=B\cdot S\quadDeep dive
Illustrative Calculation
Let us compute the scaling exponents given the empirical values from the paper:
First, we find the minimum scaling exponent using the relation:
Let's calculate the terms:
Summing these values:
Thus, the minimum exponent is:
Now, we compute the scaling exponents for each resource allocation:
- For model size :
- For batch size :
- For steps :
This shows that as the compute budget increases, the optimal allocation scales the model size fastest (), followed by training steps () and batch size ().
Sources
S1.E7
N∝CαCmin/αN,B∝CαCmin/αB,S∝CαCmin/αS,D=B⋅Sformulae-sequenceproportional-to𝑁superscript𝐶superscriptsubscript𝛼𝐶minsubscript𝛼𝑁formulae-sequenceproportional-to𝐵superscript𝐶superscriptsubscript𝛼𝐶minsubscript𝛼𝐵formulae-sequenceproportional-to𝑆superscript𝐶superscriptsubscript𝛼𝐶minsubscript𝛼𝑆𝐷⋅𝐵𝑆N\propto C^{\alpha_{C}^{\rm min}/\alpha_{N}},\quad B\propto C^{\alpha_{C}^{\rm min}/\alpha_{B}},\quad S\propto C^{\alpha_{C}^{\rm min}/\alpha_{S}},\quad D=B\cdot S\quad (1.7)
N\propto C^{\alpha_{C}^{\rm min}/\alpha_{N}},\quad B\propto C^{\alpha_{C}^{\rm min}/\alpha_{B}},\quad S\propto C^{\alpha_{C}^{\rm min}/\alpha_{S}},\quad D=B\cdot S\quad- Total compute budget · scalar
- Optimal model size (number of non-embedding parameters) · scalar
- Optimal batch size · scalar
- Optimal number of training steps · scalar
- Total dataset size in tokens · scalar
- alpha_C_min
- Minimum scaling exponent for compute · scalar
- Power-law scaling exponent for model size · scalar
- Power-law scaling exponent for batch size · scalar
- Power-law scaling exponent for training steps · scalar