基于反馈的可并行神经代码生成
Compilable Neural Code Generation with Compiler Feedback
摘要:
自动生成具有(或不具有)自然语言描述的可编译程序一直是计算语言学和自动化软件工程的试金石问题。现有的深度学习方法将代码生成建模为文本生成,或者由解码器中的语法结构约束,或者由在大规模代码语料库上预先训练的语言模型驱动(例如,CodeGPT、PLBART和CodeT5)。然而,他们中的一些帐户的编译生成的程序。为了提高生成程序的可编译性,本文提出了一种利用编译器反馈进行可编译代码生成的三级流水线COMPCODER,包括语言模型微调、可编译性增强和可编译性判别。两个代码生成任务的综合实验表明,我们提出的方法的有效性,提高编译成功率从44.18到89.18在代码完成的平均和从70.3到96.2,分别在文本到代码生成,当与最先进的CodeGPT相比。
英文摘要:
Automatically generating compilable programs with (or without) natural language descriptions has always been a touchstone problem for computational linguistics and automated software engineering. Existing deep-learning approaches model code generation as text generation, either constrained by grammar structures in decoder, or driven by pre-trained language models on large-scale code corpus (e.g., CodeGPT, PLBART, and CodeT5). However, few of them account for compilability of the generated programs. To improve compilability of the generated programs, this paper proposes COMPCODER, a three-stage pipeline utilizing compiler feedback for compilable code generation, including language model fine-tuning, compilability reinforcement, and compilability discrimination. Comprehensive experiments on two code generation tasks demonstrate the effectiveness of our proposed approach, improving the success rate of compilation from 44.18 to 89.18 in code completion on average and from 70.3 to 96.2 in text-to-code generation, respectively, when comparing with the state-of-the-art CodeGPT.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。