Challenging Machine Learning-based Clone Detectors via Semantic-preserving Code Transformations
Not on the map. Why?
Abstract (arXiv)
Software clone detection identifies similar code snippets. It has been an active research topic that attracts extensive attention over the last two decades. In recent years, machine learning (ML) based detectors, especially deep learning-based ones, have demonstrated impressive capability on clone detection. It seems that this longstanding problem has already been tamed owing to the advances in ML techniques. In this work, we would like to challenge the robustness of the recent ML-based clone detectors through code semantic-preserving transformations. We first utilize fifteen simple code transformation operators combined with commonly-used heuristics (i.e., Random Search, Genetic Algorithm, and Markov Chain Monte Carlo) to perform equivalent program transformation. Furthermore, we propose a deep reinforcement learning-based sequence generation (DRLSG) strategy to effectively guide the search process of generating clones that could escape from the detection. We then evaluate the ML-based detectors with the pairs of original and generated clones. We realize our method in a framework named CloneGen. CloneGen In evaluation, we challenge the two state-of-the-art ML-based detectors and four traditional detectors with the code clones after semantic-preserving transformations via the aid of CloneGen. Surprisingly, our experiments show that, despite the notable successes achieved by existing clone detectors, the ML models inside these detectors still cannot distinguish numerous clones produced by the code transformations in CloneGen. In addition, adversarial training of ML-based clone detectors using clones generated by CloneGen can improve their robustness and accuracy. CloneGen Meanwhile, compared with the commonly-used heuristics, the DRLSG strategy has shown the best effectiveness in generating code clones to decrease the detection accuracy of the ML-based detectors.
Key facts. Cited by 15 papers in the map (data through 7 Oct 2026). First posted on arXiv 21 Nov 2021.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2022: 1; 2023: 3; 2024: 3; 2025: 6; 2026: 2.
15 papers.
Sort:
By area:
- 2023CodeMark: Imperceptible Watermarking for Code Datasets against Neural Code Completion Modelscited by 28
- 2025Can LLMs Reason About Program Semantics? A Comprehensive Evaluation of LLMs on Formal Specification Inferencecited by 14
- 2023Pitfalls in Language Models for Code Intelligence: A Taxonomy and Surveycited by 9
- 2024Towards Reliable Evaluation of Neural Program Repair with Natural Robustness Testingcited by 5
- 2025Detection of LLM-Paraphrased Code and Identification of the Responsible LLM Using Coding Style Featurescited by 4
- 2022NeuDep: Neural Binary Memory Dependence Analysiscited by 3
- 2023Adversarial Attacks against Binary Similarity Systemscited by 3
- 2025Revisiting Pre-trained Language Models for Vulnerability Detectioncited by 3
- 2026HogVul: Black-box Adversarial Code Generation Framework Against LM-based Vulnerability Detectorscited by 3
- 2024On the Lack of Robustness of Binary Function Similarity Systemscited by 2
- 2024LLM App Squatting and Cloningcited by 1
- 2025Feedback Loops and Code Perturbations in LLM-based Software Engineering: A Case Study on a C-to-Rust Translation Systemcited by 0
- 2026Type-IV Code Clone Detection via Layer-Wise Non-Contrastive Representation Learning15 Sep 2026
- 2026HogVul: Black-box Adversarial Code Generation Framework Against LM-based Vulnerability Detectors9 Jan 2026
- 2025How Do Semantically Equivalent Code Transformations Impact Membership Inference on LLMs for Code?17 Dec 2025
- 2025Auto-SPT: Automating Semantic Preserving Transformations for Code5 Dec 2025
- 2025Feedback Loops and Code Perturbations in LLM-based Software Engineering: A Case Study on a C-to-Rust Translation System2 Dec 2025
- 2025Revisiting Pre-trained Language Models for Vulnerability Detection22 Jul 2025
- 2025Detection of LLM-Paraphrased Code and Identification of the Responsible LLM Using Coding Style Features25 Feb 2025
- 2025Can LLMs Reason About Program Semantics? A Comprehensive Evaluation of LLMs on Formal Specification Inference22 Feb 2025
- 2024On the Lack of Robustness of Binary Function Similarity Systems5 Dec 2024
- 2024LLM App Squatting and Cloning12 Nov 2024
- 2024Towards Reliable Evaluation of Neural Program Repair with Natural Robustness Testing19 Feb 2024
- 2023Pitfalls in Language Models for Code Intelligence: A Taxonomy and Survey27 Oct 2023
3 more
- 2023Pitfalls in Language Models for Code Intelligence: A Taxonomy and Surveycited by 9
- 2024Towards Reliable Evaluation of Neural Program Repair with Natural Robustness Testingcited by 5
- 2025Detection of LLM-Paraphrased Code and Identification of the Responsible LLM Using Coding Style Featurescited by 4
- 2022NeuDep: Neural Binary Memory Dependence Analysiscited by 3
- 2023Adversarial Attacks against Binary Similarity Systemscited by 3
- 2025Revisiting Pre-trained Language Models for Vulnerability Detectioncited by 3
- 2026HogVul: Black-box Adversarial Code Generation Framework Against LM-based Vulnerability Detectorscited by 3
- 2024On the Lack of Robustness of Binary Function Similarity Systemscited by 2
- 2024LLM App Squatting and Cloningcited by 1
- 2025Feedback Loops and Code Perturbations in LLM-based Software Engineering: A Case Study on a C-to-Rust Translation Systemcited by 0
- 2025Auto-SPT: Automating Semantic Preserving Transformations for Codecited by 0
- 2026Type-IV Code Clone Detection via Layer-Wise Non-Contrastive Representation Learningcited by 0
- 2026Type-IV Code Clone Detection via Layer-Wise Non-Contrastive Representation Learning15 Sep 2026
- 2026HogVul: Black-box Adversarial Code Generation Framework Against LM-based Vulnerability Detectors9 Jan 2026
- 2025Auto-SPT: Automating Semantic Preserving Transformations for Code5 Dec 2025
- 2025Feedback Loops and Code Perturbations in LLM-based Software Engineering: A Case Study on a C-to-Rust Translation System2 Dec 2025
- 2025Revisiting Pre-trained Language Models for Vulnerability Detection22 Jul 2025
- 2025Detection of LLM-Paraphrased Code and Identification of the Responsible LLM Using Coding Style Features25 Feb 2025
- 2024On the Lack of Robustness of Binary Function Similarity Systems5 Dec 2024
- 2024LLM App Squatting and Cloning12 Nov 2024
- 2024Towards Reliable Evaluation of Neural Program Repair with Natural Robustness Testing19 Feb 2024
- 2023Pitfalls in Language Models for Code Intelligence: A Taxonomy and Survey27 Oct 2023
- 2023Adversarial Attacks against Binary Similarity Systems20 Mar 2023
- 2022NeuDep: Neural Binary Memory Dependence Analysis4 Oct 2022