Short Definition
Cosine similarity measures how similar two vectors are by comparing their direction rather than their magnitude.
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.