Euclidean Distance
Also called L2 Distance
Straight-line distance between two vectors — the everyday "how far apart" measure.
Think of it like
The as-the-crow-flies distance between two pins on a map.
Example
A clustering job groups embeddings by L2 distance, putting vectors that sit physically near each other in the same bucket.
How it actually works
Euclidean (L2) distance is the square root of summed squared differences — the ruler-distance in vector space. It cares about magnitude, unlike cosine which cares only about direction, so on un-normalized embeddings the two can rank results quite differently. Many indexes support it, and for normalized vectors it produces the same ordering as cosine.
For product teams
Another metric option; the point is to match it to how your embeddings were built.
For engineers
sqrt(Σ(aᵢ−bᵢ)²); magnitude-sensitive, order-equivalent to cosine only under normalization.
Related
- Vector Similarity — One choice of vector similarity.
- Cosine similarity — Contrasts with angle-based cosine.
Read anything AI without the jargon
Look up any term in plain English, or save terms as you read with the free Chrome extension.
Open DecoderAdd to Chrome