Semantic Textual Similarity (STS)
“A man is playing a guitar” and “a person strums an instrument” share almost no vocabulary and nearly all their meaning. Semantic textual similarity is the task of putting a number on that: given a pair of sentences, produce a graded score — conventionally 0 to 5 — for how close in meaning they are.
A graded judgement, not a yes/no
The scale is the defining feature, and it shapes how systems are built and judged:
- Data comes from the SemEval STS tasks and the STS Benchmark, where several annotators rate each pair and their averaged judgement is the target.
- Systems are scored by Pearson or Spearman correlation against those ratings rather than by accuracy — what counts is ordering pairs the way a person would.
- The standard method encodes each sentence independently with an encoder such as Sentence-BERT and takes the cosine of the two vectors. A cross-encoder reading both sentences together scores higher but cannot be precomputed.
Where the scores go
Duplicate-question detection on a support forum, clustering near-identical news reports, matching a customer’s phrasing to an existing FAQ entry and grading short free-text answers all reduce to this one measurement. STS doubles as the yardstick for sentence-embedding quality: a new encoder is announced with its STS correlations attached.
Why it matters
Word overlap mistakes paraphrase for difference and contradiction for agreement — “the flight was cancelled” and “the flight was not cancelled” share every word. A similarity model trained against human judgement is what lets retrieval and deduplication work on meaning, while keeping the distinction between merely related and genuinely equivalent, which a binary label throws away.
Semantic textual similarity is the task of assigning a graded score — conventionally 0 to 5 — to how close in meaning two sentences are, rather than a binary same/different label. Systems are judged by correlation with averaged human ratings on datasets such as the STS Benchmark. It is the standard measure of sentence-embedding quality and the mechanism behind duplicate detection, FAQ matching and semantic search.
Two friends describe the same film in completely different words. You can tell at once that they mean roughly the same thing — and you could even say how close, rather than just yes or no.
Semantic textual similarity is software doing that scoring. Hand it two sentences and it returns a number for how alike their meanings are, trained to agree with the ratings real people give the same pairs. It is what lets a help site notice your question has already been asked in other words, a news app fold twenty versions of one story into a single headline, and a search box find the right page when you did not happen to use the website’s vocabulary.