Semantic similarity measures how closely two pieces of text relate in meaning rather than how many words they share. Dense vector representations make this comparison useful for sentence matching, semantic caching, and retrieval systems. section 2.3.1 section 7.3.1
Sentence-BERT improves sentence-level comparison by encoding each sentence independently with shared network parameters, then comparing the resulting embeddings with cosine similarity. Its siamese and triplet-training designs emphasize relationships between similar and dissimilar sentences. section 2.3.1
Use semantic similarity with these practical distinctions:
- Match paraphrased queries even when they share few words; semantic caching compares incoming query vectors with cached-query vectors and applies a similarity threshold. section 7.3.1
- Do not treat semantic closeness as retrieval appropriateness: embeddings do not encode domain boundaries, authority, or freshness. section 7.2
Paraphrased cache queries
“What was Uber's revenue in 2021?” and “How much money did Uber make in 2021?” can become cache hits because their embeddings occupy nearby vector-space regions despite limited word overlap. section 7.3.1
Figure 2.6 A distinction between Bert (on the left) and Sentence-Bert (on the right) lies in their approach to semantic textual similarity. In BERT, the two sentences are initially concatenated and then fed into the network. Subsequently, the similarity is computed using the activation function. Conversely, in Sentence-Bert, the two sentences are independently input into Bert, and their cosine similarity is then calculated.
Compare BERT's concatenated sentence processing with Sentence-BERT's independent encoding and cosine-similarity calculation. section 2.3.1







