mlsanityData to 14 Oct 2026

MAGNET: A Multi-Graph Attentional Network for Code Clone Detection

arXiv 2510.24241 ↗First posted 28 Oct 2025cs.SE cs.AIcited by 0

Not on the map. Why?

Abstract (arXiv)

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 fuse multi-graph embeddings into unified program-level representations. Extensive experiments on BigCloneBench and Google Code Jam demonstrate that MAGNET achieves state-of-the-art performance with an overall F1 score of 96.5% and 99.2% on the two datasets, respectively. Ablation studies confirm the critical contributions of multi-graph fusion and each attentional component. Our code is available at https://github.com/ZixianReid/Multigraphmatch

Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 18 of its 56 references that are in the map. First posted on arXiv 28 Oct 2025.

Builds on

18 of 56 references.

References · 18

  1. 2017Attention Is All You Needcited by 60,361
  2. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
  3. 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,305
  4. 2017Graph Attention Networkscited by 8,923
  5. 2019Fast Graph Representation Learning with PyTorch Geometriccited by 2,434
  6. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
  7. 2018Deeper Insights into Graph Convolutional Networks for Semi-Supervised Learningcited by 1,102
  8. 2017Residual Gated Graph ConvNetscited by 346
  9. 2015Order Matters: Sequence to sequence for setscited by 237
  10. 2020Detecting Code Clones with Graph Neural Networkand Flow-Augmented Abstract Syntax Treecited by 69
  11. 2015SourcererCC: Scaling Code Clone Detection to Big Codecited by 40
  12. 2020Modeling Functional Similarity in Source Code with Graph-Based Siamese Networkscited by 10
6 more
  1. 2022Learning Program Semantics with Code Representations: An Empirical Studycited by 6
  2. 2024CC2Vec: Combining Typed Tokens with Contrastive Learning for Effective Code Clone Detectioncited by 4
  3. 2020Automatically Deriving Control-Flow Graph Generators from Operational Semanticscited by 2
  4. 2021Precise Learning of Source Code Contextual Semantics via Hierarchical Dependence Structure and Graph Attention Networkscited by 2
  5. 2025AST-Enhanced or AST-Overloaded? The Surprising Impact of Hybrid Graph Representations on Code Clone Detectioncited by 1
  6. 2025Code Clone Detection via an AlphaFold-Inspired Frameworkcited by 1

Built on by

Not cited yet.