CodeFusion:一种用于代码生成的预训练扩散模型
CodeFusion: A Pre-trained Diffusion Model for Code Generation
AI总结:
针对自回归代码生成难以修正先前生成内容的问题,提出预训练扩散模型CodeFusion,通过以自然语言为条件迭代去噪生成完整程序,在多种代码生成任务上以更少参数达到与大规模自回归模型相当或更优的准确率。
摘要:
想象一个开发者只能修改最后一行代码,那么在他们写出正确的函数之前,需要从头开始重写多少次?从自然语言生成代码的自回归模型也有类似的局限性:它们不容易重新考虑之前生成的标记。我们提出了 CodeFusion,一种预训练的扩散代码生成模型,通过以编码后的自然语言为条件,对完整程序进行迭代去噪来解决这一局限性。我们在 Bash、Python 和 Microsoft Excel 条件格式(CF)规则的自然语言到代码生成任务上评估了 CodeFusion。实验表明,CodeFusion(75M 参数)在 top-1 准确率上与最先进的自回归系统(350M-175B 参数)表现相当,并且由于其在多样性与质量之间取得了更好的平衡,在 top-3 和 top-5 准确率上优于它们。
英文摘要:
Imagine a developer who can only change their last line of code, how often would they have to start writing a function from scratch before it is correct? Auto-regressive models for code generation from natural language have a similar limitation: they do not easily allow reconsidering earlier tokens generated. We introduce CodeFusion, a pre-trained diffusion code generation model that addresses this limitation by iteratively denoising a complete program conditioned on the encoded natural language. We evaluate CodeFusion on the task of natural language to code generation for Bash, Python, and Microsoft Excel conditional formatting (CF) rules. Experiments show that CodeFusion (75M parameters) performs on par with state-of-the-art auto-regressive systems (350M-175B parameters) in top-1 accuracy and outperforms them in top-3 and top-5 accuracy due to its better balance in diversity versus quality.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。