Score: 0

CSSG: Measuring Code Similarity with Semantic Graphs

Published: January 7, 2026 | arXiv ID: 2601.04085v1

By: Jingwen Xu , Yiyang Lu , Changze Lv and more

Potential Business Impact:

Finds similar computer code by understanding how it works.

Business Areas:
Semantic Web Internet Services

Existing code similarity metrics, such as BLEU, CodeBLEU, and TSED, largely rely on surface-level string overlap or abstract syntax tree structures, and often fail to capture deeper semantic relationships between programs.We propose CSSG (Code Similarity using Semantic Graphs), a novel metric that leverages program dependence graphs to explicitly model control dependencies and variable interactions, providing a semantics-aware representation of code.Experiments on the CodeContests+ dataset show that CSSG consistently outperforms existing metrics in distinguishing more similar code from less similar code under both monolingual and cross-lingual settings, demonstrating that dependency-aware graph representations offer a more effective alternative to surface-level or syntax-based similarity measures.

Country of Origin
🇨🇳 China

Page Count
7 pages

Category
Computer Science:
Programming Languages