当前位置: X-MOL 学术Inf. Softw. Technol. › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Neural networks learn to detect and emulate sorting algorithms from images of their execution traces
Information and Software Technology ( IF 3.8 ) Pub Date : 2020-05-24 , DOI: 10.1016/j.infsof.2020.106350
Cătălin F. Perticas , Bipin Indurkhya

Context

Recent advancements in the applicability of neural networks across a variety of fields, such as computer vision, natural language processing and others, have re-sparked an interest in program induction methods. (Kitzelman [1], Gulwani et al. [2] or Kant [3].)

Problem

When performing a program induction task, it is not feasible to search across all possible programs that map an input to an output because the number of possible combinations or sequences of instructions is too high: at least an exponential growth based on the generated program length. Moreover, there does not exist a general framework to formulate such program induction tasks and current computational limitations do not allow a very wide range of machine learning applications in the field of computer programs generation.

Objective

In this study, we analyze the effectiveness of execution traces as learning representations for neural network models in a program induction set-up. Our goal is to generate visualizations of program execution dynamics, specifically of sorting algorithms, and to apply machine learning techniques on them to capture their semantics and emulate their behavior using neural networks.

Method

We begin by classifying images of execution traces for algorithms working on a finite array of numbers, such as various sorting and data structures algorithms. Next we experiment with detecting sub-program patterns inside the trace sequence of a larger program. The last step is to predict future steps in the execution of various sorting algorithms. More specifically, we try to emulate their behavior by observing their execution traces. We also discuss generalizations to other classes of programs, such as 1-D cellular automata.

Results

Our experiments show that neural networks are capable of modeling the mechanisms underlying simple algorithms if enough execution traces are provided as data. We compare the performance of our program induction model with other similar experimental results from Graves et al. [4] and Vinyals et al. [5]. We were also able to demonstrate that sorting algorithms can be treated both as images displaying spatial patterns, as well as sequential instructions in a domain specific language, such as swapping two elements. We tested our approach on three types of increasingly harder tasks: detection, recognition and emulation.

Conclusions

We demonstrate that simple algorithms can be modelled using neural networks and provide a method for representing specific classes of programs as either images or sequences of instructions in a domain-specific language, such that a neural network can learn their behavior. We consider the complexity of various set-ups to arrive at some improvements based on the data representation type. The insights from our experiments can be applied for designing better models of program induction.



中文翻译:

神经网络学习从其执行轨迹的图像中检测和模拟排序算法

语境

神经网络在各个领域(如计算机视觉,自然语言处理等)的适用性方面的最新进展,引起了人们对程序归纳方法的兴趣。(Kitzelman [1],Gulwani等人[2]或Kant [3]。)

问题

执行程序归纳任务时,在所有可能将输入映射到输出的可能程序中搜索是不可行的,因为可能的指令组合或指令序列的数量过多:至少基于生成的程序长度呈指数增长。而且,不存在制定这样的程序归纳任务的通用框架,并且当前的计算限制不允许在计算机程序生成领域中非常广泛的机器学习应用。

目的

在这项研究中,我们分析了执行跟踪作为程序归纳设置中神经网络模型的学习表示形式的有效性。我们的目标是生成程序执行动态(特别是排序算法)的可视化,并在其上应用机器学习技术以捕获其语义并使用神经网络模拟其行为。

方法

我们首先对在有限数量的数组上工作的算法(例如各种排序和数据结构算法)的执行轨迹图像进行分类。接下来,我们尝试检测较大程序的跟踪序列内的子程序模式。最后一步是预测执行各种排序算法的未来步骤。更具体地说,我们尝试通过观察它们的执行轨迹来模拟它们的行为。我们还将讨论对其他类别程序的概括,例如1-D细胞自动机。

结果

我们的实验表明,如果将足够的执行跟踪作为数据提供,则神经网络能够对简单算法的基础机制进行建模。我们将程序归纳模型的性能与Graves等人的其他类似实验结果进行比较。[4]和Vinyals等。[5]。我们还能够证明排序算法既可以视为显示空间模式的图像,也可以视为领域特定语言的顺序指令,例如交换两个元素。我们针对三种难度越来越大的任务测试了我们的方法:检测,识别和仿真。

结论

我们证明了可以使用神经网络对简单算法进行建模,并提供一种方法来将特定类的程序表示为特定领域语言中的图像或指令序列,以便神经网络可以学习其行为。我们考虑了各种设置的复杂性,以便根据数据表示类型进行一些改进。我们从实验中获得的见识可用于设计更好的程序归纳模型。

更新日期:2020-05-24
down
wechat
bug