Papers · Scaling laws · 2022

Training Compute-Optimal Large Language Models

Jordan Hoffmann, Sebastian Borgeaud, Arthur Mensch and others

The notation of the Chinchilla paper, explained: its 11 displayed equations, then every symbol it uses, grouped by category and shown the way the paper writes it.

Read the paper on arXiv

Reading this paper

Chinchilla: for a fixed compute budget, model size and training data should grow together, so most large models of the time were too big for the data they saw.

NN is the number of parameters, DD the number of training tokens, and C≈6NDC \approx 6ND the training compute in FLOPs. The fitted loss is L(N,D)=E+A/Nα+B/DβL(N, D) = E + A/N^\alpha + B/D^\beta: EE is the loss no model can beat, and the other two terms shrink as the model and the data grow. Nopt(C)N_{\text{opt}}(C) and Dopt(C)D_{\text{opt}}(C) are the best choices for a budget CC.

Read from arXiv's HTML version: 11 displayed equations and 130 pieces of inline math. 34 symbols and constructs from the catalog.

The paper's displayed equations

Open any of them in the decoder for a symbol-by-symbol reading.

  1. (1)
    Nopt(C),Dopt(C)=arg min⁡N,D s.t. FLOPs(N,D)=CL(N,D).N_{opt}(C),D_{opt}(C)=\argmin_{N,D\text{ s.t. }\text{FLOPs}(N,D)=C}L(N,D).
    Decode →
  2. (2)
    L^(N,D)≜E+ANα+BDβ.\hat{L}(N,D)\triangleq E+\frac{A}{N^{\alpha}}+\frac{B}{D^{\beta}}.
    Decode →
  3. (3)
    min⁡A,B,E,α,β∑Runs iHuberδ(log⁡L^(Ni,Di)−log⁡Li)\min_{A,B,E,\alpha,\beta} \sum_{\text{Runs }i}\text{Huber}_{\delta}\Big(\log\hat{L}(N_{i},D_{i})-\log L_{i}\Big)
    Decode →
  4. (4)
    Nopt(C)=G(C6)a,Dopt(C)=G−1(C6)b, where G=(αAβB)1α+β,a=βα+β, and b=αα+β.N_{opt}(C)=G{\left(\frac{C}{6}\right)}^{a}, D_{opt}(C)=G^{-1}{\left(\frac{C}{6}\right)}^{b}, \text{ where } G={\left(\frac{\alpha A}{\beta B}\right)}^{\frac{1}{\alpha+\beta}}, a=\frac{\beta}{\alpha+\beta},\text{ and }b=\frac{\alpha}{\alpha+\beta}.
    Decode →
  5. (5)
    L^(N,D)≜E+ANα+BDβ,\hat{L}(N,D)\triangleq E+\frac{A}{N^{\alpha}}+\frac{B}{D^{\beta}},
    Decode →
  6. (6)
    L(f)≜E[log⁡f(x)y],and setf⋆≜arg min⁡f∈F(X,D(Y))L(f).L(f)\triangleq\mathbb{E}[\log f(x)_{y}], \text{and set} f^{\star}\triangleq\argmin_{f\in\mathcal{F}(\mathcal{X},\mathcal{D}(\mathcal{Y}))}L(f).
    Decode →
  7. (7)
    fN≜arg min⁡f∈HNL(f).f_{N}\triangleq\argmin_{f\in\mathcal{H}_{N}}L(f).
    Decode →
  8. (8)
    L^D(f)≜E^D[log⁡f(x)y],settingf^N,D≜arg min⁡f∈HNL^D(f).\hat{L}_{D}(f)\triangleq\hat{\mathbb{E}}_{D}[\log f(x)_{y}], \text{setting} \hat{f}_{N,D}\triangleq\argmin_{f\in\mathcal{H}_{N}}\hat{L}_{D}(f).
    Decode →
  9. (9)
    L(N,D)≜L(fˉN,D)=L(f⋆)+(L(fN)−L(f⋆))+(L(fˉN,D)−L(fN)).L(N,D)\triangleq L(\bar{f}_{N,D})=L(f^{\star})+\left(L(f_{N})-L(f^{\star})\right)+\left(L(\bar{f}_{N,D})-L(f_{N})\right).
    Decode →
  10. (10)
    L(N,D)=E+AN0.34+BD0.28,L(N,D)=E+\frac{A}{N^{0.34}}+\frac{B}{D^{0.28}},
    Decode →
  11. (11)
    min⁡a,b,e,α,β∑Run iHuberδ(LSE(a−αlog⁡Ni,b−βlog⁡Di,e)−log⁡Li),\min_{a,b,e,\alpha,\beta}\sum_{\text{Run }i}\text{Huber}_{\delta}\Big(\text{LSE}\big(a-\alpha\log N_{i},b-\beta\log D_{i},e\big)-\log L_{i}\Big),
    Decode →

Symbols, by category

Most used first. The examples are written as the paper writes them.

Notation conventions

  1. NN, CC, DD

    Italic letters (variables) 241 uses

    A plain italic letter is a variable; conventions say what kind (x input, y target, W weights…).

  2. NoptN_{opt}, DoptD_{opt}, Huberδ\text{Huber}_{\delta}

    Subscript (index or label) 62 uses

    A subscript picks an element (xᵢ), a time step (h_t), a named copy (W_q), or the parameters (p_θ).

  3. NαN^{\alpha}, DβD^{\beta}, (C6)a{\left(\frac{C}{6}\right)}^{a}

    Superscript (power or label) 47 uses

    Usually a power (x² = x·x), but a capital or a word up there is often just a label (W^Q).

  4. F\mathcal{F}, X\mathcal{X}, Y\mathcal{Y}

    Calligraphic letters 17 uses

    A script capital usually names a set, a space, a distribution or a loss.

  5. L^\hat{L}, E^\hat{\mathbb{E}}, f^\hat{f}

    Hat (estimate) 15 uses

    A hat marks an estimate or prediction: ŷ is the model’s guess for y.

  6. …\ldots, …\dots

    Dots (ellipsis) 8 uses

    “And so on”: continue the pattern.

  7. f⋆f^{\star}

    Star (optimal) 5 uses

    As a superscript, the optimal value: θ* is the best θ. Between two terms, convolution.

  8. D\mathcal{D}

    Dataset (𝒟) 4 uses

    The dataset: usually N input-label pairs.

  9. fˉ\bar{f}

    Bar (mean) 4 uses

    A bar usually marks an average: x̄ is the mean of the x values.

Greek letters

  1. α\alpha

    Alpha 12 uses

    Often a learning rate or step size; also attention weights αᵢⱼ or a mixing weight.

  2. β\beta

    Beta 12 uses

    Usually a decay rate (Adam’s β₁, β₂), a shift parameter in normalization, or a weight on a loss term.

  3. δ\delta

    Delta (lowercase) 6 uses

    A small change, or the error signal δ = ∂L/∂z in backpropagation.

Vectors and matrices

  1. ×\times

    Times (cross) 62 uses

    Usually the “by” in a shape (n × d); also plain multiplication or a cross product.

  2. G−1G^{-1}

    Inverse 1 use

    The matrix inverse, A⁻¹A = I; for a function, its inverse function; for a number, 1/x.

  3. ∥L−L^(N,D)∥22{\|L-\hat{L}(N,D)\|}_{2}^{2}

    Norm 1 use

    The length (size) of a vector. With subscript 2 or none, the Euclidean length √(Σxᵢ²).

Calculus and gradients

  1. D′D^{\prime}

    Prime 2 uses

    Either a derivative, f′(x), or simply "another one": x′ is a second sample, s′ the next state.

  2. d\textrm{d}

    Derivative (d/dx) 1 use

    An ordinary derivative: the rate of change of one quantity with respect to one variable.

Probability and statistics

  1. pp, PP

    Probability p(x) 29 uses

    A probability or probability density; p is usually the true or model distribution, q an approximation.

  2. ∝\propto

    Proportional to 12 uses

    Equal up to a constant factor that does not depend on the variable of interest.

  3. log⁡\log

    Logarithm 8 uses

    A logarithm, almost always the natural log (base e) in ML papers.

  4. E\mathbb{E}, EP\mathbb{E}_{P}

    Expectation 4 uses

    The expected value: the average of what is inside, weighted by the probabilities in the subscript.

  5. exp⁡\exp

    Exponential 3 uses

    The exponential function eˣ, with e ≈ 2.718. Always positive.

  6. ∼\sim

    Distributed as (tilde) 1 use

    “Is drawn from” or “is distributed as”: x ~ p means x is a sample from the distribution p.

Functions and operators

  1. ANα\frac{A}{N^{\alpha}}, BDβ\frac{B}{D^{\beta}}, C6\frac{C}{6}

    Fraction 15 uses

    Division: the top divided by the bottom.

  2. →\to, →\rightarrow, ::

    Arrow (maps to) 6 uses

    Maps to (f: X → Y), tends to (x → 0), or implies (⇒).

  3. arg min⁡N,D s.t. FLOPs(N,D)=C\argmin_{N,D\text{ s.t. }\text{FLOPs}(N,D)=C}, arg min⁡f∈HN\argmin_{f\in\mathcal{H}_{N}}

    Argmin 4 uses

    The input that makes the function smallest: θ* = argmin L(θ) is the best parameter setting.

  4. min⁡A,B,E,α,β\min_{A,B,E,\alpha,\beta}, min⁡a,b,e,α,β\min_{a,b,e,\alpha,\beta}, max⁡\max

    Max and min 3 uses

    The largest (or smallest) value, over the arguments or over the range in the subscript.

  5. ∑Runs i\sum_{\text{Runs }i}, ∑Run i\sum_{\text{Run }i}

    Summation 2 uses

    Add up the expression for every value of the index, from the bottom limit to the top.

  6. LSE\text{LSE}, LSELSE

    Log-sum-exp 2 uses

    log Σ exp(zᵢ): a smooth maximum, and the normalizer of a softmax in log space.

Sets, shapes and definitions

  1. ∈\in

    Element of 12 uses

    “Is in” or “belongs to”: x ∈ S says x is a member of the set S.

  2. ≜\triangleq

    Defined as (≜) 8 uses

    “Is defined as”: the same as :=. Introduces notation; it is not a claim to check.

  3. {0.,0.5,…,2.}\{0.,0.5,\dots,2.\}, {−1.,−.5,…,1.}\{-1.,-.5,\dots,1.\}, {0,5,…,25}\{0,5,\dots,25\}

    Set braces 5 uses

    A set: a collection of items. {x | condition} is every x that satisfies the condition.

  4. <<, ⩽\leqslant

    Inequalities 3 uses

    Less than / greater than (or equal). ≪ means “much smaller than”.

  5. ≈\approx

    Approximately equal 1 use

    Approximately equal: often a Monte Carlo estimate or a Taylor approximation.

Formulas from arXiv's HTML version of the paper, © their authors; the explanations are this site's. Title and authors as arXiv lists them.

More scaling laws papers