Intuition
Two embeddings can point in the same semantic direction even if one has a larger length.
Technical definition
Cosine similarity is the dot product of two vectors divided by the product of their Euclidean norms.
Example
Semantic search often ranks documents by cosine similarity between query and document embeddings.
Common misunderstandings
- Cosine similarity ignores vector length after normalization.
- High cosine similarity does not guarantee factual relevance.