A sentence embedding model maps text to a dense vector so semantically similar texts are close. Similarity can be measured by cosine (angle only), dot product (angle and magnitude) or Euclidean (L2) distance.
For unit-normalised vectors, all three produce the same ranking: dot product equals cosine, and squared L2 distance equals 2 − 2·cosine. Many systems normalise at insert time and use the fast inner product.
Use whatever the model card specifies. Mixing metrics silently degrades retrieval.
Going deeper
Matryoshka embeddings are trained so the first k dimensions are themselves a good embedding, letting you truncate 1024-d vectors to 256-d for a cheap first pass and re-score with full vectors.
Binary and int8 quantised embeddings cut storage 4–32× with a rescoring step to recover most of the accuracy.
Best resources for this lesson
Where this comes back
- Week 4The dot product and cosine similarity, at scale.