Evaluation of code clone detection using large language models

Code clone detection has extensive and critical applications in software metrics, plagiarism detection, aspect mining, code compression, and software supply chain vulnerability detection. Traditional token-based and tree-based clone detection methods are effective for syntactically similar clones. However, they often struggle to detect semantic clones—code segments that are semantically and functionally equivalent but syntactically distinct—since functionality similarity is not immediately apparent from syntax alone. This study explores the potential of large language models (LLMs) for code clone detection. By inputting code pairs into LLMs alongside prompt engineering techniques, we evaluated the capacity of LLMs to identify different types of code clones. Through comparative analyses of accuracy and recall rates between LLM-based methods and traditional token-based and tree-based approaches across various code clone types, we aimed to assess the advantages, limitations, and unique capabilities of LLMs in handling complex code similarity tasks. Experimental results demonstrate that LLMs outperform traditional methods in detecting semantic clones, achieving an accuracy of up to 100% and a recall rate of up to 92%, underscoring their value in modern software engineering practices. However, LLMs still face limitations, particularly in detecting semantic clones with significant structural differences, necessitating further improvements in future research.

Authors

Institutions

Publication Details

Journal
IET conference proceedings.
Published
2025-04-09
DOI
https://doi.org/10.1049/icp.2025.1037
Citations
1
Primary Topic
Software Engineering Research
Type
article
Field-Weighted Citation Impact
3.25
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Evaluation of code clone detection using large language models

Xinyi Wang
1 citations
IET conference proceedings.
Software Engineering Research
3.25
article

Evaluation of code clone detection using large language models

Xinyi Wang
article en
1 citations

Abstract

Code clone detection has extensive and critical applications in software metrics, plagiarism detection, aspect mining, code compression, and software supply chain vulnerability detection. Traditional token-based and tree-based clone detection methods are effective for syntactically similar clones. However, they often struggle to detect semantic clones—code segments that are semantically and functionally equivalent but syntactically distinct—since functionality similarity is not immediately apparent from syntax alone. This study explores the potential of large language models (LLMs) for code clone detection. By inputting code pairs into LLMs alongside prompt engineering techniques, we evaluated the capacity of LLMs to identify different types of code clones. Through comparative analyses of accuracy and recall rates between LLM-based methods and traditional token-based and tree-based approaches across various code clone types, we aimed to assess the advantages, limitations, and unique capabilities of LLMs in handling complex code similarity tasks. Experimental results demonstrate that LLMs outperform traditional methods in detecting semantic clones, achieving an accuracy of up to 100% and a recall rate of up to 92%, underscoring their value in modern software engineering practices. However, LLMs still face limitations, particularly in detecting semantic clones with significant structural differences, necessitating further improvements in future research.

IET conference proceedings.Vol. 2025(2)
Xidian University (CN)
Openalex Percentile: Top 10%
Software Engineering Research
3.25
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Evaluation of code clone detection using large language models — Xinyi Wang · IET conference proceedings. (2025) | TGRS Research Map | TGRS