Cosine similarity measures how closely two vectors point in the same direction. Normalize each vector to length 1, then take their dot product; this emphasizes direction while discarding magnitude. section 2.2.1
This makes cosine similarity useful for semantic retrieval. Word vectors can connect terms such as “car,” “automobile,” and “vehicle,” allowing a ranking system to see related documents even when query words do not overlap exactly. Unlike BM25, it can expose vocabulary matches that keyword scoring assigns zero relevance. section 2.1.3
Interpret cosine similarity by its geometric value, while treating scores as model-dependent evidence rather than guaranteed meaning:
- 1.0 indicates identical direction and usually represents near-duplicate text rather than synonymy. section 2.2.1
- 0.0 indicates right angles, meaning the embedding model detects no relationship. section 2.2.1
- Vector length no longer affects the score: documents pointing in the same direction score identically even when one vector is longer. section 2.2.1
- High similarity does not guarantee equivalent meaning; contextual embeddings can place antonyms such as “hot” and “cold” close together. section 2.2.1
Ranking “automobile maintenance”
For the query “automobile maintenance,” semantic scores rank a document about automobiles and cars first at 0.79, followed by vehicle maintenance at 0.75. A computer-crash document still scores 0.55, showing that averaged word vectors improve vocabulary coverage but lose word order, negation, and sentence structure. section 2.1.3
Figure 2.2 What cosine similarity measures and discards. Top left: the query and doc A sit at angle θ, and doc B, twice as long and pointing the same way, scores identically, because normalizing removes magnitude before the dot product. The other three panels draw the values listed above: identical direction scores 1.0, right angles score 0.0, and opposite directions score −1.0, which text embeddings almost never produce.

Use the geometry figure to see what normalization preserves—angular direction—and what it removes—vector magnitude—alongside the characteristic score values. section 2.2.1
























