arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2303.11455cs.SEcs.CLcs.LG
收藏

大语言模型和简单愚蠢的bug

Large Language Models and Simple, Stupid Bugs

UC Davis(加州大学戴维斯分校)

Kevin Jesse, Toufique Ahmed, Premkumar T. Devanbu, Emily Morgan

摘要:

随着强大的神经语言模型的出现,基于AI的系统,以协助开发人员在编码任务变得越来越普遍; Copilot就是这样一个系统。Copilot使用Codex(一种大语言模型(LLM))来完成基于前面的“提示”的代码。然而,Codex是在公共GitHub存储库上训练的,即,可能包含错误和漏洞的代码。以前的研究[1],[2]表明Codex重现了训练中看到的漏洞。在这项研究中,我们研究了Codex如何容易生成一个有趣的错误类别,单一语句错误,通常被称为简单的,愚蠢的错误或SStubs在MSR社区。我们发现Codex和类似的LLM确实有助于避免一些SStuB,但确实产生了已知的、逐字的SStuB,其可能性是已知的、逐字正确的代码的2倍。我们探讨的法典产生的SStubs的后果,并提出避免策略,建议减少生产已知的,逐字SStubs的可能性,并增加生产已知的,逐字修复的可能性。

英文摘要:

With the advent of powerful neural language models, AI-based systems to assist developers in coding tasks are becoming widely available; Copilot is one such system. Copilot uses Codex, a large language model (LLM), to complete code conditioned on a preceding "prompt". Codex, however, is trained on public GitHub repositories, viz., on code that may include bugs and vulnerabilities. Previous studies [1], [2] show Codex reproduces vulnerabilities seen in training. In this study, we examine how prone Codex is to generate an interesting bug category, single statement bugs, commonly referred to as simple, stupid bugs or SStuBs in the MSR community. We find that Codex and similar LLMs do help avoid some SStuBs, but do produce known, verbatim SStuBs as much as 2x as likely than known, verbatim correct code. We explore the consequences of the Codex generated SStuBs and propose avoidance strategies that suggest the possibility of reducing the production of known, verbatim SStubs, and increase the possibility of producing known, verbatim fixes.

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

↑