Automated Type-IV Clone Generation via LLMs and Deterministic Validation
Luciano Marchezan, Eugene Syriani, Kévin Delcourt, Houari Sahraoui
Key points
From the paper's conclusion- We present an automated approach for generating Type-IV clones by leveraging large language models (LLMs) with deterministic testing and filtering. The approach normalizes input code, produces diverse clone candidates through customizable prompts, and ensures semantic equivalence via automated testing and syntactic diversity through CodeBLEU-based filtering. Representative unique clones are then selected by clustering.
- Results show that the generated clones improve Type-IV clone detection across different programming languages.
- The generated clones improve Type-IV clone detection across different programming languages.
Abstract
Detecting Type-IV code clones, functionally equivalent fragments with different syntax, remains a major challenge for quality assurance. Existing datasets are limited in supporting semantic clone detection due to class imbalance, lack of verified functional equivalence, and data redundancy. We present an automated approach for generating Type-IV clones by leveraging large language models (LLMs) with deterministic testing and filtering. The approach normalizes input code, produces diverse clone candidates through customizable prompts, and ensures semantic equivalence via automated testing and syntactic diversity through CodeBLEU-based filtering. Representative unique clones are then selected by clustering. We evaluate the extent to which LLMs generate diverse Python Type-IV clones, how prompt and generation factors affect quality and efficiency, the retention of only Type-IV clones at the final dataset, and the usefulness of the resulting dataset for fine-tuning embedding models. Results show that the generated clones improve Type-IV clone detection across different programming languages.
Read the paper
Discussion · 1
Science Skim's AI key points, plus readers' public thoughts
- We present an automated approach for generating Type-IV clones by leveraging large language models (LLMs) with deterministic testing and filtering. The approach normalizes input code, produces diverse clone candidates through customizable prompts, and ensures semantic equivalence via automated testing and syntactic diversity through CodeBLEU-based filtering. Representative unique clones are then selected by clustering.
- Results show that the generated clones improve Type-IV clone detection across different programming languages.
- The generated clones improve Type-IV clone detection across different programming languages.
Readers' thoughts
No reader thoughts yet.
Related papers
- DivAlgo: A systematic evaluation of algorithmic diversity for code generation modelsarXiv · 2026
- LLM See, LLM Do: Enhancing Repository-Aware Code Generation in LLMs Through Logical Context and Usage KnowledgeACM Transactions on Software Engineering and Methodology · 2026
- SPARK: Semantic-preserving Prompt Mutation for Code Generation using Consensus-based Verification FrameworkarXiv · 2026
- Micro Operational Robustness of LLMs on Code GenerationarXiv · 2026
- Understanding code semantics: a benchmark study of LLMsInternational Journal on Software Tools for Technology Transfer · 2026
- A Low Similarity Score Does Not Show Independence after Source-Conditioned Repository RewritingarXiv · 2026