Papers · Architectures and attention · 2023
Mamba: Linear-Time Sequence Modeling with Selective State Spaces
The notation of the Mamba paper, explained: its 12 displayed equations, then every symbol it uses, grouped by category and shown the way the paper writes it.
Reading this paper
Mamba: a sequence model built on state-space models whose parameters depend on the input, giving a recurrent model that rivals Transformers on language.
The bars do not mean averages: and are the discretized versions of the continuous parameters and , computed with the step size (for example ). is the hidden state, the input and the output. "Selective" means , and are computed from rather than fixed.
Read from arXiv's HTML version: 12 displayed equations and 264 pieces of inline math. 36 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) 296 uses
A plain italic letter is a variable; conventions say what kind (x input, y target, W weights…).
- , ,
Superscript (power or label) 95 uses
Usually a power (x² = x·x), but a capital or a word up there is often just a label (W^Q).
- , ,
Subscript (index or label) 81 uses
A subscript picks an element (xᵢ), a time step (h_t), a named copy (W_q), or the parameters (p_θ).
- , ,
Bar (mean) 47 uses
A bar usually marks an average: x̄ is the mean of the x values.
Dots (ellipsis) 2 uses
“And so on”: continue the pattern.
Star (optimal) 1 use
As a superscript, the optimal value: θ* is the best θ. Between two terms, convolution.
Greek letters
Delta (capital) 75 uses
A change or update: ΔW is the change to the weights W.
Tau 9 uses
A temperature that sharpens or flattens a softmax; in RL, a trajectory.
Sigma (lowercase) 8 uses
Either the sigmoid function σ(z) = 1/(1+e⁻ᶻ) or a standard deviation. The context decides.
Beta 5 uses
Usually a decay rate (Adam’s β₁, β₂), a shift parameter in normalization, or a weight on a loss term.
Vectors and matrices
- , ,
Bold uppercase (matrix) 153 uses
A bold capital letter is a matrix (or a higher-order tensor).
Times (cross) 44 uses
Usually the “by” in a shape (n × d); also plain multiplication or a cross product.
Q, K, V (query, key, value) 11 uses
In attention: queries Q, keys K and values V, each a matrix with one row per token.
- ,
Inverse 3 uses
The matrix inverse, A⁻¹A = I; for a function, its inverse function; for a number, 1/x.
Identity matrix 3 uses
The matrix with 1s on the diagonal and 0s elsewhere; multiplying by it changes nothing.
Centre dot 3 uses
A dot product between vectors, plain multiplication between numbers, or an empty slot f(·).
Calculus and gradients
Infinity 2 uses
Infinity; as a norm subscript, ‖x‖_∞ is the largest absolute entry.
Prime 1 use
Either a derivative, f′(x), or simply "another one": x′ is a second sample, s′ the next state.
Probability and statistics
Exponential 10 uses
The exponential function eˣ, with e ≈ 2.718. Always positive.
Logarithm 3 uses
A logarithm, almost always the natural log (base e) in ML papers.
Probability p(x) 2 uses
A probability or probability density; p is usually the true or model distribution, q an approximation.
Uniform distribution 1 use
𝒰(a, b) is the uniform distribution: every value between a and b is equally likely.
Distributed as (tilde) 1 use
“Is drawn from” or “is distributed as”: x ~ p means x is a sample from the distribution p.
Normal distribution 1 use
The normal (Gaussian) distribution with the given mean and variance.
Functions and operators
- , ,
Arrow (maps to) 23 uses
Maps to (f: X → Y), tends to (x → 0), or implies (⇒).
Assignment arrow 12 uses
Assignment in an algorithm: replace the variable on the left with the value on the right.
Big-O notation 11 uses
How a cost grows with size, ignoring constants: O(n²) means at most proportional to n² for large n.
Softplus 5 uses
log(1 + eˣ): a smooth ReLU whose output is always positive.
- , ,
Fraction 3 uses
Division: the top divided by the bottom.
Composition (circle) 1 use
Function composition: (f ∘ g)(x) = f(g(x)). Some papers use it for elementwise products.
Sets, shapes and definitions
Approximately equal 18 uses
Approximately equal: often a Monte Carlo estimate or a Taylor approximation.
Element of 6 uses
“Is in” or “belongs to”: x ∈ S says x is a member of the set S.
- ,
Inequalities 4 uses
Less than / greater than (or equal). ≪ means “much smaller than”.
- , ,
Tensor shapes 4 uses
ℝ with a superscript of sizes joined by × declares an array’s shape: ℝ^{B×T×d} is a 3-axis tensor.
- ,
Set braces 4 uses
A set: a collection of items. {x | condition} is every x that satisfies the condition.
Real numbers (ℝ) and shapes 2 uses
The real numbers. ℝⁿˣᵈ is the set of n × d arrays of reals: it states a shape.
23 things the catalog has no entry for yet
-
Linear17 -
\uparrow11 -
Parameter8 -
\downarrow8 -
(B,L,D)7 -
(D,N)5 -
\triangleright4 -
SSM3 -
(B,L,D,N)3 -
Broadcast2 -
discretize2 -
(B,L,N)2 -
(D)1 -
B,L,D1 -
n\_layers1 -
d\_model1 -
n\_heads1 -
d\_head1 -
conv1 -
batch\_size1 -
sequence\_length1 -
4e-51 -
1e-41
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)
- RoFormer: Enhanced Transformer with Rotary Position Embedding (RoPE, 2021)
- FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness (FlashAttention, 2022)
- 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)