论文标题

使用堆栈授权的LSTM对层次进行建模程序

Modeling Programs Hierarchically with Stack-Augmented LSTM

论文作者

Liu, Fang, Zhang, Lu, Jin, Zhi

论文摘要

近年来,编程语言建模引起了广泛的关注,并且在程序处理领域中起着至关重要的作用。最初是为自然语言设计的统计语言模型通常用于建模编程语言。但是,与自然语言不同的是,编程语言包含明确和层次结构,而传统统计语言模型很难学习。为了应对这一挑战,我们提出了一个新颖的堆栈刺激的LSTM神经网络,用于编程语言建模。将堆栈内存组件添加到LSTM网络中,使我们的模型能够通过PUSH和POP操作捕获程序的分层信息,这进一步允许我们的模型捕获程序中的长期依赖性。我们在三个程序分析任务(即代码完成,程序分类和代码摘要)上评估了建议的模型。评估结果表明,我们所提出的模型在所有三个任务中都优于基线模型,这表明,通过使用堆栈捕获程序的结构信息,我们提出的模型可以更精确地表示程序。

Programming language modeling has attracted extensive attention in recent years, and it plays an essential role in program processing fields. Statistical language models, which are initially designed for natural languages, have been generally used for modeling programming languages. However, different from natural languages, programming languages contain explicit and hierarchical structure that is hard to learn by traditional statistical language models. To address this challenge, we propose a novel Stack-Augmented LSTM neural network for programming language modeling. Adding a stack memory component into the LSTM network enables our model to capture the hierarchical information of programs through the PUSH and POP operations, which further allows our model capturing the long-term dependency in the programs. We evaluate the proposed model on three program analysis tasks, i.e., code completion, program classification, and code summarization. Evaluation results show that our proposed model outperforms baseline models in all the three tasks, indicating that by capturing the structural information of programs with a stack, our proposed model can represent programs more precisely.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源