Unveiling the potential of large language models in generating semantic and cross-language clones
Not on the map. Why?
Abstract (arXiv)
Semantic and Cross-language code clone generation may be useful for code reuse, code comprehension, refactoring and benchmarking. OpenAI's GPT model has potential in such clone generation as GPT is used for text generation. When developers copy/paste codes from Stack Overflow (SO) or within a system, there might be inconsistent changes leading to unexpected behaviours. Similarly, if someone possesses a code snippet in a particular programming language but seeks equivalent functionality in a different language, a semantic cross-language code clone generation approach could provide valuable assistance. In this study, using SemanticCloneBench as a vehicle, we evaluated how well the GPT-3 model could help generate semantic and cross-language clone variants for a given fragment.We have comprised a diverse set of code fragments and assessed GPT-3s performance in generating code variants.Through extensive experimentation and analysis, where 9 judges spent 158 hours to validate, we investigate the model's ability to produce accurate and semantically correct variants. Our findings shed light on GPT-3's strengths in code generation, offering insights into the potential applications and challenges of using advanced language models in software development. Our quantitative analysis yields compelling results. In the realm of semantic clones, GPT-3 attains an impressive accuracy of 62.14% and 0.55 BLEU score, achieved through few-shot prompt engineering. Furthermore, the model shines in transcending linguistic confines, boasting an exceptional 91.25% accuracy in generating cross-language clones
Key facts. Cited by 3 papers in the map (data through 14 Oct 2026). Builds on 11 of its 48 references that are in the map. First posted on arXiv 12 Sep 2023.
Builds on
11 of 48 references.
References · 11
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2022Competition-Level Code Generation with AlphaCodecited by 1,462
- 2018Oreo: Detection of Clones in the Twilight Zonecited by 19
- 2017Do Code Clones Matter?cited by 12
- 2023GPTCloneBench: A comprehensive benchmark of semantic clones and cross-language clones using GPT-3 model and SemanticCloneBenchcited by 11
- 2022Towards Exploring the Code Reuse from Stack Overflow during Software Developmentcited by 5
- 2018SOTorrent: Studying the Origin, Evolution, and Usage of Stack Overflow Code Snippetscited by 4
- 2018On the Use of Context in Recommending Exception Handling Code Examplescited by 3
- 2020The Vision of Software Clone Management: Past, Present, and Futurecited by 2
- 2018Are There Functionally Similar Code Clones in Practice?cited by 1
Built on by
Citing papers per year: 2024: 2; 2025: 0; 2026: 1.
3 papers.