论文标题

通过学习使用外部资源描述执行程序来静态预测运行时错误

Static Prediction of Runtime Errors by Learning to Execute Programs with External Resource Descriptions

论文作者

Bieber, David, Goel, Rishab, Zheng, Daniel, Larochelle, Hugo, Tarlow, Daniel

论文摘要

程序的执行行为通常取决于外部资源,例如程序输入或文件内容,因此不能孤立地运行。尽管如此,软件开发人员从快速迭代循环中受益于自动化工具,即使在编译和运行程序之前,自动化工具都会尽早确定错误。这提出了一个有趣的机器学习挑战:我们可以在“静态”设置中预测运行时错误,而程序执行不可能?在这里,我们介绍了一个现实世界中的数据集和用于预测运行时错误的任务,对于Transformers(例如Transformers)来说,我们很难表明这很难。我们通过开发以解释器为启发性的体系结构来实现这项任务,该体系结构对模仿程序执行有诱导的偏见,该架构对外部资源内容的描述进行了模型,并“学会执行”描述外部资源。令人惊讶的是,我们表明该模型还可以预测误差的位置,尽管仅在标签上训练了表明存在/不存在和误差的标签。总的来说,我们提出了与学习计划执行相关的实用且难以实现的挑战问题,我们证明了对代码的解释器启发的机器学习模型的新功能。

The execution behavior of a program often depends on external resources, such as program inputs or file contents, and so cannot be run in isolation. Nevertheless, software developers benefit from fast iteration loops where automated tools identify errors as early as possible, even before programs can be compiled and run. This presents an interesting machine learning challenge: can we predict runtime errors in a "static" setting, where program execution is not possible? Here, we introduce a real-world dataset and task for predicting runtime errors, which we show is difficult for generic models like Transformers. We approach this task by developing an interpreter-inspired architecture with an inductive bias towards mimicking program executions, which models exception handling and "learns to execute" descriptions of the contents of external resources. Surprisingly, we show that the model can also predict the location of the error, despite being trained only on labels indicating the presence/absence and kind of error. In total, we present a practical and difficult-yet-approachable challenge problem related to learning program execution and we demonstrate promising new capabilities of interpreter-inspired machine learning models for code.

扫码加入交流群

加入微信交流群

微信交流群二维码

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