Papers · Training · 2017

Decoupled Weight Decay Regularization

Ilya Loshchilov, Frank Hutter

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

Read the paper on arXiv

Read from arXiv's HTML version: 15 displayed equations and 107 pieces of inline math. 41 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)
    θt+1=(1−λ)θt−α∇ft(θt),\bm{\theta}_{t+1}=(1-\lambda)\bm{\theta}_{t}-\alpha\nabla f_{t}(\bm{\theta}_{t}),
    Decode →
  2. (2)
    ftsreg(θ)=ft(θ)+λ′2α∥θ⊙s∥22,f_{t}^{\text{sreg}}(\bm{\theta})=f_{t}(\bm{\theta})+\frac{\lambda^{\prime}}{2\alpha}\left\lVert\bm{\theta}\odot{}\sqrt{\textit{{s}}}\right\rVert_{2}^{2},
    Decode →
  3. (3)
    μpost=μprior+Σpost×g,\bm{\mu}_{post}=\bm{\mu}_{prior}+\bm{\Sigma}_{post}\times\bm{g},
    Decode →
  4. (4)
    P(θt+1∣θt)=N((I−A)θt,Q),P(\bm{\theta}_{t+1}\mid\bm{\theta}_{t})=\mathcal{N}((\bm{I}-\bm{A})\bm{\theta}_{t},\bm{Q}),
    Decode →
  5. (5)
    θt+1←θt−α∇ftreg(θt)=θt−α∇ft(θt)−αλ′θt.\bm{\theta}_{t+1}\leftarrow\bm{\theta}_{t}-\alpha\nabla f_{t}^{\text{reg}}(\bm{\theta}_{t})=\bm{\theta}_{t}-\alpha\nabla f_{t}(\bm{\theta}_{t})-\alpha\lambda^{\prime}\bm{\theta}_{t}.
    Decode →
  6. (6)
    θt+1←(1−λ)θt−α∇ft(θt).\bm{\theta}_{t+1}\leftarrow(1-\lambda)\bm{\theta}_{t}-\alpha\nabla f_{t}(\bm{\theta}_{t}).
    Decode →
  7. (7)
    θt+1←θt−αλ′Mtθt−αMt∇ft(θt).\bm{\theta}_{t+1} \leftarrow \bm{\theta}_{t}-\alpha\lambda^{\prime}\mathbf{M}_{t}\bm{\theta}_{t}-\alpha\mathbf{M}_{t}\nabla f_{t}(\bm{\theta}_{t}).
    Decode →
  8. (8)
    θt+1←(1−λ)θt−αMt∇ft(θt).\bm{\theta}_{t+1} \leftarrow (1-\lambda)\bm{\theta}_{t}-\alpha\mathbf{M}_{t}\nabla f_{t}(\bm{\theta}_{t}).
    Decode →
  9. (9)
    θt+1←θt−α∇ftsreg(θt)/s\bm{\theta}_{t+1} \leftarrow \bm{\theta}_{t}-\alpha\nabla f_{t}^{\text{sreg}}(\bm{\theta}_{t})/\textit{{s}}
    Decode →
  10. (10)
    =θt−α∇ft(θt)/s−αλ′θt⊙s/s= \bm{\theta}_{t}-\alpha\nabla f_{t}(\bm{\theta}_{t})/\textit{{s}}-\alpha\lambda^{\prime}\bm{\theta}_{t}\odot\textit{{s}}/\textit{{s}}
    Decode →
  11. (11)
    =θt−α∇ft(θt)/s−αλ′θt,= \bm{\theta}_{t}-\alpha\nabla f_{t}(\bm{\theta}_{t})/\textit{{s}}-\alpha\lambda^{\prime}\bm{\theta}_{t},
    Decode →
  12. (12)
    θt+1←(1−λ)θt−α∇f(θt)/s\bm{\theta}_{t+1} \leftarrow (1-\lambda)\bm{\theta}_{t}-\alpha\nabla f(\bm{\theta}_{t})/\textit{{s}}
    Decode →

Famous equations in this paper

Symbols, by category

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

Notation conventions

  1. θt+1\bm{\theta}_{t+1}, θt\bm{\theta}_{t}, ftf_{t}

    Subscript (index or label) 243 uses

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

  2. ff, TT, tt

    Italic letters (variables) 175 uses

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

  3. ftsregf_{t}^{\text{sreg}}, ftregf_{t}^{\text{reg}}, IRn{\rm I R}^{n}

    Superscript (power or label) 14 uses

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

  4. ηmin(i)\eta^{(i)}_{min}, ηmax(i)\eta^{(i)}_{max}

    Superscript in parentheses 9 uses

    An index in a superscript: x⁽ⁱ⁾ is the i-th training example, W⁽ˡ⁾ the weights of layer l. Not a power.

  5. m^\hat{\textit{{m}}}, v^\hat{\textit{{{v}}}}, v^\hat{\textit{{v}}}

    Hat (estimate) 4 uses

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

  6. …\dots

    Dots (ellipsis) 1 use

    “And so on”: continue the pattern.

  7. ∗*

    Star (optimal) 1 use

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

Greek letters

  1. θ\theta

    Theta 112 uses

    The model’s parameters: all of its weights and biases, as one collection.

  2. λ\lambda

    Lambda 64 uses

    Usually the strength of a regularization term; also eigenvalues.

  3. α\alpha

    Alpha 39 uses

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

  4. η\eta

    Eta 28 uses

    The learning rate in most gradient-descent papers.

  5. β\beta

    Beta 12 uses

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

  6. μ\mu

    Mu 2 uses

    A mean: the average of a distribution, a batch, or a layer’s features.

  7. Σ\Sigma

    Sigma (capital) 2 uses

    A covariance matrix, or the diagonal matrix of singular values in an SVD. Not the summation sign.

  8. π\pi

    Pi 2 uses

    A policy π(a | s) in reinforcement learning, or the constant 3.14159…

  9. ϵ\epsilon

    Epsilon 2 uses

    A tiny constant for numerical safety (10⁻⁸ in Adam), or noise ε ~ 𝒩(0, I).

Vectors and matrices

  1. θ\bm{\theta}, μ\bm{\mu}, g\bm{g}

    Bold lowercase (vector) 115 uses

    A bold lowercase letter is a vector: a list of numbers.

  2. Σ\bm{\Sigma}, A\bm{A}, Q\bm{Q}

    Bold uppercase (matrix) 16 uses

    A bold capital letter is a matrix (or a higher-order tensor).

  3. ∥θ∥22\left\lVert\bm{\theta}\right\rVert_{2}^{2}

    Norm 7 uses

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

  4. ⊙\odot

    Hadamard (elementwise) product 4 uses

    Multiply two arrays of the same shape entry by entry.

  5. ×\times

    Times (cross) 4 uses

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

  6. I\bm{I}, I\mathbf{I}

    Identity matrix 4 uses

    The matrix with 1s on the diagonal and 0s elsewhere; multiplying by it changes nothing.

  7. QQ

    Q, K, V (query, key, value) 2 uses

    In attention: queries Q, keys K and values V, each a matrix with one row per token.

  8. diag\text{diag}

    Diag 1 use

    Build a diagonal matrix from a vector, or pull out the diagonal of a matrix.

  9. (s)−1(\textit{{s}})^{-1}

    Inverse 1 use

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

  10. ⋅\cdot

    Centre dot 1 use

    A dot product between vectors, plain multiplication between numbers, or an empty slot f(·).

Calculus and gradients

  1. λ′\lambda^{\prime}

    Prime 19 uses

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

  2. ∇\nabla

    Nabla (gradient) 18 uses

    The gradient: the vector of partial derivatives. ∇_θ L is how the loss changes with each parameter.

Probability and statistics

  1. pp, PP

    Probability p(x) 14 uses

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

  2. ∣\mid

    Given (conditional bar) 9 uses

    “Given”: p(y | x) is the probability of y given that x is known.

  3. N\mathcal{N}

    Normal distribution 1 use

    The normal (Gaussian) distribution with the given mean and variance.

Functions and operators

  1. ←\leftarrow

    Assignment arrow 28 uses

    Assignment in an algorithm: replace the variable on the left with the value on the right.

  2. λ′2α\frac{\lambda^{\prime}}{2\alpha}, λ′2\frac{\lambda^{\prime}}{2}, λα\frac{\lambda}{\alpha}

    Fraction 12 uses

    Division: the top divided by the bottom.

  3. s\sqrt{\textit{{s}}}, v^t\sqrt{\hat{\textit{{v}}}_{t}}, ⋅\sqrt{\cdot}

    Square root 6 uses

    The square root. In attention, dividing by √d_k keeps dot products at a sensible scale.

  4. ::

    Arrow (maps to) 4 uses

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

  5. cos⁡\cos

    Cosine 2 uses

    The cosine function; in ML papers usually cosine similarity, a cosine schedule, or positional encodings.

Sets, shapes and definitions

  1. ∈\in

    Element of 11 uses

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

  2. ≠\neq

    Not equal 2 uses

    The two sides are different.

  3. R\mathbb{R}

    Real numbers (ℝ) and shapes 2 uses

    The real numbers. ℝⁿˣᵈ is the set of n × d arrays of reals: it states a shape.

  4. R+\mathbb{R}^{+}

    Tensor shapes 1 use

    ℝ with a superscript of sizes joined by × declares an array’s shape: ℝ^{B×T×d} is a 3-axis tensor.

  5. >>

    Inequalities 1 use

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

3 things the catalog has no entry for yet
  • \rm \rm 8
  • ▹\triangleright \triangleright 7
  • \hbox \hbox 1

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 training papers