mlsanityData to 7 Oct 2026

Investigating the Efficacy of Large Language Models for Code Clone Detection

arXiv 2401.13802 ↗First posted 24 Jan 2024cs.SE cs.AI cs.CLcited by 7

Not on the map. Why?

Abstract (arXiv)

Large Language Models (LLMs) have demonstrated remarkable success in various natural language processing and software engineering tasks, such as code generation. The LLMs are mainly utilized in the prompt-based zero/few-shot paradigm to guide the model in accomplishing the task. GPT-based models are one of the popular ones studied for tasks such as code comment generation or test generation. These tasks are `generative' tasks. However, there is limited research on the usage of LLMs for `non-generative' tasks such as classification using the prompt-based paradigm. In this preliminary exploratory study, we investigated the applicability of LLMs for Code Clone Detection (CCD), a non-generative task. By building a mono-lingual and cross-lingual CCD dataset derived from CodeNet, we first investigated two different prompts using ChatGPT to detect Type-4 code clones in Java-Java and Java-Ruby pairs in a zero-shot setting. We then conducted an analysis to understand the strengths and weaknesses of ChatGPT in CCD. ChatGPT surpasses the baselines in cross-language CCD attaining an F1-score of 0.877 and achieves comparable performance to fully fine-tuned models for mono-lingual CCD, with an F1-score of 0.878. Also, the prompt and the difficulty level of the problems has an impact on the performance of ChatGPT. Finally we provide insights and future directions based on our initial analysis

Key facts. Cited by 7 papers in the map (data through 7 Oct 2026). Builds on 11 of its 27 references that are in the map. First posted on arXiv 24 Jan 2024.

Builds on

11 of 27 references.

References · 11

  1. 2020Language Models are Few-Shot Learnerscited by 32,199
  2. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
  3. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
  4. 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 600
  5. 2021Recent Advances in Natural Language Processing via Large Pre-Trained Language Models: A Surveycited by 457
  6. 2022A Systematic Evaluation of Large Language Models of Codecited by 360
  7. 2021SynCoBERT: Syntax-Guided Multi-Modal Contrastive Pre-Training for Code Representationcited by 63
  8. 2022Code Generation Tools (Almost) for Free? A Study of Few-Shot, Pre-Trained Language Models on Codecited by 39
  9. 2023Towards Understanding the Capability of Large Language Models on Code Clone Detection: A Surveycited by 14
  10. 2022Generalizability of Code Clone Detection on CodeBERTcited by 4
  11. 2023Unveiling the potential of large language models in generating semantic and cross-language clonescited by 3

Built on by

Cited by year

Citing papers per year: 2024: 4; 2025: 3.

7 papers.