What Is Cosine Similarity?
Cosine similarity is the standard measure of how similar two embeddings are: the cosine of the angle between two vectors, yielding a score from -1 to 1 where higher means more alike in meaning. When an AI retrieval system ranks passages against a query, cosine similarity (or a close mathematical relative) is typically the number doing the ranking.
The intuition, no linear algebra required
Picture every text as an arrow pointing somewhere in a vast meaning-space. Two arrows pointing the same way — a query about "reducing SaaS churn" and a passage explaining churn-reduction tactics — have a small angle between them, so their cosine is high, near 1. Arrows pointing in unrelated directions score near 0. The measure cares only about direction, not arrow length, which conveniently makes a short question comparable with a long paragraph: what is compared is what they are about, not how much they say.
A concrete marketer's example
Suppose a user asks an assistant: "affordable email tool for a 5-person nonprofit." An embedding model turns that into a query vector. Your pricing page's passage "Our Starter plan is $9/month for teams under 10, with a 50% nonprofit discount" embeds to a vector at a small angle from the query — high cosine, likely retrieved. A competitor's generic "flexible plans for organizations of every size" embeds somewhere vaguer; the angle is wider, the score lower, the passage cut. The retrieval verdict was decided by geometry that your writing controlled.
Limits worth knowing
Cosine similarity measures semantic relatedness, not truth, quality, or authority — which is why production systems layer reranking and source-quality signals on top of the raw similarity ranking. It can also be fooled by topical closeness: a passage about the query's topic that fails to answer it can still score well, one reason engines increasingly use rerankers trained on answer relevance. For writers the takeaway stands regardless: specific, buyer-phrased, single-topic passages produce vectors that real queries land next to — the core geometry behind passage-level optimization.
Frequently asked questions
- What is a good cosine similarity score?
- Scale runs from -1 to 1, with 1 meaning identical direction in meaning-space. Interpretation depends on the embedding model, but as a rule of thumb in retrieval systems, matches above roughly 0.8 are strong, 0.6-0.8 moderately related, and below that increasingly incidental.
- Do I need to calculate cosine similarity to do GEO?
- No — but understanding it explains retrieval outcomes. When your page loses a citation to a competitor's, the mechanical reason is usually that their passage's vector sat closer to the query vector than yours did. The fix is writing passages that mean, specifically, what buyers ask.
Keep exploring
See how AI engines talk about your brand — track mentions across ChatGPT, Perplexity, Claude, Gemini and 5 more. Start with Menra