Key terms in two registers: a plain-language definition for language professionals and a technical one for IT/ML readers.
Loading glossary…
7 terms shown
A
Attention
The mechanism that lets a model look at all other words in the sentence when deciding how to interpret any one word — so 'bank' in 'river bank' can draw on 'river' for context.
ⓘ Technical definition
Computes a weighted sum of value vectors V, where the weights come from softmax-normalised query–key dot products: Attention(Q, K, V) = softmax(QKᵀ/√d_k)V.
A way to multiply two vectors that gives a single number: their lengths multiplied together and by the cosine of the angle between them, so it is largest when they point the same way, zero when they are at right angles and negative when they point apart. It is also what you get by multiplying each pair of matching components and adding them up. In machine learning it measures how alike two embeddings are: words with similar meanings tend to have high dot products.
ⓘ Technical definition
a · b = Σᵢ aᵢbᵢ = |a| |b| cos θ (magnitudes also written ‖a‖ ‖b‖), where θ is the angle between a and b; a · b = 0 exactly when a and b are perpendicular (or one is zero). In physics, the work of a force F over a displacement d is F · d; in attention, the score of how strongly a query matches a key.
In the attention mechanism, what each word is 'offering': a summary of its content that other words can compare against when deciding how much attention to pay to it.
ⓘ Technical definition
A linear projection K = X Wᴷ of the input sequence X. The dot product Q · Kᵀ / √d_k produces unnormalised attention scores between every query–key pair.
A single plain number with a size but no direction, like a temperature, a mass or −7, as opposed to a vector, which also has a direction. Multiplying a vector by a scalar stretches or shrinks it. In machine learning the temperature and the learning rate are scalars, beside the lists (vectors) and tables (matrices) of numbers.
ⓘ Technical definition
An element of ℝ, a rank-0 tensor. Scalar multiplication, written kv with the scalar beside the vector, scales every component of v by k, and its magnitude by |k|. Scalars arise as outputs of dot products, norms and loss functions.
The core calculation that produces an attention-weighted mix of all word vectors. Scaling prevents the dot products from becoming so large that the softmax saturates.
ⓘ Technical definition
Attention(Q, K, V) = softmax(Q Kᵀ / √d_k) V. Dividing by √d_k keeps the dot products in a stable range as d_k grows, preventing near-zero softmax gradients.
A quantity with a size and a direction, drawn as an arrow and written as its components, an ordered list of numbers: a walk of 3 km east and 4 km north is the vector (3, 4), an arrow 5 km long. In machine learning the same lists stand for words or sentences as points in a space, and words with similar meanings end up as nearby points.
ⓘ Technical definition
An element of ℝⁿ, written by its components (v₁, …, vₙ); geometrically an arrow with a magnitude and a direction, added tip to tail. Operations: addition (component-wise), scalar multiplication, dot product, L2-norm. In this app, token embeddings are d_model-dimensional vectors, rank-1 tensors.