CODE CLONE DETECTION WITH SELF-SUPERVISION ON DUAL GRAPHS

Fuente: Zenodo
Saved in:
Bibliographic Details
Main Authors: Chunguang Li, Adisorn Sirikham, Jessada Konpang, Yan Wang
Format: Recurso digital
Language:English
Published: Zenodo 2026
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866901890014380032
author Chunguang Li
Adisorn Sirikham
Jessada Konpang
Yan Wang
author_facet Chunguang Li
Adisorn Sirikham
Jessada Konpang
Yan Wang
contents <p><strong><em><span>Code clone detection underpins a wide range of maintenance tasks from automated refactoring to real time plagiarism policing yet single view methods that rely on raw tokens, Abstract Syntax Trees or Control Flow Graphs still struggle to type-4 (semantic) clones. We present DG Clone, a dual graph self-supervised framework that couples a textual call dependency graph with an AS derived structural graph and fuses them through a lightweight cross graph attention module implemented in PyTorch~2.2 and PyTorch Geometric~2.5. The textual graph excels at capturing lexical context, while the AST graph models hierarchical syntax. Their fusion recovers semantic equivalence that each view alone misses, outperforming token sequence models (e.g., GraphCodeBERT) and single graph GNNs. Training employs a graph aware triplet loss that obviates manual labels by dynamically constructing positive/negative triplets from unlabelled repositories. DG Clone boosts F1 on BigCloneBench from 90.3% to 98.4% and on Google Code Jam from 81.7% to 89.8%. It lifts MAP by +6.8pp over Tree Based CNNs and +5.4pp over GraphCodeBERT, while cutting inference latency in an online judge by 31% in Python implementation. These findings demonstrate that integrating complementary graph views affords a label-efficient and practically viable route to uncovering subtle semantic similarities in source code.</span></em></strong></p>
format Recurso digital
id zenodo_https___doi_org_10_5281_zenodo_18231685
institution Zenodo
language eng
publishDate 2026
publisher Zenodo
record_format zenodo
spellingShingle CODE CLONE DETECTION WITH SELF-SUPERVISION ON DUAL GRAPHS
Chunguang Li
Adisorn Sirikham
Jessada Konpang
Yan Wang
Code Clone Detection; Self-Supervised Learning; Graph Neural Network
<p><strong><em><span>Code clone detection underpins a wide range of maintenance tasks from automated refactoring to real time plagiarism policing yet single view methods that rely on raw tokens, Abstract Syntax Trees or Control Flow Graphs still struggle to type-4 (semantic) clones. We present DG Clone, a dual graph self-supervised framework that couples a textual call dependency graph with an AS derived structural graph and fuses them through a lightweight cross graph attention module implemented in PyTorch~2.2 and PyTorch Geometric~2.5. The textual graph excels at capturing lexical context, while the AST graph models hierarchical syntax. Their fusion recovers semantic equivalence that each view alone misses, outperforming token sequence models (e.g., GraphCodeBERT) and single graph GNNs. Training employs a graph aware triplet loss that obviates manual labels by dynamically constructing positive/negative triplets from unlabelled repositories. DG Clone boosts F1 on BigCloneBench from 90.3% to 98.4% and on Google Code Jam from 81.7% to 89.8%. It lifts MAP by +6.8pp over Tree Based CNNs and +5.4pp over GraphCodeBERT, while cutting inference latency in an online judge by 31% in Python implementation. These findings demonstrate that integrating complementary graph views affords a label-efficient and practically viable route to uncovering subtle semantic similarities in source code.</span></em></strong></p>
title CODE CLONE DETECTION WITH SELF-SUPERVISION ON DUAL GRAPHS
topic Code Clone Detection; Self-Supervised Learning; Graph Neural Network
url https://doi.org/10.5281/zenodo.18231685