Papers · Architectures and attention · 2021
RoFormer: Enhanced Transformer with Rotary Position Embedding
The notation of the RoPE paper, explained: its 38 displayed equations, then every symbol it uses, grouped by category and shown the way the paper writes it.
Read from arXiv's HTML version: 38 displayed equations and 108 pieces of inline math. 39 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)Decode →
- (2)Decode →
- (3)Decode →
- (4)Decode →
- (5)Decode →
- (6)Decode →
- (7)Decode →
- (8)Decode →
- (9)Decode →
- (10)Decode →
- (11)Decode →
- (12)Decode →
- (13)Decode →
- (14)Decode →
- (15)Decode →
- (16)Decode →
- (17)Decode →
- (18)Decode →
- (19)Decode →
- (20)Decode →
- (21)Decode →
- (22)Decode →
- (23)Decode →
- (24)Decode →
- (25)Decode →
- (26a)Decode →
- (26b)Decode →
- (27)Decode →
- (28)Decode →
- (29)Decode →
- (30)Decode →
- (31)Decode →
- (32)Decode →
- (33)Decode →
- (34)Decode →
- (35)Decode →
- (36)Decode →
- (37)Decode →
Famous equations in this paper
Symbols, by category
Most used first. The examples are written as the paper writes them.
Notation conventions
- , ,
Subscript (index or label) 503 uses
A subscript picks an element (xᵢ), a time step (h_t), a named copy (W_q), or the parameters (p_θ).
- , ,
Italic letters (variables) 351 uses
A plain italic letter is a variable; conventions say what kind (x input, y target, W weights…).
- , ,
Superscript (power or label) 36 uses
Usually a power (x² = x·x), but a capital or a word up there is often just a label (W^Q).
- ,
Tilde accent 13 uses
A modified version of the variable: noisy, corrupted, proposed or intermediate.
- , ,
Superscript in parentheses 8 uses
An index in a superscript: x⁽ⁱ⁾ is the i-th training example, W⁽ˡ⁾ the weights of layer l. Not a power.
- ,
Dots (ellipsis) 7 uses
“And so on”: continue the pattern.
- ,
Star (optimal) 6 uses
As a superscript, the optimal value: θ* is the best θ. Between two terms, convolution.
Greek letters
- ,
Theta 103 uses
The model’s parameters: all of its weights and biases, as one collection.
- ,
Phi 20 uses
The parameters of a second model (often the encoder q_φ), or a feature map φ(x).
Gamma 7 uses
The discount factor in reinforcement learning, or the learned scale in normalization layers.
Beta 2 uses
Usually a decay rate (Adam’s β₁, β₂), a shift parameter in normalization, or a weight on a loss term.
Vectors and matrices
- , ,
Bold lowercase (vector) 267 uses
A bold lowercase letter is a vector: a list of numbers.
- ,
Bold uppercase (matrix) 86 uses
A bold capital letter is a matrix (or a higher-order tensor).
- , ,
Transpose 48 uses
Swap rows and columns. xᵀy is a dot product; xyᵀ is an outer product.
- ,
Norm 12 uses
The length (size) of a vector. With subscript 2 or none, the Euclidean length √(Σxᵢ²).
- , ,
Q, K, V (query, key, value) 9 uses
In attention: queries Q, keys K and values V, each a matrix with one row per token.
- , ,
Absolute value (bars) 7 uses
Absolute value of a number; for a set, its size; for a matrix, sometimes its determinant.
- , ,
Centre dot 6 uses
A dot product between vectors, plain multiplication between numbers, or an empty slot f(·).
Inner product (angle brackets) 2 uses
The inner (dot) product of two vectors: multiply matching entries and add.
Tensor / Kronecker product 2 uses
An outer, Kronecker or tensor product: every entry of one times every entry of the other.
Probability and statistics
Probability p(x) 106 uses
A probability or probability density; p is usually the true or model distribution, q an approximation.
- , ,
Exponential 24 uses
The exponential function eˣ, with e ≈ 2.718. Always positive.
Expectation 1 use
The expected value: the average of what is inside, weighted by the probabilities in the subscript.
Functions and operators
- , ,
Summation 18 uses
Add up the expression for every value of the index, from the bottom limit to the top.
Sine 15 uses
The sine function; in ML papers mostly inside positional encodings and rotary embeddings.
Cosine 15 uses
The cosine function; in ML papers usually cosine similarity, a cosine schedule, or positional encodings.
Arrow (maps to) 11 uses
Maps to (f: X → Y), tends to (x → 0), or implies (⇒).
Fraction 7 uses
Division: the top divided by the bottom.
Square root 3 uses
The square root. In attention, dividing by √d_k keeps dot products at a sensible scale.
- , ,
Max and min 3 uses
The largest (or smallest) value, over the arguments or over the range in the subscript.
Cases (piecewise) 1 use
A piecewise definition: the value on each line applies when that line’s condition holds.
Clip 1 use
Limit a value to a range: clip(x, a, b) is a if x < a, b if x > b, else x.
Softmax 1 use
Turns a vector of scores into probabilities: exponentiate each, then divide by the total.
Sets, shapes and definitions
- , ,
Set braces 22 uses
A set: a collection of items. {x | condition} is every x that satisfies the condition.
Element of 11 uses
“Is in” or “belongs to”: x ∈ S says x is a member of the set S.
Defined as (:=) 6 uses
“Is defined as”: introduces a new name for the expression on the other side.
Tensor shapes 5 uses
ℝ with a superscript of sizes joined by × declares an array’s shape: ℝ^{B×T×d} is a 3-axis tensor.
Inequalities 2 uses
Less than / greater than (or equal). ≪ means “much smaller than”.
Real numbers (ℝ) and shapes 2 uses
The real numbers. ℝⁿˣᵈ is the set of n × d arrays of reals: it states a shape.
5 things the catalog has no entry for yet
-
Re3 -
sim3 -
S2 -
O1 -
elu1
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 architectures and attention papers
- Attention Is All You Need (Transformer, 2017)
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness (FlashAttention, 2022)
- Mamba: Linear-Time Sequence Modeling with Selective State Spaces (Mamba, 2023)
- Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layer (Mixture of experts, 2017)
- Neural Machine Translation by Jointly Learning to Align and Translate (Bahdanau attention, 2014)
- An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale (ViT, 2020)