In software development, duplicating some parts of the source code is called code cloning. Code cloning enables the source code reuse instead of developing these parts from scratch. This practice allows for reusing existing source code rather than constructing these segments anew, thereby boosting software productivity. Nonetheless, code cloning comes with potential drawbacks, including the introduction of bugs, complications in code refactoring, and an escalation in maintenance costs. Consequently, the identification of code clones, known as code clone detection (CCD), holds significant importance in the software industry. Various tools for CCD employ diverse approaches, such as text-based, semantic-based, and syntax-based tools. However, these techniques encounter challenges, including generating false positives and negatives, difficulty identifying clone types, and dependence on specific programming languages. Therefore, this chapter introduces an innovative approach that aims to improve the capabilities of existing LLMs to detect different clone types. The technique includes a fine-tuning phase and introduces additional learning layers to the existing architecture of LLMs. The proposed approach is applied to two LLMs to fine-tune their performance for the clone detection task. The experimental evaluation showed that the proposed technique could improve the model performance and create comprehensive code clone detection systems.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Enhancing Large Language Models for Improved Code Clone Detection: A Fine-Tuning Approach

  • Reem Amin,
  • Mona Nashaat,
  • Ahmed Hosny Eid,
  • Rabab F. Abdel-Kader

摘要

In software development, duplicating some parts of the source code is called code cloning. Code cloning enables the source code reuse instead of developing these parts from scratch. This practice allows for reusing existing source code rather than constructing these segments anew, thereby boosting software productivity. Nonetheless, code cloning comes with potential drawbacks, including the introduction of bugs, complications in code refactoring, and an escalation in maintenance costs. Consequently, the identification of code clones, known as code clone detection (CCD), holds significant importance in the software industry. Various tools for CCD employ diverse approaches, such as text-based, semantic-based, and syntax-based tools. However, these techniques encounter challenges, including generating false positives and negatives, difficulty identifying clone types, and dependence on specific programming languages. Therefore, this chapter introduces an innovative approach that aims to improve the capabilities of existing LLMs to detect different clone types. The technique includes a fine-tuning phase and introduces additional learning layers to the existing architecture of LLMs. The proposed approach is applied to two LLMs to fine-tune their performance for the clone detection task. The experimental evaluation showed that the proposed technique could improve the model performance and create comprehensive code clone detection systems.