cosine similarity
Cosine similarity measures how aligned two vectors are by the cosine of the angle between them, scored from -1 to 1 (1 = same direction, 0 = unrelated). In AI search it compares a query's embedding against passage embeddings to rank which content best matches the query's meaning.
Under the hood it is a dot product of two vectors divided by the product of their lengths, which cancels out magnitude and leaves only direction. Because the score ignores length, a short paragraph and a long article on the same topic can still land close together. Values run from -1 to 1: near 1 means the vectors point the same way (similar meaning), near 0 means unrelated, negative means opposite.
Where it shows up in AI search
Modern retrieval turns your query and every candidate passage into embeddings, then ranks passages by cosine similarity to the query. This is the core of semantic search, vector databases, and the retrieval step inside RAG systems that feed AI Overviews, ChatGPT, and Perplexity. OpenAI normalizes its embeddings to length 1, so cosine similarity reduces to a plain dot product and gives the same ranking as Euclidean distance.
One caveat worth knowing: a high score is not proof of true semantic match. A 2024 paper from Netflix researchers showed that, depending on how an embedding model was trained and regularized, cosine similarity can yield arbitrary and therefore meaningless similarities. It is a strong signal, not a law of nature.
Example: a query embedding for best running shoes for flat feet scores high against a passage on stability shoes for overpronation and low against hiking boot waterproofing, even though neither shares the exact words.
How it affects your traffic
AI answer engines pull the passages whose embeddings sit closest to the user's question, not the ones stuffed with the exact keywords. If your pages are written around the meanings and questions your buyers actually use, they land near those query vectors and get retrieved and cited. Our AI SEO work structures content so its embeddings align with the prompts your market types into ChatGPT, Perplexity, and AI Overviews, which is how you win citations that keyword-only pages miss.
Get AI SEO that moves the needle
We turn terms like this into ranked pages and qualified pipeline. Start with a free Initial SEO Strategy.