How Small Transformation Expose the Weakness of Semantic Similarity Measures
Not on the map. Why?
Abstract (arXiv)
This research examines how well different methods measure semantic similarity, which is important for various software engineering applications such as code search, API recommendations, automated code reviews, and refactoring tools. While large language models are increasingly used for these similarity assessments, questions remain about whether they truly understand semantic relationships or merely recognize surface patterns. The study tested 18 different similarity measurement approaches, including word-based methods, embedding techniques, LLM-based systems, and structure-aware algorithms. The researchers created a systematic testing framework that applies controlled changes to text and code to evaluate how well each method handles different types of semantic relationships. The results revealed significant issues with commonly used metrics. Some embedding-based methods incorrectly identified semantic opposites as similar up to 99.9 percent of the time, while certain transformer-based approaches occasionally rated opposite meanings as more similar than synonymous ones. The study found that embedding methods' poor performance often stemmed from how they calculate distances; switching from Euclidean distance to cosine similarity improved results by 24 to 66 percent. LLM-based approaches performed better at distinguishing semantic differences, producing low similarity scores (0.00 to 0.29) for genuinely different meanings, compared to embedding methods that incorrectly assigned high scores (0.82 to 0.99) to dissimilar content.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 22 of its 55 references that are in the map. First posted on arXiv 8 Sep 2025.
Builds on
22 of 55 references.
References · 22
- 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,170
- 2019BERTScore: Evaluating Text Generation with BERTcited by 5,512
- 2019The Curious Case of Neural Text Degenerationcited by 2,916
- 2020MiniLM: Deep Self-Attention Distillation for Task-Agnostic Compression of Pre-Trained Transformerscited by 1,463
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
- 2020BLEURT: Learning Robust Metrics for Text Generationcited by 1,203
- 2020MPNet: Masked and Permuted Pre-training for Language Understandingcited by 981
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
- 2021Measuring Coding Challenge Competence With APPScited by 902
- 2023AlpacaFarm: A Simulation Framework for Methods that Learn from Human Feedbackcited by 748
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
- 2018Universal Sentence Encodercited by 489
10 more
- 2024Is Cosine-Similarity of Embeddings Really About Similarity?cited by 89
- 2021NL-Augmenter: A Framework for Task-Sensitive Natural Language Augmentationcited by 73
- 2024The Dawn of GUI Agent: A Preliminary Case Study with Claude 3.5 Computer Usecited by 63
- 2025No Free Labels: Limitations of LLM-as-a-Judge Without Human Groundingcited by 54
- 2024Revisiting Code Similarity Evaluation with Abstract Syntax Tree Edit Distancecited by 26
- 2014A Comparative Study of Programming Languages in Rosetta Codecited by 19
- 2024Paraphrase Types Elicit Prompt Engineering Capabilitiescited by 15
- 2021Cross-Language Code Search using Static and Dynamic Analysescited by 4
- 2025How the Misuse of a Dataset Harmed Semantic Clone Detectioncited by 3
- 2024Augmenting the Interpretability of GraphCodeBERT for Code Similarity Taskscited by 1
Built on by
Citing papers per year: 2026: 1.
1 paper.
- 2026Detecting Functional Memorization in Code Language Models11 Jun 2026