arrow
Return

Code Clone Detection Techniques Based on Large Language Models

delete2025-01-01
delete0
delete
OA
AI
A
Afnan A. Almatrafi *
F
Fathy Eassa
S
Sanaa Sharaf
DOI:10.1109/ACCESS.2025.3549780delete
deleteOriginal
deleteShare
deleteSave
Abstract

Abstract

En 中文
Code duplication, commonly known as code cloning, is a persistent challenge in software development. While reusing code fragments boosts productivity, excessive cloning poses challenges to maintenance and elevates the risk of bugs. Therefore, integrating code clone detection into the development process is crucial. The extensive code-related knowledge inherent in Large Language Models (LLMs) renders them high-potential candidates for addressing diverse software engineering challenges. However, the effectiveness of LLMs in the specific task of code clone detection requires precise evaluation. This paper proposes an innovative methodology leveraging few-shot instruction-tuned GPT-3.5 Turbo and GPT-4 to detect code clones across all types, focusing on complex clones (Type-3 and Type-4). Unlike conventional approaches confined to specific language pairs or tasks, our method employs versatile language models, showcases generalization strengths for semantic understanding, and leverages instruction tuning with few-shot inference for task-specific adaptability in code clone detection. A conversational dataset was crafted from BigCloneBench for instruction tuning, enhancing task alignment and performance. This study evaluates the proficiency of LLMs in identifying code clones, analyzing the impact of instruction tuning, and assessing the efficiency across various clone types. Experimental results demonstrate these models achieving competitive performance against existing tools for overall and complex clone detection. Integration into an Integrated Development Environment (IDE) enables real-time detection and automated refactoring, bridging the gap between theoretical advancements and practical usability. This work highlights the potential of generalized LLMs setting a new standard in a field traditionally dominated by specialized tools and demonstrates their adaptability for complex challenges in code analysis and maintainability.
Keywords:
Clone detection
code duplication
fine-tuning
fine-tuning
instruction tuning
instruction tuning
large language models
large language models
natural language processing
natural language processing
transformers
transformers
transformers
Make Large Language Models Efficient: A Review
err2025-01-01
err0
errOAAI
errAman Mussa; Zhanseit Tuimebayev; Madina Mansurova
errShare
errSave
Structure-Aware Lightweight Document-Level Event Extraction via Code-Based Large Language Models
err2026-03-12
err0
errOAAI
errXing Xu; Jianbin Zhao; Pengfei Zhang; Yaduo Liu; Bingyang Yu; Puyuan Zheng; Dingyuan Hu; Zhongchen Deng; Ping Zong; Yifan Zhu
errShare
errSave
Refining medical large language models: key insights from instruction tuning
err2025-09-23
err0
errOAAI
errAlqahtani, Muneerah Q.; Albarakati, Abdullah; Alotaibi, Fahd
errShare
errSave
AXpert: human expert facilitated privacy-preserving large language models for abdominal X-ray report labeling
err2025-02-10
err0
errOAAI
errKohne, Joseph G.; Webster, Katherine; Vartanian, Rebecca; Wittrup, Emily; Najarian, Kayvan
errShare
errSave
Instruction Tuning for Large Language Models: A Survey
err2026-05-01
err14
PREAI
errZhang, Shengyu; Dong, Linfeng; Li, Xiaoya; Zhang, Sen; Sun, Xiaofei; Wang, Shuhe; Li, Jiwei; Hu, Runyi; Zhang, Tianwei; Wang, Guoyin; Wu, Fei
errShare
errSave

Journal

IEEE Access cover
IEEE Access
IF:
3.6
Papers:
10.1W
Citations:
36.3W

Organization

K
King Abdulaziz University
Scholars:
1.3K
Papers: 674
Citations: 1.2W
Cited Papers

Cited Papers

No cited papers available