How Small Transformation Expose the Weakness of Semantic Similarity Measures

Serge Lionel Nikiema, Albérick Euraste Djire, Abdoul Aziz Bonkoungou, Micheline Bénédicte Moumoula, Jordan Samhi +3 more
9/8/2025
cs.CLcs.AI

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{nikiema2025small,
  title  = {How Small Transformation Expose the Weakness of Semantic Similarity Measures},
  author = {Serge Lionel Nikiema and Albérick Euraste Djire and Abdoul Aziz Bonkoungou and Micheline Bénédicte Moumoula and Jordan Samhi and Abdoul Kader Kabore and Jacques Klein and Tegawendé F. Bissyande},
  year   = {2025},
  eprint = {2509.09714},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2509.09714v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2509.09714.svg)](https://codeofpaper.com/paper/2509.09714)

Discussion