arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2402.07523cs.SE
收藏

使用集成推理提高克隆检测的召回率

Using Ensemble Inference to Improve Recall of Clone Detection

Gul Aftab Ahmed, James Vincent Patten, Yuanhua Han, Guoxian Lu, David Gregg, Jim Buckley, Muslim Chochlov

AI总结:

本文提出使用集成推理结合多个神经网络模型来提升大规模源代码克隆检测的召回率,实验证明集成方法优于单个模型,且基于CodeBERT和CodeT5的集成组合在保护隐私的同时保持了较高性能。

摘要:

大规模源代码克隆检测是一项具有挑战性的任务。在我们之前的工作中,我们提出了一种方法(SSCD),该方法利用人工神经网络并近似最近邻搜索,以时间高效的方式有效地定位大规模代码体中的克隆。然而,我们的文献回顾表明,在大规模克隆检测方法的背景下,尚未评估不同神经网络的相对效能。在这项工作中,我们旨在单独评估几个此类模型,以最大化召回率,同时在克隆检测过程中保持高精确度。我们研究集成推理(在这种情况下,结合使用多个这些神经网络模型的结果)是否可以进一步协助此任务。为了评估这一点,我们采用了四个最先进的神经网络模型,并分别/组合评估了它们。在包含大约500K行C/C++代码的说明性数据集上的结果表明,就召回率而言,集成推理在所有尝试的案例中都优于单个模型。在单个模型中,ADA模型(属于ChatGPT模型家族)具有最佳性能。然而,商业公司可能不愿意按照该方法的要求将其专有源代码交给云端。因此,他们可能对基于CodeBERT和CodeT5模型的集成组合更感兴趣,从而产生相似(如果略低)的召回率和精确度结果。

英文摘要:

Large-scale source-code clone detection is a challenging task. In our previous work, we proposed an approach (SSCD) that leverages artificial neural networks and approximates nearest neighbour search to effectively and efficiently locate clones in large-scale bodies of code, in a time-efficient manner. However, our literature review suggests that the relative efficacy of differing neural network models has not been assessed in the context of large-scale clone detection approaches. In this work, we aim to assess several such models individually, in terms of their potential to maximize recall, while preserving a high level of precision during clone detection. We investigate if ensemble inference (in this case, using the results of more than one of these neural network models in combination) can further assist in this task. To assess this, we employed four state-of-the-art neural network models and evaluated them individually/in combination. The results, on an illustrative dataset of approximately 500K lines of C/C++ code, suggest that ensemble inference outperforms individual models in all trialled cases, when recall is concerned. Of individual models, the ADA model (belonging to the ChatGPT family of models) has the best performance. However commercial companies may not be prepared to hand their proprietary source code over to the cloud, as required by that approach. Consequently, they may be more interested in an ensemble-combination of CodeBERT-based and CodeT5 models, resulting in similar (if slightly lesser) recall and precision results.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑