C-STS: Conditional Semantic Textual Similarity

Ameet Deshpande, Carlos E. Jimenez, Howard Chen, Vishvak Murahari, Victoria Graf, Tanmay Rajpurohit, Ashwin Kalyan, Danqi Chen, Karthik Narasimhan

TL;DR

This paper introduces Conditional Semantic Textual Similarity (C-STS), a new NLP task that measures sentence similarity based on a specific, natural language condition, aiming to resolve the inherent ambiguity of traditional STS. They've created a new dataset, C-STS-2023, and found that even state-of-the-art models struggle with this more nuanced evaluation.

What Problem Does This Paper Address?

Semantic Textual Similarity (STS) is a fundamental task in Natural Language Processing (NLP) that aims to quantify how similar two sentences are. It's crucial for applications like information retrieval and building better language models. However, traditional STS is inherently ambiguous. The similarity between two sentences can vary wildly depending on what aspect you're focusing on. For example, "The NBA player shoots a three-pointer" and "A man throws a tennis ball" might seem dissimilar overall, but if you focus on "the motion of the ball," they become more similar. This ambiguity makes it hard to truly evaluate a model's understanding of nuanced meaning. C-STS aims to address this by introducing a "condition" that guides the similarity judgment, making it more precise and less subjective.

Methods

The core innovation is the Conditional Semantic Textual Similarity (C-STS) task itself. Instead of just asking "how similar are these two sentences?", C-STS asks "how similar are these two sentences given this specific condition?".

To create the C-STS dataset, the authors employed a multi-stage process:

  1. Sentence Pair Generation: They leveraged image-caption datasets (MS COCO and Flickr30K). Images were encoded, and similar images were identified. The corresponding captions of these similar images were then paired to create initial sentence pairs.
  2. Candidate Filtering: These pairs were then filtered to remove those with excessively high or low unconditional similarity, aiming for pairs where similarity is genuinely ambiguous without a condition. Metrics like bag-of-words intersection over union, SimCSE embedding cosine distance, sentence length ratio, and character length were used.
  3. Annotation Methodology: This involved a three-stage crowdsourcing process using Mechanical Turk:
  4. Worker Pool Selection: A qualification test ensured workers were adept at generating conditions and assessing similarity.
  5. Condition Annotation: Workers were tasked with providing two conditions for each sentence pair: one that would lead to high similarity (C-High) and one that would lead to low similarity (C-Low).
  6. Condition Verification and Similarity Assessment: New annotators then assigned a Likert scale similarity score (1-5) for each sentence pair under each condition. This stage also served to verify the pertinence of the conditions.

For model evaluation, they explored three encoding configurations:

  • Cross-encoder: Encodes the sentence pair and condition together.
  • Bi-encoder: Encodes sentences and condition separately and then compares their representations.
  • Tri-encoder: A novel approach where sentences and the condition are encoded separately, and then a transformation is applied to combine them for similarity computation.

Datasets

The paper introduces the C-STS-2023 dataset, containing approximately 18,908 instances. Each instance includes a sentence pair, a natural language condition, and a scalar similarity judgment (1-5).

For training and evaluation of baselines, they also used the STS-B dataset, a standard benchmark for Semantic Textual Similarity.

Key Insights and Ideas

  • Ambiguity is a Feature, Not a Bug (for Evaluation): Traditional STS struggles with ambiguity, but C-STS leverages this by making ambiguity a core part of the evaluation. By providing a condition, the task forces models to focus on specific aspects, revealing deeper understanding (or lack thereof).
  • State-of-the-Art Models Struggle: Even top-performing models like GPT-4 and SimCSE, which excel at standard STS tasks, perform poorly on C-STS, achieving Spearman correlations below 50. This highlights that current models might be over-specialized for existing benchmarks and lack nuanced understanding.
  • Fine-grained Evaluation is Crucial: C-STS enables a more precise evaluation of semantic similarity, moving beyond a single, fuzzy score to a multi-faceted understanding. This is vital for developing truly intelligent language systems.
  • Encoding Matters: The bi-encoder setup generally outperformed cross-encoders and the novel tri-encoder for C-STS, suggesting that separate encoding of sentences and conditions followed by comparison is effective.

Key Results

  • Low Performance on C-STS: State-of-the-art models like SimCSE (bi-encoder) achieved a Spearman correlation of 47.5 on C-STS, while GPT-4 achieved 43.6. This is a stark contrast to their performance on STS-B, where SimCSE reaches ~88.09.
  • Fine-tuning vs. Zero/Few-Shot: Finetuned sentence encoders generally performed better than large language models (LLMs) evaluated in zero- or few-shot settings. However, GPT-4, even in few-shot settings, showed competitive performance, outperforming other LLMs significantly.
  • Scaling Laws: Performance on C-STS monotonically increases with the size of the training dataset for models like SimCSE, indicating the dataset's quality and the need for more data or better modeling strategies.
  • Tri-encoder Performance: The proposed tri-encoder model generally performed poorly compared to bi- and cross-encoder configurations.

Limitations and Future Work

  • Dataset Size: While C-STS-2023 has nearly 20,000 instances, the authors suggest that increasing this size could further benefit sentence embedding models.
  • Data Sources: The current dataset relies on image-caption pairs. Future work could explore other sources for sentence pairs.
  • Model Improvements: The paper suggests that a combination of improved modeling strategies and fine-tuning techniques will be necessary to push the boundaries on C-STS.
  • Broader Evaluation: The authors encourage the NLP community to adopt C-STS for evaluating language models, providing a more holistic view of semantic understanding.

Summary updated

BibTeX
@inproceedings{deshpande2023c,
  author = {Ameet Deshpande and Carlos E. Jimenez and Howard Chen and Vishvak Murahari and Victoria Graf and Tanmay Rajpurohit and Ashwin Kalyan and Danqi Chen and Karthik Narasimhan},
  title = {{C-STS: Conditional Semantic Textual Similarity}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  url = {https://openreview.net/forum?id=UpDKeMf5Mt},
}
Figure