← ALB News · curated headline

Semantically Descriptive Similarity

arXiv Software Engineering · WORLD · Compilers · 12/4/2026, 12:00:00 AM

arXiv:2612.05851v1 Announce Type: cross Abstract: Program equivalence is a notoriously undecidable problem, consequently, all approaches to determining whether two programs are equivalent are either imprecise or incomplete. In practical applications, developers often rely on proxy measures, such as the syntactic similarity of programs. In this paper, we formalize what it means for a similarity measure to be semantically descriptive and provide a framework for ranking measures based on their ability to differentiate between equivalent and non-equivalent program pairs. We refer to this metric as the average semantic loss of the similarity measure. We evaluate 17 established similarity measures, including ones based on edit-distance, compression, and vector embeddings. Using a subset of 450 thousand program pairs from the IBM ProjectCodeNet benchmark, we show that our semantic loss score replicates previous findings based on classifier performance. Finally, using this score, we demonstrate that compression-based measures outperform state-of-the-art vector-embedding-based approaches, such as CodeBERT and GraphCodeBERT, on unformatted code, but lag behind when the code is formatted or compiled and then decompiled. This indicates that these approaches are sensitive to the varying formatting of code.

Continue to arXiv Software Engineering →

Finished reading? Continue to the original source above — or join the discussion below.