Jump to content

Chinchilla prescription: Difference between revisions

From Wikibase
Renumber equations for MathJax AMS labels: compute budget (1), first-order conditions (2)-(4), balance condition (5) (via update-page on MediaWiki MCP Server)
 
(5 intermediate revisions by one other user not shown)
Line 1: Line 1:
[[Category:Large language model]]
[[Category:Large language model]]
[[Category:Machine learning]]
The '''Chinchilla prescription''', derived by [[Source:Training Compute-Optimal Large Language Models (Conference paper)|name-author]],prescribes the compute-optimal division of a fixed training budget between model parameters and training tokens for a [[Transformer]].<ref>{{#cite:Q3164}}</ref>  
The '''Chinchilla prescription''' is the compute-optimal division of a fixed training budget between model parameters and training tokens for a Transformer [[large language model (LLM)|language model]], derived by Hoffmann et al. in 2022.<ref>{{#cite:Q3164}}</ref> Its headline result is that the 2 quantities should grow together: every doubling of parameter count should be matched by a doubling of training tokens.


== Compute budget ==


'''Solution via Lagrange multiplier:'''
Training compute is dominated by the matrix multiplications of the forward and backward passes and is approximated by


'''Target'''
$$
C \approx 6\,|\theta|\,D \label{compute budget}
$$
 
<div class="center">
{| class="wikitable"
|-
| $C$
| Training compute in floating-point operations
|-
| $ |\theta|$
| Parameter count
|-
| $D$
| Number of training tokens
|-
| $ |\theta|D$
| Forward-pass compute cost
|-
| $ |\theta|D$
| Backward-pass compute cost
|}
</div>
 
== Compute-optimal allocation ==
 
=== Loss function ===
 
[[Source:Training Compute-Optimal Large Language Models (Conference paper)|name-author]] proposes modelling [[language model loss|loss]] as a function of $\theta,D$, with an irreducible floor $L_\infty$ and parameters $|\theta|_c$, $D_c$, $\alpha_\theta$, $\alpha_D$ to be determined empirically:
 
$$
L(|\theta|,D)
=
L_\infty
+
\left(\frac{|\theta|_c}{|\theta|}\right)^{\alpha_\theta}
+
\left(\frac{D_c}{D}\right)^{\alpha_D},
$$
 
=== Algebraic optimum ===
Subject to $C = 6|\theta|D$, at optimum $L_\text{min}$
 
$$
\begin{cases}
|\theta|_{\text{opt}} \propto C^{\alpha_D/(\alpha_\theta+\alpha_D)} \\
D_{\text{opt}} \propto C^{\alpha_\theta/(\alpha_\theta+\alpha_D)}
\end{cases}
$$
 
{{Hidden proof}}
'''Solution via Lagrange multiplier'''
 
'''Target''':


Minimise
Minimise


$$
$$
L(|\theta|,D)=L_{\infty}+\left(\frac{|\theta|_{c}}{|\theta|}\right)^{\alpha_{\theta}}+\left(\frac{D_{c}}{D}\right)^{\alpha_D} \label{eq:loss}
L(|\theta|,D)=L_{\infty}+\left(\frac{|\theta|_{c}}{|\theta|}\right)^{\alpha_{\theta}}+\left(\frac{D_{c}}{D}\right)^{\alpha_D}  
$$
$$


Line 19: Line 72:
6|\theta|D-C=0.
6|\theta|D-C=0.
$$
$$
(from $\eqref{compute budget}$)


'''Lagrangian and first-order conditions'''
'''Lagrangian condition''':
 
From $\eqref{eq:loss}$


$$
$$
Line 33: Line 83:
$$
$$


Set all three partials to zero:
'''First-order conditions at optimum'''':


$$
$$
\begin{cases}
\begin{cases}
\frac{\partial\mathcal{L}}{\partial|\theta|}
\frac{\partial\mathcal{L}}{\partial|\theta|}\bigg|_{\theta_\text{opt},D_\text{opt}}
=
=
-\frac{\alpha_{\theta}}{|\theta|}\left(\frac{|\theta|_{c}}{|\theta|}\right)^{\alpha_{\theta}}
-\frac{\alpha_{\theta}}{\theta_\text{opt}}\left(\frac{|\theta|_{c}}{\theta_\text{opt}}\right)^{\alpha_{\theta}}
+\lambda\,6D
+\lambda\,6D_\text{opt}
=0, & \text{(1)}\\
=0, & \text{(2)}\\
\frac{\partial\mathcal{L}}{\partial D}
\frac{\partial\mathcal{L}}{\partial D}\bigg|_{\theta_\text{opt},D_\text{opt}}
=
=
-\frac{\alpha_D}{D}\left(\frac{D_{c}}{D}\right)^{\alpha_D}
-\frac{\alpha_D}{D_\text{opt}}\left(\frac{D_{c}}{D_\text{opt}}\right)^{\alpha_D}
+\lambda\,6|\theta|
+\lambda\,6\theta_\text{opt}
=0, & \text{(2)}\\
=0, & \text{(3)}\\
\frac{\partial\mathcal{L}}{\partial\lambda}
\frac{\partial\mathcal{L}}{\partial\lambda}\bigg|_{\theta_\text{opt},D_\text{opt}}
=
=
6|\theta|D-C=0. & \text{(3)}
6\theta_\text{opt}D_\text{opt}-C=0. & \text{(4)}
\end{cases}
\end{cases}
$$
$$


Equation (3) just restates the constraint. Equations (1)–(2) are the substantive conditions.
<blockquote>
Equation (4) just restates the constraint. Equations (2)–(3) are the substantive conditions.
</blockquote>


'''Eliminating $\lambda$'''
'''Eliminating $\lambda$''':


From (1):
From (2):


$$
$$
\lambda=\frac{\alpha_{\theta}}{6|\theta|D}\left(\frac{|\theta|_{c}}{|\theta|}\right)^{\alpha_{\theta}}.
\lambda=\frac{\alpha_{\theta}}{6\theta_\text{opt}D_\text{opt}}\left(\frac{|\theta|_{c}}{\theta_\text{opt}}\right)^{\alpha_{\theta}}.
$$
$$


From (2):
From (3):


$$
$$
\lambda=\frac{\alpha_D}{6|\theta|D}\left(\frac{D_{c}}{D}\right)^{\alpha_D}.
\lambda=\frac{\alpha_D}{6\theta_\text{opt}D_\text{opt}}\left(\frac{D_{c}}{D_\text{opt}}\right)^{\alpha_D}.
$$
$$


Line 72: Line 124:


$$
$$
\alpha_{\theta}\left(\frac{|\theta|_{c}}{|\theta|}\right)^{\alpha_{\theta}}
\alpha_{\theta}\left(\frac{|\theta|_{c}}{\theta_\text{opt}}\right)^{\alpha_{\theta}}
=
=
\alpha_D\left(\frac{D_{c}}{D}\right)^{\alpha_D}
\alpha_D\left(\frac{D_{c}}{D_\text{opt}}\right)^{\alpha_D}
\tag{4}
\tag{5}
$$
$$


This is the '''balance condition'''. It is one equation in two unknowns; together with \(6|\theta|D=C\) it pins down \((\theta_{\text{opt}},D_{\text{opt}})\).
'''Solving for the scaling exponents''':


'''Solving for the scaling exponents'''
Rearrange the terms in (5):
 
The balance condition is
 
$$
\alpha_\theta\left(\frac{|\theta|_c}{\theta_\text{opt}}\right)^{\alpha_\theta}
=
\alpha_D\left(\frac{D_c}{D_\text{opt}}\right)^{\alpha_D}.
$$
 
Divide both sides by $\alpha_D$ and rearrange:


$$
$$
Line 99: Line 141:
$$
$$


Raise both sides to $1/\alpha_D$:
Raise both sides to the $\frac{1}{\alpha_D}$th power:


$$
$$
Line 124: Line 166:
$$
$$


Substitute into \(C=6\theta_\text{opt}D_\text{opt}\):
Substitute into $C=6\theta_\text{opt}D_\text{opt}$:


$$
$$
C\propto\theta_\text{opt}^{\,1+\alpha_\theta/\alpha_D}
C\propto\theta_\text{opt}^{\,1+(\alpha_\theta/\alpha_D)}
=\theta_\text{opt}^{\,(\alpha_\theta+\alpha_D)/\alpha_D}.
=\theta_\text{opt}^{\,(\alpha_\theta+\alpha_D)/\alpha_D}.
$$
$$
Line 134: Line 176:


$$
$$
\theta_\text{opt}\propto C^{\alpha_D/(\alpha_\theta+\alpha_D)},\,
\theta_\text{opt}\propto C^{\alpha_D/(\alpha_\theta+\alpha_D)}
$$
 
Similarly,
 
$$
D_\text{opt}\propto C^{\alpha_\theta/(\alpha_\theta+\alpha_D)}.
D_\text{opt}\propto C^{\alpha_\theta/(\alpha_\theta+\alpha_D)}.
$$
$$
{{End hidden}}


== Compute-optimal allocation ==
=== Empirical determination ===


The prescription follows from writing the [[language model loss|loss]] as a function of both quantities, with an irreducible floor $L_\infty$ and fitted constants $|\theta|_c$, $D_c$, $\alpha_\theta$, $\alpha_D$,
[[File:Compute-optimal LLM Model parameter-training token balance.png|thumbnail|As seen, $D_\text{opt} \approx 20\,|\theta|_\text{opt}$ around current LLM parameter counts ($10^{10} \to 10^{12}$).|350px]]
Empirically, it was determined at the '''efficient frontier''',


$$
$$
L(|\theta|,D)
\frac{\alpha_\theta}{\alpha_\theta+\alpha_D}=0.46,\, \frac{\alpha_\theta}{\alpha_\theta+\alpha_D}=0.54
=
L_\infty
+
\left(\frac{|\theta|_c}{|\theta|}\right)^{\alpha_\theta}
+
\left(\frac{D_c}{D}\right)^{\alpha_D},
$$
$$


and minimising it subject to $C = 6|\theta|D$. At the optimum the 2 reducible terms are reduced in balance, and the 2 quantities scale as
which suggests that '''parameter count and training data size should scale nearly proportionally'''.
 
It is further determined experimentally


$$
$$
\begin{cases}
D_\text{opt} \approx 20\,|\theta|_\text{opt},
|\theta|_{\text{opt}} \propto C^{\alpha_D/(\alpha_\theta+\alpha_D)} \\
D_{\text{opt}} \propto C^{\alpha_\theta/(\alpha_\theta+\alpha_D)}
\end{cases}
$$
$$


so the balance between parameters and data is set by the relative size of the 2 exponents. Because $\alpha_\theta$ and $\alpha_D$ are of similar magnitude, both allocation exponents come out near $1/2$, and in practice the prescription reduces to
<ref>{{#cite:Q3164}}</ref>
 
== History ==


$$
[[Source:Scaling Laws for Neural Language Models (Manuscript)|name-author]] had recommended spending most of an increased compute budget on parameters:
D \approx 20\,|\theta|,
$$


that is, about 20 training tokens per parameter.
* $|\theta|_{\text{opt}} \propto C^{0.73}$
* $D_{\text{opt}} \propto C^{0.27}$


== Contrast with earlier scaling laws ==
Models built to that advice were correspondingly large and undertrained.


Kaplan et al. had recommended spending most of an increased budget on parameters, with $|\theta|_{\text{opt}} \propto C^{0.73}$ and $D_{\text{opt}} \propto C^{0.27}$, and the models built to that advice were correspondingly large and undertrained.<ref>{{#cite:Q3141}}</ref> The Chinchilla result instead grows the 2 in step, which at a fixed compute budget means markedly more data and fewer parameters than the earlier advice implied.
<ref>{{#cite:Q3141}}</ref><ref>{{#cite:Q3164}}</ref>


== Worked examples ==
== Experimental evidence ==


{| class="wikitable"
{| class="wikitable"
Line 180: Line 223:
! $|\theta|$
! $|\theta|$
! $D$
! $D$
! $D/|\theta|$
! $\frac{D}{|\theta|}$
|-
|-
| Gopher
| Gopher
Line 198: Line 241:
|}
|}


Chinchilla was trained on the same compute budget as Gopher, with 4 times fewer parameters and about 5 times more data, and outperformed Gopher, GPT-3, and models several times its size.<ref>{{#cite:Q3164}}</ref> Applied to GPT-3's training budget of about $3.15\times10^{23}$ FLOPs, the prescription gives
Chinchilla was trained on the same compute budget as Gopher, with 4 times fewer parameters and about 5 times more data, and outperformed Gopher and GPT-3, both models several times its size.
 
$$
|\theta|_{\text{opt}} = \sqrt{\frac{C}{120}} \approx 5\times10^{10},
\qquad
D_{\text{opt}} \approx 1\times10^{12},
$$


against GPT-3's actual $1.75\times10^{11}$ parameters and $3\times10^{11}$ tokens.
<ref>{{#cite:Q3164}}</ref>


== Data-constrained regime and the data wall ==
== Data-constrained regime and the data wall ==


If the available token stock $D_{\max}$ falls short of $D_{\text{opt}}$, the prescription cannot be followed. With $D$ capped, the loss is better described by
If the available token stock $D_{\max}$ falls short of $D_{\text{opt}}$, the loss is better described by


$$
$$
Line 222: Line 259:
$$
$$


in which further gains must come from $|\theta|$, from [[algorithmic efficiency]], or from [[synthetic data]], rather than from additional human-written text. This regime is the [[data wall]].
in which case further model improvements must come from
 
* Increasing $|\theta|$
* Improve [[algorithmic efficiency]]
* Creation of [[synthetic data]]


Repeating the tokens already in hand is a partial substitute: up to roughly 4 epochs of repetition costs almost nothing in loss, but beyond that the marginal value of additional compute decays towards zero.<ref>{{#cite:Q3174}}</ref> Estimates of the stock of public human text place its exhaustion, if current trends continue, between 2026 and 2032.<ref>{{#cite:Q3181}}</ref>
This phenomenon is known as the '''[[data wall]]'''.

Latest revision as of 21:29, 11 November 2026

Languages: English · français · Esperanto

The Chinchilla prescription, derived by Hoffmann et al. (2022),prescribes the compute-optimal division of a fixed training budget between model parameters and training tokens for a Transformer.[1]

Compute budget

Training compute is dominated by the matrix multiplications of the forward and backward passes and is approximated by

$$\begin{gather} C \approx 6\,|\theta|\,D \label{compute budget} \end{gather}$$

$C$ Training compute in floating-point operations
$ |\theta|$ Parameter count
$D$ Number of training tokens
$ |\theta|D$ Forward-pass compute cost
$ |\theta|D$ Backward-pass compute cost

Compute-optimal allocation

Loss function

Hoffmann et al. (2022) proposes modelling loss as a function of $\theta,D$, with an irreducible floor $L_\infty$ and parameters $|\theta|_c$, $D_c$, $\alpha_\theta$, $\alpha_D$ to be determined empirically:

$$ L(|\theta|,D) = L_\infty + \left(\frac{|\theta|_c}{|\theta|}\right)^{\alpha_\theta} + \left(\frac{D_c}{D}\right)^{\alpha_D}, $$

Algebraic optimum

Subject to $C = 6|\theta|D$, at optimum $L_\text{min}$

$$ \begin{cases} |\theta|_{\text{opt}} \propto C^{\alpha_D/(\alpha_\theta+\alpha_D)} \\ D_{\text{opt}} \propto C^{\alpha_\theta/(\alpha_\theta+\alpha_D)} \end{cases} $$

Empirical determination

As seen, $D_\text{opt} \approx 20\,|\theta|_\text{opt}$ around current LLM parameter counts ($10^{10} \to 10^{12}$). · Open in a new tab

Empirically, it was determined at the efficient frontier,

$$ \frac{\alpha_\theta}{\alpha_\theta+\alpha_D}=0.46,\, \frac{\alpha_\theta}{\alpha_\theta+\alpha_D}=0.54 $$

which suggests that parameter count and training data size should scale nearly proportionally.

It is further determined experimentally

$$ D_\text{opt} \approx 20\,|\theta|_\text{opt}, $$

[1]

History

Kaplan et al. (2020) had recommended spending most of an increased compute budget on parameters:

  • $|\theta|_{\text{opt}} \propto C^{0.73}$
  • $D_{\text{opt}} \propto C^{0.27}$

Models built to that advice were correspondingly large and undertrained.

[2][1]

Experimental evidence

Allocation for 3 early large language models
Model $|\theta|$ $D$ $\frac{D}{|\theta|}$
Gopher $2.8\times10^{11}$ $3\times10^{11}$ $1.07$
GPT-3 $1.75\times10^{11}$ $3\times10^{11}$ $1.71$
Chinchilla $7\times10^{10}$ $1.4\times10^{12}$ $20$

Chinchilla was trained on the same compute budget as Gopher, with 4 times fewer parameters and about 5 times more data, and outperformed Gopher and GPT-3, both models several times its size.

[1]

Data-constrained regime and the data wall

If the available token stock $D_{\max}$ falls short of $D_{\text{opt}}$, the loss is better described by

$$ L_{\text{data}}(|\theta|, D_{\max}) = L_\infty + \left(\frac{|\theta|_c}{|\theta|}\right)^{\alpha_\theta} + \left(\frac{D_c}{D_{\max}}\right)^{\alpha_D}, $$

in which case further model improvements must come from

This phenomenon is known as the data wall.