Study the paper
Scaling Laws for Neural Language Models
Lessons, visuals, quizzes, flashcards, and resources—organized in teaching order.
Critical Batch Size and Training Dynamics
Critical Batch Size Power Law
Critical Batch Size Power Law
Source equation
The critical batch size determines the optimal batch size for training neural language models. It represents the threshold where further increasing the batch size yields diminishing returns in terms of training speedup per step. This relationship is modeled as a power law of the cross-entropy loss .
Sources
S1.E4
Bcrit(L)=B∗L1/αB,B∗∼2⋅108 tokens,αB∼0.21formulae-sequencesubscript𝐵crit𝐿subscript𝐵∗superscript𝐿1subscript𝛼𝐵formulae-sequencesimilar-tosubscript𝐵∗⋅2superscript108 tokenssimilar-tosubscript𝛼𝐵0.21B_{\rm crit}\left(L\right)=\frac{B_{\ast}}{L^{1/\alpha_{B}}},\qquad B_{\ast}\sim 2\cdot 10^{8}\text{ tokens},\ \ \alpha_{B}\sim 0.21 (1.4)
B_{\rm crit}\left(L\right)=\frac{B_{\ast}}{L^{1/\alpha_{B}}},\qquad B_{\ast}\sim 2\cdot 10^{8}\text{ tokens},\ \ \alpha_{B}\sim 0.21Sources
S1.E4
Bcrit(L)=B∗L1/αB,B∗∼2⋅108 tokens,αB∼0.21formulae-sequencesubscript𝐵crit𝐿subscript𝐵∗superscript𝐿1subscript𝛼𝐵formulae-sequencesimilar-tosubscript𝐵∗⋅2superscript108 tokenssimilar-tosubscript𝛼𝐵0.21B_{\rm crit}\left(L\right)=\frac{B_{\ast}}{L^{1/\alpha_{B}}},\qquad B_{\ast}\sim 2\cdot 10^{8}\text{ tokens},\ \ \alpha_{B}\sim 0.21 (1.4)
B_{\rm crit}\left(L\right)=\frac{B_{\ast}}{L^{1/\alpha_{B}}},\qquad B_{\ast}\sim 2\cdot 10^{8}\text{ tokens},\ \ \alpha_{B}\sim 0.21Illustrative Calculation
Let's calculate the critical batch size for a target cross-entropy loss of :
-
Given Parameters:
- tokens
-
Compute the Exponent:
-
Compute the Denominator:
-
Calculate :
- tokens
Sources
S1.E4
Bcrit(L)=B∗L1/αB,B∗∼2⋅108 tokens,αB∼0.21formulae-sequencesubscript𝐵crit𝐿subscript𝐵∗superscript𝐿1subscript𝛼𝐵formulae-sequencesimilar-tosubscript𝐵∗⋅2superscript108 tokenssimilar-tosubscript𝛼𝐵0.21B_{\rm crit}\left(L\right)=\frac{B_{\ast}}{L^{1/\alpha_{B}}},\qquad B_{\ast}\sim 2\cdot 10^{8}\text{ tokens},\ \ \alpha_{B}\sim 0.21 (1.4)
B_{\rm crit}\left(L\right)=\frac{B_{\ast}}{L^{1/\alpha_{B}}},\qquad B_{\ast}\sim 2\cdot 10^{8}\text{ tokens},\ \ \alpha_{B}\sim 0.21- Critical batch size measured in tokens · scalar
- Cross-entropy loss value · scalar
- Scale parameter for the critical batch size · scalar
- Power-law scaling exponent · scalar