Papers · Training · 2021
LoRA: Low-Rank Adaptation of Large Language Models
The notation of the LoRA paper, explained: its 6 displayed equations, then every symbol it uses, grouped by category and shown the way the paper writes it.
Reading this paper
LoRA: fine-tune a large model by learning a small low-rank change to each weight matrix, , and leaving the original weights frozen.
The shapes carry the idea: , and with , so has the shape of but far fewer parameters. stands for all of the model's parameters and for the small set LoRA trains; is the length of a target sequence, not an absolute value.
Read from arXiv's HTML version: 6 displayed equations and 184 pieces of inline math. 35 symbols and constructs from the catalog.
The paper's displayed equations
Open any of them in the decoder for a symbol-by-symbol reading.
Famous equations in this paper
Symbols, by category
Most used first. The examples are written as the paper writes them.
Notation conventions
- , ,
Italic letters (variables) 547 uses
A plain italic letter is a variable; conventions say what kind (x input, y target, W weights…).
- , ,
Subscript (index or label) 322 uses
A subscript picks an element (xᵢ), a time step (h_t), a named copy (W_q), or the parameters (p_θ).
- , ,
Superscript (power or label) 66 uses
Usually a power (x² = x·x), but a capital or a word up there is often just a label (W^Q).
Hat (estimate) 6 uses
A hat marks an estimate or prediction: ŷ is the model’s guess for y.
Calligraphic letters 3 uses
A script capital usually names a set, a space, a distribution or a loss.
Dots (ellipsis) 1 use
“And so on”: continue the pattern.
Greek letters
Delta (capital) 70 uses
A change or update: ΔW is the change to the weights W.
- ,
Phi 28 uses
The parameters of a second model (often the encoder q_φ), or a feature map φ(x).
Theta 13 uses
The model’s parameters: all of its weights and biases, as one collection.
Alpha 9 uses
Often a learning rate or step size; also attention weights αᵢⱼ or a mixing weight.
Sigma (lowercase) 5 uses
Either the sigmoid function σ(z) = 1/(1+e⁻ᶻ) or a standard deviation. The context decides.
Psi 2 uses
The parameters of a third network (after θ and φ), a feature map, or the digamma function ψ(x).
Vectors and matrices
Times (cross) 21 uses
Usually the “by” in a shape (n × d); also plain multiplication or a cross product.
- , ,
Transpose 17 uses
Swap rows and columns. xᵀy is a dot product; xyᵀ is an outer product.
- , ,
Absolute value (bars) 15 uses
Absolute value of a number; for a set, its size; for a matrix, sometimes its determinant.
- ,
Q, K, V (query, key, value) 14 uses
In attention: queries Q, keys K and values V, each a matrix with one row per token.
Dagger / pseudo-inverse 13 uses
The Moore–Penrose pseudo-inverse A⁺ (written A† in many ML papers); in physics, the conjugate transpose.
- , ,
Frobenius norm 6 uses
The size of a matrix: the square root of the sum of the squares of all its entries.
Centre dot 1 use
A dot product between vectors, plain multiplication between numbers, or an empty slot f(·).
Calculus and gradients
- ,
Prime 2 uses
Either a derivative, f′(x), or simply "another one": x′ is a second sample, s′ the next state.
Probability and statistics
- , ,
Probability p(x) 106 uses
A probability or probability density; p is usually the true or model distribution, q an approximation.
- ,
Entropy and cross-entropy 14 uses
H(p) is the entropy of a distribution: its average surprise. H(p, q) is the cross-entropy.
KL divergence 10 uses
How different distribution q is from p. Zero when they match; not symmetric.
Given (conditional bar) 4 uses
“Given”: p(y | x) is the probability of y given that x is known.
- ,
Logarithm 2 uses
A logarithm, almost always the natural log (base e) in ML papers.
Functions and operators
Plus or minus 140 uses
Both signs at once: a ± b means a + b and a − b. In results tables, a mean and its spread.
- , ,
Max and min 6 uses
The largest (or smallest) value, over the arguments or over the range in the subscript.
- , ,
Summation 6 uses
Add up the expression for every value of the index, from the bottom limit to the top.
- , ,
Fraction 6 uses
Division: the top divided by the bottom.
- ,
Square root 2 uses
The square root. In attention, dividing by √d_k keeps dot products at a sensible scale.
Sets, shapes and definitions
- , ,
Inequalities 11 uses
Less than / greater than (or equal). ≪ means “much smaller than”.
Element of 10 uses
“Is in” or “belongs to”: x ∈ S says x is a member of the set S.
- , ,
Set braces 9 uses
A set: a collection of items. {x | condition} is every x that satisfies the condition.
- , ,
Tensor shapes 6 uses
ℝ with a superscript of sizes joined by × declares an array’s shape: ℝ^{B×T×d} is a 3-axis tensor.
Approximately equal 4 uses
Approximately equal: often a Monte Carlo estimate or a Taylor approximation.
2 things the catalog has no entry for yet
-
\uparrow4 -
\downarrow2
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
- Layer Normalization (Layer norm, 2016)
- Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift (Batch norm, 2015)
- Root Mean Square Layer Normalization (RMSNorm, 2019)
- Decoupled Weight Decay Regularization (AdamW, 2017)