What is semantic similarity?
Semantic similarity is how close two pieces of text are in meaning. "Cheap flights to Rome" and "low-cost airfare to Rome" have high semantic similarity even though they share only two words. "Cheap flights to Rome" and "cheap flights to Nome" share almost every letter but have low semantic similarity, because they are about different places.
In practice, semantic similarity is calculated by turning each text into a vector embedding, a list of numbers that represents its meaning, and then measuring how close the two lists are. Google's machine learning course explains that the distance between two items in an embedding space "can be interpreted as a measure of relative similarity between those two items" [2].
How is semantic similarity measured?
Semantic similarity is measured by comparing two vector embeddings with a formula, most often cosine similarity. Google's developer documentation lists three common measures [1]:
| Measure | What it calculates | Higher score means |
|---|---|---|
| Cosine similarity | The angle between two vectors, ignoring their length | More similar |
| Dot product | The cosine multiplied by the lengths of both vectors | More similar, and favors longer vectors |
| Euclidean distance | The straight-line gap between the ends of the vectors | Less similar (it is a distance) |
When vectors are normalized to the same length, all three measures produce the same ranking [1]. OpenAI normalizes its embeddings this way and recommends cosine similarity for comparing them [4].
Cosine similarity runs from -1 to 1, where 1 means the two vectors point in exactly the same direction.
What does a semantic similarity score actually tell you?
A semantic similarity score tells you how close two texts are according to one specific embedding model, and nothing more. It is a relative measure, useful for ranking options against each other, not an absolute grade.
Three points that are widely misunderstood:
- A cosine score is not a percentage. A score of 0.82 does not mean two texts are "82% similar". It is the cosine of an angle, and what counts as a high score varies by model.
- Scores from different models cannot be compared. A 0.8 from one model and a 0.8 from another describe different things. Even two versions of one provider's model can produce different scores for the same pair.
- Similar is not the same as correct. "How to get rid of fleas on a dog" and "how to get rid of fleas on a cat" are highly similar, but the answer to one can be harmful for the other. Similarity measures closeness of topic and phrasing, not whether a passage answers the question.
That last point matters for AI search. Systems that retrieve passages by similarity alone can pull a passage that is on-topic but wrong for the exact question, so retrieval is usually followed by further ranking and checking.
How do search engines use semantic similarity?
Search engines use semantic similarity to match queries to pages that mean the same thing even when they use different words. Google has described this shift in stages: RankBrain in 2015 helped it relate words to concepts, neural matching in 2018 looked at whole queries and pages rather than keywords, and BERT in 2019 helped it understand how combinations of words change meaning [5].
Google's current guidance for its AI features says the systems "can understand synonyms and general meanings of what someone is seeking, in order to connect them with content that might not use the same precise words" [6]. Google adds that site owners do not need to worry about capturing every long-tail variation of a query [6].
Google does not publish which similarity measures or embedding models its ranking systems or AI Overviews use, or how much weight meaning-based matching carries against other signals.
When did semantic similarity become practical at scale?
Semantic similarity between whole sentences became practical at scale in 2019, when Sentence-BERT made it possible to compare sentence embeddings directly. Earlier methods needed to process every pair of sentences together, which was far too slow for large collections.
2015 to 2018: meaning enters Google ranking
RankBrain (2015) and neural matching (2018) were Google's first systems to match queries to pages by concept rather than by word overlap alone [5].
2019: BERT and Sentence-BERT
In October 2019, Google said BERT would help it understand about one in 10 English searches in the US, especially longer, more conversational queries where small words such as "for" and "to" change the meaning [7]. In August 2019, Nils Reimers and Iryna Gurevych published Sentence-BERT, which cut the time to find the most similar pair of sentences in a collection from 65 hours to about 5 seconds while keeping BERT's accuracy [3].
What is the difference between semantic similarity and keyword matching?
Semantic similarity compares meaning, while keyword matching compares the actual words. Keyword matching treats "physician" and "doctor" as different; semantic similarity treats them as near neighbors. Keyword matching treats "Rome" and "Nome" as one letter apart; semantic similarity treats them as unrelated.
Both still matter. Exact words carry weight for names, codes and precise phrases, and small words can flip a query's meaning. Search Insider's study Is deleting a stop word safe? tested how often removing a single stop word changed Google's results.
What is the difference between semantic similarity and relevance?
Semantic similarity measures how close two texts are in meaning, while relevance measures whether a page actually satisfies the searcher's need. A page can be highly similar to a query and still be irrelevant: outdated, thin, or about the right topic but the wrong product. Search engines combine similarity with many other signals, such as quality and freshness, to judge relevance.
Should you use semantic similarity tools for SEO?
Semantic similarity tools are useful for SEO as a rough check, not as a target. Comparing your section headings or opening sentences against target queries with an embedding model can show when a page talks around a topic instead of naming it. Comparing your page with top-ranking pages can show subtopics you have missed.
Do not treat a higher similarity score as a ranking goal. The score reflects the tool's chosen model, not Google's, and rewriting a page to push the number up can make it read worse for people. Write sections that state their subject plainly and answer the question in the first sentence; that tends to raise similarity in any model, and it helps readers too.