CSSG: Measuring Code Similarity with Semantic Graphs
Fuente:
arXiv
Enregistré dans:
| Auteurs principaux: | , , , , , , , , |
|---|---|
| Format: | Preprint |
| Publié: |
2026
|
| Sujets: | |
| Accès en ligne: | |
| Tags: |
Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
|
| _version_ | 1866914255406628864 |
|---|---|
| author | Lu, Yiyang Xu, Jingwen Lv, Changze Huang, Zisu Guo, Zhengkang Wang, Zhengyuan Tian, Muzhao Huang, Xuanjing Zheng, Xiaoqing |
| author_facet | Lu, Yiyang Xu, Jingwen Lv, Changze Huang, Zisu Guo, Zhengkang Wang, Zhengyuan Tian, Muzhao Huang, Xuanjing Zheng, Xiaoqing |
| contents | 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. |
| format | Preprint |
| id |
arxiv_https___arxiv_org_abs_2601_04085 |
| institution | arXiv |
| publishDate | 2026 |
| record_format | arxiv |
| spellingShingle | CSSG: Measuring Code Similarity with Semantic Graphs Lu, Yiyang Xu, Jingwen Lv, Changze Huang, Zisu Guo, Zhengkang Wang, Zhengyuan Tian, Muzhao Huang, Xuanjing Zheng, Xiaoqing Programming Languages Artificial Intelligence 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. |
| title | CSSG: Measuring Code Similarity with Semantic Graphs |
| topic | Programming Languages Artificial Intelligence |
| url | https://arxiv.org/abs/2601.04085 |