Selecting and Combining Large Language Models for Scalable Code Clone Detection

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Chochlov, Muslim, Ahmed, Gul Aftab, Patten, James Vincent, Han, Yuanhua, Lu, Guoxian, Gregg, David, Buckley, Jim
Formato: Preprint
Publicado: 2025
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866918162523488256
author Chochlov, Muslim
Ahmed, Gul Aftab
Patten, James Vincent
Han, Yuanhua
Lu, Guoxian
Gregg, David
Buckley, Jim
author_facet Chochlov, Muslim
Ahmed, Gul Aftab
Patten, James Vincent
Han, Yuanhua
Lu, Guoxian
Gregg, David
Buckley, Jim
contents Source code clones pose risks ranging from intellectual property violations to unintended vulnerabilities. Effective and efficient scalable clone detection, especially for diverged clones, remains challenging. Large language models (LLMs) have recently been applied to clone detection tasks. However, the rapid emergence of LLMs raises questions about optimal model selection and potential LLM-ensemble efficacy. This paper addresses the first question by identifying 76 LLMs and filtering them down to suitable candidates for large-scale clone detection. The candidates were evaluated on two public industrial datasets, BigCloneBench, and a commercial large-scale dataset. No uniformly 'best-LLM' emerged, though CodeT5+110M, CuBERT and SPTCode were top-performers. Analysis of LLM-candidates suggested that smaller embedding sizes, smaller tokenizer vocabularies and tailored datasets are advantageous. On commercial large-scale dataset a top-performing CodeT5+110M achieved 39.71\% precision: twice the precision of previously used CodeBERT. To address the second question, this paper explores ensembling of the selected LLMs: effort-effective approach to improving effectiveness. Results suggest the importance of score normalization and favoring ensembling methods like maximum or sum over averaging. Also, findings indicate that ensembling approach can be statistically significant and effective on larger datasets: the best-performing ensemble achieved even higher precision of 46.91\% over individual LLM on the commercial large-scale code.
format Preprint
id arxiv_https___arxiv_org_abs_2510_15480
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Selecting and Combining Large Language Models for Scalable Code Clone Detection
Chochlov, Muslim
Ahmed, Gul Aftab
Patten, James Vincent
Han, Yuanhua
Lu, Guoxian
Gregg, David
Buckley, Jim
Software Engineering
Artificial Intelligence
Source code clones pose risks ranging from intellectual property violations to unintended vulnerabilities. Effective and efficient scalable clone detection, especially for diverged clones, remains challenging. Large language models (LLMs) have recently been applied to clone detection tasks. However, the rapid emergence of LLMs raises questions about optimal model selection and potential LLM-ensemble efficacy. This paper addresses the first question by identifying 76 LLMs and filtering them down to suitable candidates for large-scale clone detection. The candidates were evaluated on two public industrial datasets, BigCloneBench, and a commercial large-scale dataset. No uniformly 'best-LLM' emerged, though CodeT5+110M, CuBERT and SPTCode were top-performers. Analysis of LLM-candidates suggested that smaller embedding sizes, smaller tokenizer vocabularies and tailored datasets are advantageous. On commercial large-scale dataset a top-performing CodeT5+110M achieved 39.71\% precision: twice the precision of previously used CodeBERT. To address the second question, this paper explores ensembling of the selected LLMs: effort-effective approach to improving effectiveness. Results suggest the importance of score normalization and favoring ensembling methods like maximum or sum over averaging. Also, findings indicate that ensembling approach can be statistically significant and effective on larger datasets: the best-performing ensemble achieved even higher precision of 46.91\% over individual LLM on the commercial large-scale code.
title Selecting and Combining Large Language Models for Scalable Code Clone Detection
topic Software Engineering
Artificial Intelligence
url https://arxiv.org/abs/2510.15480