Skip to content

Archive

Similarity

3 articles
Artificial Intelligence 23 Sep 2026 4 min read

L2 Normalization Turns Embedding Dot Products Into Cosine Similarity

Two embedding vectors can point in nearly the same direction yet have very different magnitudes. A raw dot product responds to both properties. L2 normalization removes the magnitude term, so the same dot-product operation becomes a comparison of direction. That change is not merely a numerical convenience. It changes the retrieval objective whenever vector norms carry information or vary across items. Dot product contains a magnitude term For nonzero vectors (x) and (y),

Artificial Intelligence 22 Sep 2026 6 min read

Cosine Similarity Discards Embedding Magnitude

Two embedding vectors can point in the same direction while having very different norms. Cosine similarity gives those vectors the same directional score. A raw dot product does not. That distinction becomes an implementation boundary when a retrieval system changes index metrics, normalizes vectors at ingestion, or mixes embeddings produced by different pipelines. The issue is not that one metric is universally preferable. The relevant question is whether vector magnitude carries information that the scoring contract intends to preserve. Once vectors are normalized to unit length, that information is removed from the similarity calculation.

Artificial Intelligence 05 Sep 2026 9 min read

Normalize Embeddings Before Dot-Product Similarity

Embedding systems often compare vectors with cosine similarity or a dot product. The formulas look similar enough that it is easy to treat the two metrics as interchangeable. They are not interchangeable for arbitrary vectors. A dot product depends on both the angle between two vectors and their magnitudes. Cosine similarity removes magnitude and compares direction only. That difference can change nearest-neighbor rankings, retrieval results, and similarity thresholds. This article builds a practical mental model for deciding whether to normalize embeddings. You will see why L2 normalization makes dot product equivalent to cosine similarity, how inconsistent normalization breaks comparisons, and when preserving vector magnitude may be intentional.