arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1904.02818cs.LGcs.CLcs.SEstat.ML
收藏

用于Source Code编辑建模的神经网络

Neural Networks for Modeling Source Code Edits

Google Brain(谷歌大脑)

Rui Zhao, David Bieber, Kevin Swersky, Daniel Tarlow

摘要:

程序设计语言正在成为机器学习的一个具有挑战性和有趣的领域。一个核心任务,这是近年来受到极大的关注,是建立源代码的生成模型。然而,据我们所知,以前的生成模型一直是在生成代码的静态快照方面构建的。在这项工作中,我们将源代码视为动态对象,并解决软件开发人员对源代码文件进行编辑的建模问题。这需要从先前的编辑中提取意图并利用它来生成后续编辑。我们开发了几个神经网络,并使用合成数据来测试它们学习具有挑战性的编辑模式的能力,这些模式需要很强的泛化能力。然后,我们在Google源代码的大规模数据集上收集和训练我们的模型,该数据集由数千名Python开发人员的数百万次细粒度编辑组成。从建模的角度来看,我们的主要结论是,注意力和指针网络组件的新组合提供了最佳的整体性能和可扩展性。从应用程序的角度来看,我们的研究结果提供了初步的证据,开发工具,学习预测未来的编辑的可行性。

英文摘要:

Programming languages are emerging as a challenging and interesting domain for machine learning. A core task, which has received significant attention in recent years, is building generative models of source code. However, to our knowledge, previous generative models have always been framed in terms of generating static snapshots of code. In this work, we instead treat source code as a dynamic object and tackle the problem of modeling the edits that software developers make to source code files. This requires extracting intent from previous edits and leveraging it to generate subsequent edits. We develop several neural networks and use synthetic data to test their ability to learn challenging edit patterns that require strong generalization. We then collect and train our models on a large-scale dataset of Google source code, consisting of millions of fine-grained edits from thousands of Python developers. From the modeling perspective, our main conclusion is that a new composition of attentional and pointer network components provides the best overall performance and scalability. From the application perspective, our results provide preliminary evidence of the feasibility of developing tools that learn to predict future edits.

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

↑