Grote Taalmodellen voor Code Slagen Er Niet In Code Met Mogelijke Bugs Af Te Maken
Large Language Models of Code Fail at Completing Code with Potential Bugs
June 6, 2023
Auteurs: Tuan Dinh, Jinman Zhao, Samson Tan, Renato Negrinho, Leonard Lausen, Sheng Zha, George Karypis
cs.AI
Samenvatting
Grote taalmodellen voor code (Code-LLM's) hebben recentelijk enorme vooruitgang geboekt op het gebied van codecompletering, een fundamentele functie van programmeerassistentie en code-intelligentie. De meeste bestaande werken negeren echter de mogelijke aanwezigheid van bugs in de codecontext voor generatie, wat onvermijdelijk is in softwareontwikkeling. Daarom introduceren en bestuderen we het probleem van buggy-codecompletering, geïnspireerd door het realistische scenario van real-time codesuggesties waarbij de codecontext potentiële bugs bevat — anti-patronen die bugs kunnen worden in het voltooide programma. Om de taak systematisch te bestuderen, introduceren we twee datasets: één met synthetische bugs afgeleid van semantiek-veranderende operatorwijzigingen (buggy-HumanEval) en één met realistische bugs afgeleid van gebruikersinzendingen voor coderingsproblemen (buggy-FixEval). We constateren dat de aanwezigheid van potentiële bugs de generatieprestaties van de hoogpresterende Code-LLM's aanzienlijk verslechtert. Zo dalen de slaagpercentages van CodeGen-2B-mono op testgevallen van buggy-HumanEval met meer dan 50% bij een enkele potentiële bug in de context. Ten slotte onderzoeken we verschillende post-hoc methoden om het nadelige effect van potentiële bugs te mitigeren en concluderen we dat er een groot gat blijft in de prestaties na mitigatie.
English
Large language models of code (Code-LLMs) have recently brought tremendous
advances to code completion, a fundamental feature of programming assistance
and code intelligence. However, most existing works ignore the possible
presence of bugs in the code context for generation, which are inevitable in
software development. Therefore, we introduce and study the buggy-code
completion problem, inspired by the realistic scenario of real-time code
suggestion where the code context contains potential bugs -- anti-patterns that
can become bugs in the completed program. To systematically study the task, we
introduce two datasets: one with synthetic bugs derived from semantics-altering
operator changes (buggy-HumanEval) and one with realistic bugs derived from
user submissions to coding problems (buggy-FixEval). We find that the presence
of potential bugs significantly degrades the generation performance of the
high-performing Code-LLMs. For instance, the passing rates of CodeGen-2B-mono
on test cases of buggy-HumanEval drop more than 50% given a single potential
bug in the context. Finally, we investigate several post-hoc methods for
mitigating the adverse effect of potential bugs and find that there remains a
large gap in post-mitigation performance.