Semantic similarity scores how close two texts are in meaning, not just shared words, for duplicate detection, paraphrase checks, and search ranking.
Similar meanings should sit near each other in embedding space. Models learn embeddings whose cosine similarity tracks human relatedness. "The cat sat on the mat" and "A feline rested on the rug" share no words, yet they should be nearby. Sentence-BERT (SBERT) made efficient sentence embeddings by fine-tuning BERT on natural language inference data.
Embedding models such as E5, BGE, and OpenAI's text-embedding models are trained specifically for similarity.
STS, Semantic Textual Similarity, is a common benchmark: people rate pairs from 0 to 5. Document similarity compares longer texts. Cross-lingual similarity compares texts in different languages. Search, recommendations, plagiarism detectors, and support routing all use this. Lexical similarity, word overlap, is a different signal. Pick the measure that matches the job.
Cosine similarity on sentence vectors is the usual score. SBERT fine-tunes BERT so similar sentences, including paraphrases with no shared words, land nearby. E5, BGE, and OpenAI text-embedding models train that property directly. STS asks people for a 0 to 5 rating so research can correlate model scores with judgments.
Document-level and cross-lingual variants use longer inputs or bilingual pairs. Search, duplicates, plagiarism, routing, and recommendations depend on meaning, not lexical overlap. If you only count shared words, the cat/mat versus feline/rug pair looks unrelated. Sentence-BERT (2019) made sentence embeddings practical so cosine similarity can score paraphrase and retrieval.
Semantic Similarity
Compare sentence meanings beyond surface-level word overlap using vector embeddings