arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2201.03758cs.SE
收藏

以API为中心的代码的预测合成

Predictive Synthesis of API-Centric Code

Daye Nam, Baishakhi Ray, Seohyun Kim, Xianshan Qu, Satish Chandra

摘要:

今天的程序员,特别是数据科学从业者,大量使用数据处理库(API),如PyTorch,Tensorflow,NumPy,Pandas等。程序合成器可以为这个用户群体提供重要的编码帮助;然而,由于巨大的搜索空间,程序合成也可能很慢。在这项工作中,我们研究的方法,机器学习可以用来加速枚举程序合成。我们提出了一个基于深度学习的模型来预测从给定输入到所需输出所需的API函数序列,两者都是数字向量。我们的工作基于两个见解。首先,可以基于大量的输入输出示例来学习,以预测在给定情况下可能需要的API函数。其次,也是至关重要的一点,在给定输入和期望的最终输出的情况下,也可以学习将API函数组合成一个序列,而无需显式地知道中间值。我们表明,我们可以加快枚举程序合成器使用我们的模型变量的预测。这些加速显著优于研究人员在枚举合成中使用ML模型的以前的方法(例如DeepCoder)。

英文摘要:

Today's programmers, especially data science practitioners, make heavy use of data-processing libraries (APIs) such as PyTorch, Tensorflow, NumPy, Pandas, and the like. Program synthesizers can provide significant coding assistance to this community of users; however program synthesis also can be slow due to enormous search spaces. In this work, we examine ways in which machine learning can be used to accelerate enumerative program synthesis. We present a deep-learning-based model to predict the sequence of API functions that would be needed to go from a given input to a desired output, both being numeric vectors. Our work is based on two insights. First, it is possible to learn, based on a large number of input-output examples, to predict the likely API function needed in a given situation. Second, and crucially, it is also possible to learn to compose API functions into a sequence, given an input and the desired final output, without explicitly knowing the intermediate values. We show that we can speed up an enumerative program synthesizer by using predictions from our model variants. These speedups significantly outperform previous ways (e.g. DeepCoder) in which researchers have used ML models in enumerative synthesis.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑