Assessing the Code Clone Detection Capability of Large Language Models

Zixian Zhang, Takfarinas Saber

Research output: Chapter in Book or Conference Publication/ProceedingConference Publicationpeer-review

9 Citations (Scopus)

Abstract

This study aims to assess the performance of two advanced Large Language Models (LLMs), GPT-3.S and GPT-4, in the task of code clone detection. The evaluation involves testing the models on a variety of code pairs of different clone types and levels of similarity, sourced from two datasets: BigCloneBench (human-made) and GPTCloneBench (LLM-generated). Findings from the study indicate that GPT-4 consistently sur-passes GPT-3.5 across all clone types. A correlation was observed between the GPTs' accuracy at identifying code clones and code similarity, with both GPT models exhibiting low effectiveness in detecting the most complex Type-4 code clones. Additionally, GPT models demonstrate a higher performance identifying code clones in LLM-generated code compared to humans-generated code. However, they do not reach impressive accuracy. These results emphasize the imperative for ongoing enhancements in LLM capabilities, particularly in the recognition of code clones and in mitigating their predisposition towards self-generated code clones-which is likely to become an issue as software engineers are more numerous to leverage LLM-enabled code generation and code refactoring tools.

Original languageEnglish
Title of host publicationICCQ 2024 - Proceedings of the 4th International Conference on Code Quality
EditorsYegor Bugayenko, Anatoly Shalyto
PublisherInstitute of Electrical and Electronics Engineers Inc.
Pages75-83
Number of pages9
ISBN (Electronic)9798350366464
DOIs
Publication statusPublished - 2024
Event4th International Conference on Code Quality, ICCQ 2024 - Innopolis, Russian Federation
Duration: 22 Jun 2024 → …

Publication series

NameICCQ 2024 - Proceedings of the 4th International Conference on Code Quality

Conference

Conference4th International Conference on Code Quality, ICCQ 2024
Country/TerritoryRussian Federation
CityInnopolis
Period22/06/24 → …

Keywords

  • Code Clone Detection
  • GPT-3.5
  • GPT-4
  • Large Language Models (LLMs)
  • Semantic Analysis

Fingerprint

Dive into the research topics of 'Assessing the Code Clone Detection Capability of Large Language Models'. Together they form a unique fingerprint.

Cite this