论文标题

学习使用指令指针注意执行程序图图形神经网络

Learning to Execute Programs with Instruction Pointer Attention Graph Neural Networks

论文作者

Bieber, David, Sutton, Charles, Larochelle, Hugo, Tarlow, Daniel

论文摘要

图形神经网络(GNN)已成为学习软件工程任务的强大工具,包括代码完成,错误查找和程序维修。它们受益于诸如控制流程图之类的程序结构,但是它们不适合诸如程序执行之类的任务,而程序执行需要比GNN传播步骤数量更多的顺序推理步骤。另一方面,经常性的神经网络(RNN)非常适合长期的推理链,但是它们并不自然地融合了程序结构,并且在上述任务上通常表现较差。我们的目的是实现两全其美的目的,我们通过引入新颖的GNN体系结构,指令指针图形图形神经网络(IPA-GNN)来实现,该网络(IPA-GNN)在学习使用控制流程图执行程序的任务上实现了改进的系统概括。该模型是通过考虑在分支决策的程序痕迹上操作的RNN作为潜在变量而产生的。可以将IPA-GNN视为RNN模型的连续放松,也可以视为GNN变体更适合执行。为了测试模型,我们建议评估使用控制流程图学习执行的系统概括,从而测试了程序结构的顺序推理和使用。更重要的是,我们将这些模型评估为学习执行部分程序的任务,就像将模型用作程序合成中的启发式功能时可能会发生。结果表明,IPA-GNN在这两个任务上的表现均优于各种RNN和GNN基线。

Graph neural networks (GNNs) have emerged as a powerful tool for learning software engineering tasks including code completion, bug finding, and program repair. They benefit from leveraging program structure like control flow graphs, but they are not well-suited to tasks like program execution that require far more sequential reasoning steps than number of GNN propagation steps. Recurrent neural networks (RNNs), on the other hand, are well-suited to long sequential chains of reasoning, but they do not naturally incorporate program structure and generally perform worse on the above tasks. Our aim is to achieve the best of both worlds, and we do so by introducing a novel GNN architecture, the Instruction Pointer Attention Graph Neural Networks (IPA-GNN), which achieves improved systematic generalization on the task of learning to execute programs using control flow graphs. The model arises by considering RNNs operating on program traces with branch decisions as latent variables. The IPA-GNN can be seen either as a continuous relaxation of the RNN model or as a GNN variant more tailored to execution. To test the models, we propose evaluating systematic generalization on learning to execute using control flow graphs, which tests sequential reasoning and use of program structure. More practically, we evaluate these models on the task of learning to execute partial programs, as might arise if using the model as a heuristic function in program synthesis. Results show that the IPA-GNN outperforms a variety of RNN and GNN baselines on both tasks.

扫码加入交流群

加入微信交流群

微信交流群二维码

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