Chinchilla prescription: Difference between revisions
No edit summary |
Renumber equations for MathJax AMS labels: compute budget (1), first-order conditions (2)-(4), balance condition (5) (via update-page on MediaWiki MCP Server) |
||
| (3 intermediate revisions by one other user not shown) | |||
| Line 31: | Line 31: | ||
== Compute-optimal allocation == | == 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: | [[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: | ||
| Line 44: | Line 46: | ||
$$ | $$ | ||
=== Algebraic optimum === | |||
Subject to $C = 6|\theta|D$, at optimum $L_\text{min}$ | Subject to $C = 6|\theta|D$, at optimum $L_\text{min}$ | ||
| Line 53: | Line 56: | ||
$$ | $$ | ||
{{Hidden proof}} | |||
'''Solution via Lagrange multiplier''' | |||
'''Target''': | |||
Minimise | |||
$$ | |||
L(|\theta|,D)=L_{\infty}+\left(\frac{|\theta|_{c}}{|\theta|}\right)^{\alpha_{\theta}}+\left(\frac{D_{c}}{D}\right)^{\alpha_D} | |||
$$ | |||
subject to | |||
$$ | |||
6|\theta|D-C=0. | |||
$$ | |||
'''Lagrangian condition''': | |||
$$ | |||
\mathcal{L}(|\theta|,D,\lambda) | |||
= | |||
L_{\infty}+\left(\frac{|\theta|_{c}}{|\theta|}\right)^{\alpha_{\theta}} | |||
+\left(\frac{D_{c}}{D}\right)^{\alpha_D} | |||
+\lambda\,(6|\theta|D-C). | |||
$$ | |||
'''First-order conditions at optimum'''': | |||
$$ | |||
\begin{cases} | |||
\frac{\partial\mathcal{L}}{\partial|\theta|}\bigg|_{\theta_\text{opt},D_\text{opt}} | |||
= | |||
-\frac{\alpha_{\theta}}{\theta_\text{opt}}\left(\frac{|\theta|_{c}}{\theta_\text{opt}}\right)^{\alpha_{\theta}} | |||
+\lambda\,6D_\text{opt} | |||
=0, & \text{(2)}\\ | |||
\frac{\partial\mathcal{L}}{\partial D}\bigg|_{\theta_\text{opt},D_\text{opt}} | |||
= | |||
-\frac{\alpha_D}{D_\text{opt}}\left(\frac{D_{c}}{D_\text{opt}}\right)^{\alpha_D} | |||
+\lambda\,6\theta_\text{opt} | |||
=0, & \text{(3)}\\ | |||
\frac{\partial\mathcal{L}}{\partial\lambda}\bigg|_{\theta_\text{opt},D_\text{opt}} | |||
= | |||
6\theta_\text{opt}D_\text{opt}-C=0. & \text{(4)} | |||
\end{cases} | |||
$$ | |||
<blockquote> | |||
Equation (4) just restates the constraint. Equations (2)–(3) are the substantive conditions. | |||
</blockquote> | |||
'''Eliminating $\lambda$''': | |||
From (2): | |||
$$ | |||
\lambda=\frac{\alpha_{\theta}}{6\theta_\text{opt}D_\text{opt}}\left(\frac{|\theta|_{c}}{\theta_\text{opt}}\right)^{\alpha_{\theta}}. | |||
$$ | |||
From (3): | |||
$$ | |||
\lambda=\frac{\alpha_D}{6\theta_\text{opt}D_\text{opt}}\left(\frac{D_{c}}{D_\text{opt}}\right)^{\alpha_D}. | |||
$$ | |||
Equate: | |||
$$ | |||
\alpha_{\theta}\left(\frac{|\theta|_{c}}{\theta_\text{opt}}\right)^{\alpha_{\theta}} | |||
= | |||
\alpha_D\left(\frac{D_{c}}{D_\text{opt}}\right)^{\alpha_D} | |||
\tag{5} | |||
$$ | |||
'''Solving for the scaling exponents''': | |||
Rearrange the terms in (5): | |||
$$ | |||
\left(\frac{D_c}{D_\text{opt}}\right)^{\alpha_D} | |||
= | |||
\frac{\alpha_\theta}{\alpha_D} | |||
\left(\frac{|\theta|_c}{\theta_\text{opt}}\right)^{\alpha_\theta}. | |||
$$ | |||
Raise both sides to the $\frac{1}{\alpha_D}$th power: | |||
$$ | |||
\frac{D_c}{D_\text{opt}} | |||
= | |||
\left(\frac{\alpha_\theta}{\alpha_D}\right)^{1/\alpha_D} | |||
\left(\frac{|\theta|_c}{\theta_\text{opt}}\right)^{\alpha_\theta/\alpha_D}. | |||
$$ | |||
Solve for $D_\text{opt}$: | |||
$$ | |||
D_\text{opt} | |||
= | |||
D_c | |||
\left(\frac{\alpha_D}{\alpha_\theta}\right)^{1/\alpha_D} | |||
\left(\frac{\theta_\text{opt}}{|\theta|_c}\right)^{\alpha_\theta/\alpha_D}. | |||
$$ | |||
Thus | |||
$$ | |||
D_\text{opt}\propto\theta_\text{opt}^{\alpha_\theta/\alpha_D}. | |||
$$ | |||
Substitute into $C=6\theta_\text{opt}D_\text{opt}$: | |||
$$ | |||
C\propto\theta_\text{opt}^{\,1+(\alpha_\theta/\alpha_D)} | |||
=\theta_\text{opt}^{\,(\alpha_\theta+\alpha_D)/\alpha_D}. | |||
$$ | |||
Invert: | |||
$$ | |||
\theta_\text{opt}\propto C^{\alpha_D/(\alpha_\theta+\alpha_D)} | |||
$$ | |||
Similarly, | |||
$$ | |||
D_\text{opt}\propto C^{\alpha_\theta/(\alpha_\theta+\alpha_D)}. | |||
$$ | |||
{{End hidden}} | |||
=== Empirical determination === | |||
[[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''', | Empirically, it was determined at the '''efficient frontier''', | ||
Latest revision as of 21:29, 11 November 2026
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

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}, $$
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.
Experimental evidence
| 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.
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
- Increasing $|\theta|$
- Improve algorithmic efficiency
- Creation of synthetic data
This phenomenon is known as the data wall.
- ↑ ↑ ↑ ↑ Hoffmann, J., Borgeaud, S., Mensch, A., Buchatskaya, E., Cai, T., Rutherford, E., de Las Casas, D., Hendricks, L. A., Welbl, J., Clark, A., Hennigan, T., Noland, E., Millican, K., van den Driessche, G., Damoc, B., Guy, A., Osindero, S., Simonyan, K., Elsen, E., … Sifre, L. (2022). Training Compute-Optimal Large Language Models. https://doi.org/10.48550/arXiv.2203.15556
- ↑ Kaplan, J., McCandlish, S., Henighan, T., Brown, T. B., Chess, B., Child, R., Gray, S., Radford, A., Wu, J., & Amodei, D. (2020). Scaling Laws for Neural Language Models. https://arxiv.org/abs/2001.08361