Mathematics for ML

Cosine Similarity, explained

Cosine similarity measures how similar two vectors are by comparing their direction rather than their magnitude.
Back to Glossary

Part of the Semantic Notion technical glossary.

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.

Start here

Need the broader concept map?

Return to the glossary index to move from this definition into adjacent AI, ML, mathematics, and computer science terms.