MAGNET: A Multi-Graph Attentional Network for Code Clone Detection
Zixian Zhang, Takfarinas Saber

TL;DR
MAGNET introduces a multi-graph attentional framework that effectively combines AST, CFG, and DFG representations to improve code clone detection accuracy, surpassing existing methods.
Contribution
This paper presents MAGNET, a novel multi-graph neural network with advanced attention mechanisms for enhanced code clone detection.
Findings
Achieves state-of-the-art F1 scores of 96.5% and 99.2% on benchmark datasets.
Demonstrates the effectiveness of multi-graph fusion and attention components through ablation studies.
Outperforms existing methods in capturing both syntactic and semantic code features.
Abstract
Code clone detection is a fundamental task in software engineering that underpins refactoring, debugging, plagiarism detection, and vulnerability analysis. Existing methods often rely on singular representations such as abstract syntax trees (ASTs), control flow graphs (CFGs), and data flow graphs (DFGs), which capture only partial aspects of code semantics. Hybrid approaches have emerged, but their fusion strategies are typically handcrafted and ineffective. In this study, we propose MAGNET, a multi-graph attentional framework that jointly leverages AST, CFG, and DFG representations to capture syntactic and semantic features of source code. MAGNET integrates residual graph neural networks with node-level self-attention to learn both local and long-range dependencies, introduces a gated cross-attention mechanism for fine-grained inter-graph interactions, and employs Set2Set pooling to…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
