Semantic Code Clone Detection: Are We There Yet?
- URL: http://arxiv.org/abs/2606.25272v1
- Date: Wed, 24 Jun 2026 01:11:40 GMT
- Title: Semantic Code Clone Detection: Are We There Yet?
- Abstract summary: Code clone detection has been extensively studied for decades.<n>Recent approaches have reported remarkably high performance for semantic (Type-4) clones on benchmark datasets.<n>We present the first systematic empirical study investigating the generalizability of state-of-the-art semantic code clone detectors.
- Score: 30.160018956984853
- License: http://creativecommons.org/licenses/by/4.0/
- Abstract: Code clone detection has been extensively studied for decades, and recent approaches have begun reporting remarkably high performance for semantic (Type-4) clones on benchmark datasets. However, it remains unclear whether these results reflect a genuine ability to capture semantic equivalence between programs, or simply an ability to exploit dataset-specific patterns. In this paper, we present the first systematic empirical study investigating the generalizability of state-of-the-art (SOTA) semantic code clone detectors beyond benchmark evaluation settings. Inspired by the inherent inclusion relationship among clone types, we propose a clone operator framework consisting of eight transformation operators derived from Type-2 and Type-3 clone variations. Using these operators, we construct distribution-shifted yet semantically equivalent Type-4 clone instances and evaluate 11 representative detectors spanning token-based, tree-based, and graph-based paradigms on the real-world BigCloneBench dataset. Our results reveal substantial performance degradation across all evaluated approaches, despite their strong benchmark performance. Further analyses show that existing detectors heavily rely on shortcut learning based on lexical and structural cues rather than robust semantic understanding. Our findings suggest that current SOTA semantic code clone detectors exhibit limited generalizability in real-world scenarios, highlighting important avenues for future research.
Related papers
- LoRC: Detecting AI-Generated Images via Low-Rank Collapse in Semantic Residuals [50.157719466558696]
We show that modern generators exhibit low-rank collapse in the semantic-residual subspace while preserving the dominant semantic direction.<n>We propose textbfLoRC, a framework that decouples semantic dominance to capture the collapsed residual geometry.<n>Our method improves accuracy by an average of 7.0% across multiple benchmarks and achieves 97.0% accuracy on 39 unseen generators.
arXiv Detail & Related papers (2026-08-21T08:58:47Z) - The Regularizing Power of Language-Training Deepfake Detectors [57.529452351298495]
Deepfake detection generally suffers from overfitting to low-level domain-specific artifacts.<n>We use a dual-encoder architecture, pairing a frozen specialist detector with a LoRA-tuned MLLM encoder.<n>We employ a reinforcement learning stage that encourages the model to generate descriptive reasoning before classifying.
arXiv Detail & Related papers (2026-05-29T12:01:17Z) - Zero-shot Evaluation of Deep Learning for Java Code Clone Detection [0.3158660750994145]
We investigate the generalizability of DL-based clone detectors for Java.<n>Our experiments demonstrate that the models' generalizability to unseen code is limited.<n> conventional clone detector NiCad even outperforms the DL-based clone detectors in such a zero-shot evaluation scenario.
arXiv Detail & Related papers (2026-04-15T12:17:40Z) - Are Classical Clone Detectors Good Enough For the AI Era? [5.2308433103996625]
Increasing adoption of AI-generated code has reshaped modern software development.<n> AI-generated clones exhibit systematic syntactic patterns and semantic differences learned from large-scale training data.<n>Classical code clone detection tools have historically been validated primarily on human-authoreds.
arXiv Detail & Related papers (2025-09-30T04:19:17Z) - HyClone: Bridging LLM Understanding and Dynamic Execution for Semantic Code Clone Detection [3.2167919219391474]
Code clone detection is a critical task in software engineering, aimed at identifying duplicated or similar code fragments within or across software systems.<n>Recent advances in large language models (LLMs) have shown promise in understanding code semantics.<n>We propose a novel two-stage framework that combines LLM-based screening with execution-based validation for detecting semantic clones in Python programs.
arXiv Detail & Related papers (2025-08-02T13:11:56Z) - Binary Code Similarity Detection via Graph Contrastive Learning on Intermediate Representations [52.34030226129628]
Binary Code Similarity Detection (BCSD) plays a crucial role in numerous fields, including vulnerability detection, malware analysis, and code reuse identification.
In this paper, we propose IRBinDiff, which mitigates compilation differences by leveraging LLVM-IR with higher-level semantic abstraction.
Our extensive experiments, conducted under varied compilation settings, demonstrate that IRBinDiff outperforms other leading BCSD methods in both One-to-one comparison and One-to-many search scenarios.
arXiv Detail & Related papers (2024-10-24T09:09:20Z) - Assessing the Code Clone Detection Capability of Large Language Models [0.0]
The evaluation involves testing the models on a variety of code pairs of different clone types and levels of similarity.
Findings indicate that GPT-4 consistently surpasses GPT-3.5 across all clone types.
arXiv Detail & Related papers (2024-07-02T16:20:44Z) - Rethinking Person Re-identification from a Projection-on-Prototypes
Perspective [84.24742313520811]
Person Re-IDentification (Re-ID) as a retrieval task, has achieved tremendous development over the past decade.
We propose a new baseline ProNet, which innovatively reserves the function of the classifier at the inference stage.
Experiments on four benchmarks demonstrate that our proposed ProNet is simple yet effective, and significantly beats previous baselines.
arXiv Detail & Related papers (2023-08-21T13:38:10Z) - UniASM: Binary Code Similarity Detection without Fine-tuning [2.2329530239800035]
We propose a novel rich-semantic function representation technique to ensure the model captures the intricate nuances of binary code.<n>We introduce the first UniLM-based binary code embedding model, named UniASM, which includes two newly designed training tasks.<n>The experimental results show that UniASM outperforms the state-of-the-art (SOTA) approaches on the evaluation datasets.
arXiv Detail & Related papers (2022-10-28T14:04:57Z) - K-ASTRO: Structure-Aware Adaptation of LLMs for Code Vulnerability Detection [12.458619777971956]
K-ASTRO is a lightweight Transformer model that combines semantic embeddings from Large Language Models with structural features of Abstract Syntax Trees (ASTs) to improve efficiency and accuracy in code vulnerability detection.<n>Our approach introduces an AST-based augmentation technique inspired by mutation testing, a structure-aware attention mechanism that incorporates augmented AST features, and a joint adaptation pipeline to unify code semantics and syntax.
arXiv Detail & Related papers (2022-08-17T04:50:51Z) - Mitigating Generation Shifts for Generalized Zero-Shot Learning [52.98182124310114]
Generalized Zero-Shot Learning (GZSL) is the task of leveraging semantic information (e.g., attributes) to recognize the seen and unseen samples, where unseen classes are not observable during training.
We propose a novel Generation Shifts Mitigating Flow framework for learning unseen data synthesis efficiently and effectively.
Experimental results demonstrate that GSMFlow achieves state-of-the-art recognition performance in both conventional and generalized zero-shot settings.
arXiv Detail & Related papers (2021-07-07T11:43:59Z) - Learning and Evaluating Representations for Deep One-class
Classification [59.095144932794646]
We present a two-stage framework for deep one-class classification.
We first learn self-supervised representations from one-class data, and then build one-class classifiers on learned representations.
In experiments, we demonstrate state-of-the-art performance on visual domain one-class classification benchmarks.
arXiv Detail & Related papers (2020-11-04T23:33:41Z) - Semantic Clone Detection via Probabilistic Software Modeling [69.43451204725324]
This article contributes a semantic clone detection approach that detects clones that have 0% syntactic similarity.
We present SCD-PSM as a stable and precise solution to semantic clone detection.
arXiv Detail & Related papers (2020-08-11T17:54:20Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.