Listen: Cosine Similarity

A measure of how alike two vectors are by the angle between them; for normalised vectors it's identical to a dot product.

Listen

Transcript

Cosine similarity is the standard way to measure how alike two concepts are in vector search. It looks at the angle between two vectors, scoring them from zero to one. But a look into Google Chrome's source code reveals a clever shortcut.

Instead of running the full, complex cosine formula, Google's system normalizes the vectors first, giving them all a length of one. When vectors are normalized this way, the cosine similarity simplifies mathematically to a plain dot product. The two methods yield the exact same ranking, but the dot product is much cheaper and faster to compute.

For search engine optimization and AI, this means the debate between using cosine similarity or dot product is often a non-issue. If your embeddings are normalized, they give you the same result. What really matters is that search systems are judging relevance by the direction of meaning in vector space, rather than just matching keywords. This simple mathematical relationship is what drives modern tools, including Chrome's history search, to understand the true intent behind our queries.