{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/csts-conditional-semantic-textual-similarity","title":"C-STS: Conditional Semantic Textual Similarity","arxiv_id":"2305.15093","date":"2023-05-24","proceeding":null,"authors":["Ameet Deshpande","Carlos E. Jimenez","Howard Chen","Vishvak Murahari","Victoria Graf","Tanmay Rajpurohit","Ashwin Kalyan","Danqi Chen","Karthik Narasimhan"],"abstract":"Semantic textual similarity (STS), a cornerstone task in NLP, measures the degree of similarity between a pair of sentences, and has broad application in fields such as information retrieval and natural language understanding. However, sentence similarity can be inherently ambiguous, depending on the specific aspect of interest. We resolve this ambiguity by proposing a novel task called Conditional STS (C-STS) which measures sentences' similarity conditioned on an feature described in natural language (hereon, condition). As an example, the similarity between the sentences \"The NBA player shoots a three-pointer.\" and \"A man throws a tennis ball into the air to serve.\" is higher for the condition \"The motion of the ball\" (both upward) and lower for \"The size of the ball\" (one large and one small). C-STS's advantages are two-fold: (1) it reduces the subjectivity and ambiguity of STS and (2) enables fine-grained language model evaluation through diverse natural language conditions. We put several state-of-the-art models to the test, and even those performing well on STS (e.g. SimCSE, Flan-T5, and GPT-4) find C-STS challenging; all with Spearman correlation scores below 50. To encourage a more comprehensive evaluation of semantic similarity and natural language understanding, we make nearly 19K C-STS examples and code available for others to train and test their models.","url_abs":"https://arxiv.org/abs/2305.15093v2","url_pdf":"https://arxiv.org/pdf/2305.15093v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"csts-conditional-semantic-textual-similarity","repo_url":"https://github.com/princeton-nlp/c-sts","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"information-retrieval","task_name":"Information Retrieval"},{"task_slug":"language-model-evaluation","task_name":"Language Model Evaluation"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"natural-language-understanding","task_name":"Natural Language Understanding"},{"task_slug":"question-answering","task_name":"Question Answering"},{"task_slug":"retrieval","task_name":"Retrieval"},{"task_slug":"sts","task_name":"STS"},{"task_slug":"semantic-similarity","task_name":"Semantic Similarity"},{"task_slug":"semantic-textual-similarity","task_name":"Semantic Textual Similarity"},{"task_slug":"sentence","task_name":"Sentence"},{"task_slug":"sentence-similarity","task_name":"Sentence Similarity"}],"methods":[{"method_slug":"flan-t5","method_name":"Flan-T5"},{"method_slug":"simcse","method_name":"SimCSE"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2305.15093","atlas_url":"https://app.syntology.ai/?focus=2305.15093","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2305.15093"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"deterministic:regex_extraction","url":"https://github.com/princeton-nlp/c-sts","reach":null}],"summary":{"ran":2,"unverified":2},"by_repo_kind":{"official":{"samples":4,"ran":2,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":4,"samples":[{"code_sha256_prefix":"85d63561750f19d5","entry":"Pooler","repo":"princeton-nlp/c-sts","repo_kind":"official","path":"utils/sts/modeling_encoders.py","file_url":"https://github.com/princeton-nlp/c-sts/blob/HEAD/utils/sts/modeling_encoders.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"85d63561750f19d5"}},{"code_sha256_prefix":"6bab43cad666731d","entry":"QuadrupletLoss","repo":"princeton-nlp/c-sts","repo_kind":"official","path":"utils/sts/modeling_encoders.py","file_url":"https://github.com/princeton-nlp/c-sts/blob/HEAD/utils/sts/modeling_encoders.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6bab43cad666731d"}},{"code_sha256_prefix":"7c0ff62a3a0c285d","entry":"TriEncoderForClassification","repo":"princeton-nlp/c-sts","repo_kind":"official","path":"utils/sts/modeling_encoders.py","file_url":"https://github.com/princeton-nlp/c-sts/blob/HEAD/utils/sts/modeling_encoders.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7c0ff62a3a0c285d"}},{"code_sha256_prefix":"455fa4bdca820a57","entry":"concat_features","repo":"princeton-nlp/c-sts","repo_kind":"official","path":"utils/sts/modeling_encoders.py","file_url":"https://github.com/princeton-nlp/c-sts/blob/HEAD/utils/sts/modeling_encoders.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"455fa4bdca820a57"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}