深度神经网络可能是建模Source Code的最佳选择
Maybe Deep Neural Networks are the Best Choice for Modeling Source Code
摘要:
统计语言建模技术已经成功地应用于源代码,产生了各种新的软件开发工具,如代码建议和提高可读性的工具。这些技术的一个主要问题是,随着新标识符名称的激增,代码以比自然语言高得多的速率引入新词汇表。但是传统的语言模型将词汇表限制在一组固定的常用词上。对于代码,这种强假设已被证明对预测性能有显著的负面影响。但是,开放词汇表版本的神经网络语言模型的代码还没有在文献中介绍。我们提出了一个新的开放词汇神经语言模型的代码,不限于一个固定的词汇表的标识符名称。我们采用了分割成子字单元,根据压缩标准选择的标记的连续性,在机器翻译以前的工作。我们的网络实现了一流的性能,甚至超过了Hellendoorn和Devanbu专门为模型代码设计的最先进的方法。此外,我们提出了一个简单的方法,动态适应模型的一个新的测试项目,从而提高性能。我们在三种不同语言的代码语料库上展示了我们的方法,每种语言的代码语料库都超过10亿个令牌,比以前的工作大数百倍。据我们所知,这是已报道的最大的代码神经语言模型。
英文摘要:
Statistical language modeling techniques have successfully been applied to source code, yielding a variety of new software development tools, such as tools for code suggestion and improving readability. A major issue with these techniques is that code introduces new vocabulary at a far higher rate than natural language, as new identifier names proliferate. But traditional language models limit the vocabulary to a fixed set of common words. For code, this strong assumption has been shown to have a significant negative effect on predictive performance. But the open vocabulary version of the neural network language models for code have not been introduced in the literature. We present a new open-vocabulary neural language model for code that is not limited to a fixed vocabulary of identifier names. We employ a segmentation into subword units, subsequences of tokens chosen based on a compression criterion, following previous work in machine translation. Our network achieves best in class performance, outperforming even the state-of-the-art methods of Hellendoorn and Devanbu that are designed specifically to model code. Furthermore, we present a simple method for dynamically adapting the model to a new test project, resulting in increased performance. We showcase our methodology on code corpora in three different languages of over a billion tokens each, hundreds of times larger than in previous work. To our knowledge, this is the largest neural language model for code that has been reported.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。