Zero-shot Evaluation of Deep Learning for Java Code Clone Detection
- URL: http://arxiv.org/abs/2604.13783v1
- Date: Wed, 15 Apr 2026 12:17:40 GMT
- Title: Zero-shot Evaluation of Deep Learning for Java Code Clone Detection
- Abstract summary: 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.
- Score: 0.3158660750994145
- License: http://creativecommons.org/licenses/by-nc-nd/4.0/
- Abstract: Deep Learning (DL) is becoming more and more widespread in clone detection, motivated by achieving near-perfect performance for this task. In particular in case of semantic code clones, which share only limited syntax but implement the same or similar functionality, Deep Learning appears to outperform conventional tools. In this paper, we want to investigate the generalizability of DL-based clone detectors for Java. We therefore replicate and evaluate the performance of five state-of-the-art DL-based clone detectors, including Transformers like CodeBERT and single-task models like FA-AST+GMN, in a zero-shot evaluation scenario, where we train/fine-tune and evaluate on different datasets and functionalities. Our experiments demonstrate that the models' generalizability to unseen code is limited. Further analysis reveals that the conventional clone detector NiCad even outperforms the DL-based clone detectors in such a zero-shot evaluation scenario.
Related papers
- Semantic Code Clone Detection: Are We There Yet? [30.160018956984853]
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.
arXiv Detail & Related papers (2026-06-24T01:11:40Z) - Detecting Semantic Clones of Unseen Functionality [7.660632979515074]
We re-evaluate six state-of-the-art models, including both task-specific models and generative LLMs, on the task of detecting clones of unseen functionality.<n>We propose and evaluate the use of contrastive learning to improve the performance of existing models on clones of unseen functionality.
arXiv Detail & Related papers (2025-10-05T10:45:52Z) - DetectAnyLLM: Towards Generalizable and Robust Detection of Machine-Generated Text Across Domains and Models [60.713908578319256]
We propose Direct Discrepancy Learning (DDL) to optimize the detector with task-oriented knowledge.<n>Built upon this, we introduce DetectAnyLLM, a unified detection framework that achieves state-of-the-art MGTD performance.<n>MIRAGE samples human-written texts from 10 corpora across 5 text-domains, which are then re-generated or revised using 17 cutting-edge LLMs.
arXiv Detail & Related papers (2025-09-15T10:59:57Z) - 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) - Using Ensemble Inference to Improve Recall of Clone Detection [0.0]
Large-scale source-code clone detection is a challenging task.
We employ four state-of-the-art neural network models and evaluate them individually/in combination.
The results, on an illustrative dataset of approximately 500K lines of C/C++ code, suggest ensemble inference outperforms individual models in all trialled cases.
arXiv Detail & Related papers (2024-02-12T09:44:59Z) - CONCORD: Clone-aware Contrastive Learning for Source Code [64.51161487524436]
Self-supervised pre-training has gained traction for learning generic code representations valuable for many downstream SE tasks.
We argue that it is also essential to factor in how developers code day-to-day for general-purpose representation learning.
In particular, we propose CONCORD, a self-supervised, contrastive learning strategy to place benign clones closer in the representation space while moving deviants further apart.
arXiv Detail & Related papers (2023-06-05T20:39:08Z) - Partial Network Cloning [58.83278629019384]
PNC conducts partial parametric "cloning" from a source network and then injects the cloned module to the target.
Our method yields a significant improvement of 5% in accuracy and 50% in locality when compared with parameter-tuning based methods.
arXiv Detail & Related papers (2023-03-19T08:20:31Z) - Generalizability of Code Clone Detection on CodeBERT [0.0]
Transformer networks such as CodeBERT already achieve outstanding results for code clone detection in benchmark datasets.
We show that the generalizability of CodeBERT decreases by evaluating two different subsets of Java code clones from BigCloneBench.
arXiv Detail & Related papers (2022-08-26T11:24:20Z) - 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) - Incremental-DETR: Incremental Few-Shot Object Detection via
Self-Supervised Learning [60.64535309016623]
We propose the Incremental-DETR that does incremental few-shot object detection via fine-tuning and self-supervised learning on the DETR object detector.
To alleviate severe over-fitting with few novel class data, we first fine-tune the class-specific components of DETR with self-supervision.
We further introduce a incremental few-shot fine-tuning strategy with knowledge distillation on the class-specific components of DETR to encourage the network in detecting novel classes without catastrophic forgetting.
arXiv Detail & Related papers (2022-05-09T05:08:08Z) - 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) - One-Shot Object Detection without Fine-Tuning [62.39210447209698]
We introduce a two-stage model consisting of a first stage Matching-FCOS network and a second stage Structure-Aware Relation Module.
We also propose novel training strategies that effectively improve detection performance.
Our method exceeds the state-of-the-art one-shot performance consistently on multiple datasets.
arXiv Detail & Related papers (2020-05-08T01:59:23Z)
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.