Zenaique
Glossary · RAG

Cosine Similarity

Also known as: Cosine distance

Compare two vectors by the cosine of their angle; the default similarity metric for embedding search.

A measure of similarity between two vectors equal to the cosine of the angle between them: dot product divided by the product of magnitudes. Normalized to [-1, 1]; the default distance metric for embedding retrieval.

In practice

Underlies almost all retrieval ranking. Interviews probe when dot product is better (already-normalized embeddings) and why Euclidean is rarer.

Related topics

Questions that mention this term

Related terms