arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 1812.06469cs.SEcs.LG
收藏

代码的机器学习模型中代码重复的不利影响

The Adverse Effects of Code Duplication in Machine Learning Models of Code

Microsoft Research(微软研究院)

Miltiadis Allamanis

摘要:

大代码领域依赖于挖掘大型代码库来执行一些学习任务。Lopes等人(2017)最近发现了这种方法的一个重大威胁,他在GitHub上发现了大量近乎重复的代码。然而,为源代码设计机器学习模型的研究人员并没有注意到代码重复的影响。在这项工作中,我们探讨了代码重复对机器学习模型的影响,表明在重复代码语料库上进行测试时,与去重复语料库的性能相比,报告的性能指标有时会膨胀高达100%,这更准确地代表了软件工程师如何使用机器学习模型。我们为广泛使用的数据集提供了一个重复索引,列出了收集代码语料库和评估机器学习模型的最佳实践。最后,我们发布工具,以帮助社区在未来的研究中避免这个问题。

英文摘要:

The field of big code relies on mining large corpora of code to perform some learning task. A significant threat to this approach has been recently identified by Lopes et al. (2017) who found a large amount of near-duplicate code on GitHub. However, the impact of code duplication has not been noticed by researchers devising machine learning models for source code. In this work, we explore the effects of code duplication on machine learning models showing that reported performance metrics are sometimes inflated by up to 100% when testing on duplicated code corpora compared to the performance on de-duplicated corpora which more accurately represent how machine learning models of code are used by software engineers. We present a duplication index for widely used datasets, list best practices for collecting code corpora and evaluating machine learning models on them. Finally, we release tools to help the community avoid this problem in future research.

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

↑