Semantic similarity is the property of two pieces of text having the same or similar meaning, regardless of the words used. "The car broke down" and "My vehicle stopped working" are semantically similar — same meaning, no shared words.
Embedding-based systems measure semantic similarity mathematically: similar meanings produce vectors that are close together in vector space. This is what makes meaning-based search possible.
Keyword search requires exact word overlap. This fails in many common situations:
Synonyms — Searching "automobile" misses documents about "cars."
Paraphrasing — "Reduce expenses" misses "cut costs."
Abbreviations — "ML" misses "machine learning."
Cross-language — An English query misses a French document about the same topic.
Embeddings solve these by placing all these variations close together in vector space.
Measures the angle between two vectors. Returns a value from -1 to 1. A score above 0.8 typically indicates strong semantic relatedness.
Most common metric for semantic search — ignores vector magnitude, focuses on direction.
Measures the straight-line distance between two points in vector space. Smaller distance = more similar.
Sensitive to vector magnitude. Used in some clustering algorithms and certain vector databases.
Semantic similarity captures topic and meaning — not factual correctness. "The Earth orbits the Sun" and "The Sun orbits the Earth" score as highly similar because they discuss the same topic in the same structure, even though one is false.
Similarity scores also depend heavily on the embedding model. A model trained on general web text may rate pairs differently than one fine-tuned on scientific papers or legal documents.
Ask the AI assistant about semantic similarity, cosine similarity, or how embedding-based search works.