On the Use of Deep Learning Models for Semantic Clone Detection
Bibliographic record
Abstract
Detecting and tracking code clones can ease various software development and maintenance tasks when changes in a code fragment should be propagated over all its copies. Several deep learning based clone detection models have appeared in the literature for detecting syntactic and semantic clones, and these models have widely been evaluated with the BigCloneBench dataset. However, the class imbalance and small number of semantic clones make BigCloneBench less ideal when interpreting the model performances. Sometimes researchers use a few other semantic clone datasets such as GoogleCodeJam, OJClone and SemanticCloneBench to understand a model's generalizability. To overcome the limitations of the existing datasets, recently a GPT-assisted large semantic and cross-language clone dataset GPT-CloneBench has been released, but it is not clear how all these models would compare and contrast in terms of these datasets. In this paper, we propose a multi-step evaluation approach for five state-of-the-art clone detection models leveraging existing bench-mark datasets including the recently proposed GPTCloneBench and exploiting the mutation operators to study the extent of these clone detection models' ability. More specifically, we examined the performance of three highly-performing single-language clone detection models (ASTNN, GMN, CodeBERT) that use various code representations (e.g., AST, flow augmented AST with graph matching network, and bidirectional encoder representation) for detecting semantic clones. In addition to using BigCloneBench, we tested them on SemanticCloneBench and GPTCloneBench, investigated their robustness under mutation operations, and examined them against cutting-edge cross-language clone detection tools (C4, CLCDSA) that are also known to learn semantic clones. While all single-language models showed high F1 scores for BigCloneBench, their performances varied quite differently (sometimes over 20%) when tested on SemanticCloneBench. Interestingly, the cross-language model (C4) consistently showed superior performance (around 7%) on SemanticCloneBench over other models and performed similarly for BigCloneBench and GPTCloneBench. On mutation-based datasets, C4 appeared to have a more robust performance (less than 1% difference) whereas single-language models showed high variability.
Fetched live from OpenAlex and de-inverted. Abstracts are not stored in this database: the inverted indexes are 8.6 GB of the frame’s 9.3 GB of text, and the host has 13 GB free.
How this classification was reachedexpand
Full frame distilled prediction
Teacher imitationNot calibrated prevalence, not ground truth. Human validation pending. Learned from the 10,348 direct Codex labels and 10,348 direct Gemma labels. Candidate is the union of thresholded teacher heads; consensus is their intersection. These outputs are machine_predicted_unvalidated and are not human labels or direct frontier model labels.
Codex and Gemma teacher scores by category
| Category | Codex | Gemma |
|---|---|---|
| Metaresearch | 0.000 | 0.000 |
| Meta-epidemiology (narrow) | 0.000 | 0.000 |
| Meta-epidemiology (broad) | 0.000 | 0.000 |
| Bibliometrics | 0.000 | 0.000 |
| Science and technology studies | 0.000 | 0.000 |
| Scholarly communication | 0.000 | 0.000 |
| Open science | 0.000 | 0.000 |
| Research integrity | 0.000 | 0.000 |
| Insufficient payload (model declined to judge) | 0.000 | 0.000 |
Machine scores (provisional)
The two teacher heads of the student model, read on this work. A score orders the frame for review; it never asserts a category, and the validation status ships verbatim with every row.
Baseline scores from an immature model (maturity gate not passed, 7 training rounds). Scores rank; they never assert a category.
score_only:v0-immature-baseline · verbatim from the scoring run: score_only means the number may rank works, and no category label ships from itClassification
machine, unvalidatedMachine predicted; a candidate call from one teacher head, not a consensus.
How this classification was reached, model by model and score by score, is at the end of the page under "How this classification was reached".