Study the paper
Scaling Laws for Neural Language Models
Lessons, visuals, quizzes, flashcards, and resources—organized in teaching order.
The Infinite Data Limit and Overfitting
Unified scaling law for parameters and dataset size
Unified scaling law for parameters and dataset size
Source equation
The unified scaling law models the cross-entropy loss as a joint function of the number of non-embedding parameters and the dataset size (measured in tokens). This formulation captures how performance scales when both resources are finite, predicting the onset of overfitting when one resource is bottlenecked relative to the other.
Sources
S1.E5
L(N,D)=[(NcN)αNαD+DcD]αD𝐿𝑁𝐷superscriptdelimited-[]superscriptsubscript𝑁𝑐𝑁subscript𝛼𝑁subscript𝛼𝐷subscript𝐷𝑐𝐷subscript𝛼𝐷L(N,D)=\left[\left(\frac{N_{c}}{N}\right)^{\frac{\alpha_{N}}{\alpha_{D}}}+\frac{D_{c}}{D}\right]^{\alpha_{D}} (1.5)
L(N,D)=\left[\left(\frac{N_{c}}{N}\right)^{\frac{\alpha_{N}}{\alpha_{D}}}+\frac{D_{c}}{D}\right]^{\alpha_{D}}Sources
S1.E5
L(N,D)=[(NcN)αNαD+DcD]αD𝐿𝑁𝐷superscriptdelimited-[]superscriptsubscript𝑁𝑐𝑁subscript𝛼𝑁subscript𝛼𝐷subscript𝐷𝑐𝐷subscript𝛼𝐷L(N,D)=\left[\left(\frac{N_{c}}{N}\right)^{\frac{\alpha_{N}}{\alpha_{D}}}+\frac{D_{c}}{D}\right]^{\alpha_{D}} (1.5)
L(N,D)=\left[\left(\frac{N_{c}}{N}\right)^{\frac{\alpha_{N}}{\alpha_{D}}}+\frac{D_{c}}{D}\right]^{\alpha_{D}}Symbol Definitions
- : The cross-entropy loss, representing the model's performance.
- : The number of model parameters (excluding embeddings).
- : The dataset size in tokens.
- : The critical parameter scale constant.
- : The critical dataset scale constant.
- : The power-law scaling exponent for model size .
- : The power-law scaling exponent for dataset size .
Sources
S1.E5
L(N,D)=[(NcN)αNαD+DcD]αD𝐿𝑁𝐷superscriptdelimited-[]superscriptsubscript𝑁𝑐𝑁subscript𝛼𝑁subscript𝛼𝐷subscript𝐷𝑐𝐷subscript𝛼𝐷L(N,D)=\left[\left(\frac{N_{c}}{N}\right)^{\frac{\alpha_{N}}{\alpha_{D}}}+\frac{D_{c}}{D}\right]^{\alpha_{D}} (1.5)
L(N,D)=\left[\left(\frac{N_{c}}{N}\right)^{\frac{\alpha_{N}}{\alpha_{D}}}+\frac{D_{c}}{D}\right]^{\alpha_{D}}Implementation detail
Illustrative Calculation
Let us compute the loss for a specific set of parameters:
- ,
- ,
- Ratio of exponents:
We evaluate at and :
-
Parameter term ratio:
-
Exponentiated parameter term:
-
Dataset term:
-
Sum of terms:
-
Final Loss:
Sources
S1.E5
L(N,D)=[(NcN)αNαD+DcD]αD𝐿𝑁𝐷superscriptdelimited-[]superscriptsubscript𝑁𝑐𝑁subscript𝛼𝑁subscript𝛼𝐷subscript𝐷𝑐𝐷subscript𝛼𝐷L(N,D)=\left[\left(\frac{N_{c}}{N}\right)^{\frac{\alpha_{N}}{\alpha_{D}}}+\frac{D_{c}}{D}\right]^{\alpha_{D}} (1.5)
L(N,D)=\left[\left(\frac{N_{c}}{N}\right)^{\frac{\alpha_{N}}{\alpha_{D}}}+\frac{D_{c}}{D}\right]^{\alpha_{D}}- Cross-entropy loss · scalar
- Number of non-embedding model parameters · scalar
- Dataset size in tokens · scalar
- Critical parameter scale constant · scalar
- Critical dataset scale constant · scalar
- Power-law scaling exponent for model size · scalar
- Power-law scaling exponent for dataset size · scalar