Rosetta Stone · 21 of 30
Element of (set membership)
Notation: structural shorthand
In plain English
"Is a member of." reads "x is a list of d real numbers". It works like a type annotation: it tells you what kind of object a symbol is before you see any formula using it. means "is not a member of"; means "is a subset of".
As code
// x ∈ ℝ^768 ≈ a type declaration
/** @type {Float32Array} length 768 */
const x = new Float32Array(768);
new Set(['A', 'C', 'G', 'T']).has('G'); // 'G' ∈ {A, C, G, T}See it
What it means, field by field
Set membership; ℝ (reals), ℤ (integers), ℕ (naturals) are the common sets.
Shapes and types: W ∈ ℝ^{d×k} declares a d-by-k weight matrix; tokens ∈ vocabulary V.
Sequence alphabets: each base ∈ {A, C, G, T}; each residue ∈ the 20 amino acids.
State spaces: positions ∈ ℝ³, states ∈ a Hilbert space.
In a research paper
Queries and keys are n rows of d_k numbers each; values are n rows of d_v numbers.
Common misreadings
Confusing ∈ with ε (epsilon, a small quantity). They look alike in some fonts.
Skipping the ∈ declarations. They are often the quickest way to understand a paper’s equations.