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

随机代码生成

Stochastic Code Generation

Courant Institute of Mathematical Sciences, New York University(纽约大学库朗数学科学研究所)

Swapnil Sharma, Nikita Anand, Kranthi Kiran G.

AI总结:

本文研究将隐式随机过程引入代码生成以改善长代码连贯性,基于CodeParrot和APPS训练,并在HumanEval上验证其效果与CodeParrot相当。

摘要:

针对代码生成预训练的大语言模型能够生成高质量的短代码,但在生成长代码以及理解更高层次或系统级规范方面往往存在困难。这一问题在长文本生成的语言建模中同样存在,一种提出的解决方案是使用隐式随机过程。该方法首先生成文档计划,然后生成与该计划一致的文本。在本研究中,我们探究该技术是否可应用于代码生成以提升连贯性。我们基于预训练的GPT-2架构CodeParrot模型构建编码器和解码器,并使用APPS数据集进行训练。我们使用HumanEval基准进行评估,观察到改进后的Time Control模型在该评估上的表现与CodeParrot相当。

英文摘要:

Large language models pre-trained for code generation can generate high-quality short code but often struggle with generating coherent long code and understanding higher-level or system-level specifications. This issue is also observed in language modeling for long text generation, and one proposed solution is the use of a latent stochastic process. This approach involves generating a document plan and then producing text that is consistent with it. In this study, we investigate whether this technique can be applied to code generation to improve coherence. We base our proposed encoder and decoder on the pre-trained GPT-2 based CodeParrot model and utilize the APPS dataset for training. We evaluate our results using the HumanEval benchmark and observe that the modified Time Control model performs similarly to CodeParrot on this evaluation.

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

↑