You are reading immutable version 2. The current guide may be newer.

Study the paper

Scaling Laws for Neural Language Models

Lessons, visuals, quizzes, flashcards, and resources—organized in teaching order.

All activities

Overfitting and Joint Scaling L(N, D)

Joint scaling law of loss with model and dataset size

Joint scaling law of loss with model and dataset size

Source equation

L(N,D)=[(NcN)αNαD+DcD]αDL(N,D)=\left[\left(\frac{N_{c}}{N}\right)^{\frac{\alpha_{N}}{\alpha_{D}}}+\frac{D_{c}}{D}\right]^{\alpha_{D}}

The joint scaling law L(N,D)L(N, D) models the cross-entropy loss of a language model as a function of both the number of non-embedding parameters NN and the dataset size DD (measured in tokens). This formulation captures how performance scales when both resources are finite, describing the transition into the overfitting regime.

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}}

L(N,D)=[(NcN)αNαD+DcD]αDL(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}}

This equation interpolates between two regimes:

  1. Data-unconstrained regime (DD \to \infty): The loss simplifies to the power law L(N)(Nc/N)αNL(N) \approx \left(N_c / N\right)^{\alpha_N}.
  2. Model-unconstrained regime (NN \to \infty): The loss simplifies to the power law L(D)(Dc/D)αDL(D) \approx \left(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}}
Implementation detail

Illustrative Calculation

Let us compute L(N,D)L(N, D) given the following parameters:

  • Nc=108N_c = 10^8, Dc=109D_c = 10^9
  • αN=0.08\alpha_N = 0.08, αD=0.10\alpha_D = 0.10
  • Model size N=108N = 10^8
  • Dataset size D=109D = 10^9

Step 1: Compute the exponent ratio αNαD=0.080.10=0.8\frac{\alpha_N}{\alpha_D} = \frac{0.08}{0.10} = 0.8

Step 2: Compute the model term (NcN)0.8=(108108)0.8=1.00.8=1.0\left(\frac{N_c}{N}\right)^{0.8} = \left(\frac{10^8}{10^8}\right)^{0.8} = 1.0^{0.8} = 1.0

Step 3: Compute the dataset term DcD=109109=1.0\frac{D_c}{D} = \frac{10^9}{10^9} = 1.0

Step 4: Sum the terms and apply the outer exponent L(N,D)=[1.0+1.0]0.10=20.101.0718L(N, D) = [1.0 + 1.0]^{0.10} = 2^{0.10} \approx 1.0718

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}}
L(N,D)L(N, D)
Cross-entropy loss · scalar
NN
Number of non-embedding model parameters · scalar
DD
Dataset size in tokens · scalar
NcN_c
Critical scale parameter for model size · scalar
DcD_c
Critical scale parameter for dataset size · scalar
αN\alpha_N
Power-law scaling exponent for model size · scalar
αD\alpha_D
Power-law scaling exponent for dataset size · scalar