Skip to content
Science, DecodedContext Jamming

Rosetta Stone · 27 of 30

a⋅b\mathbf{a}\cdot\mathbf{b}

Dot product (or multiplication)

Operator: it does something

In plain English

Between two numbers, ⋅\cdot is just multiplication. Between two vectors, it is the dot product: multiply matching entries and add them up. a⋅b=∑iaibi\mathbf{a}\cdot\mathbf{b} = \sum_i a_i b_i. Geometrically it is ∥a∥∥b∥cos⁡θ\|\mathbf{a}\|\|\mathbf{b}\|\cos\theta: large and positive when the vectors point the same way, zero when perpendicular, negative when opposed. Attention scores, similarity search and every neuron’s weighted input are dot products.

As code

const dot = (a, b) => a.reduce((acc, ai, i) => acc + ai * b[i], 0);
dot([1, 2, 3], [4, 5, 6]);   // 32 : a Σ in disguise

See it

a⋅b=∑iaibi\mathbf{a}\cdot\mathbf{b} = \sum_i a_i b_i. Positive when the vectors are aligned, zero when perpendicular, negative when they oppose.

What it means, field by field

Mathematics

Inner product; also written ⟨a, b⟩ or aᵀb.

Physics

Work W = F·d (only the force component along the motion counts).

AI / ML

Attention scores q·k; cosine similarity for embeddings; each neuron computes w·x + b.

Biology

Weighted sums in models of neuronal input. The biological neuron is far more complicated than this abstraction.

In a research paper

Cosine similarity between embeddings, used in retrieval-augmented generation and representation-similarity studies.
cos⁡θ=u⋅v∥u∥ ∥v∥\cos\theta = \frac{\mathbf{u}\cdot\mathbf{v}}{\|\mathbf{u}\|\,\|\mathbf{v}\|}

How aligned two embedding directions are, ignoring their lengths: 1 means identical direction, 0 unrelated.

Common misreadings

  • Assuming · always means dot product. Between scalars it is ordinary multiplication.

  • Treating a high dot product as "meaning similarity" without normalising. Long vectors give big dot products.

Connected symbols

Where it appears on this site