arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2009.05949cs.PLcs.LG
收藏

用于概率类型推断的高级基于图的深度学习

Advanced Graph-Based Deep Learning for Probabilistic Type Inference

Georgia Institute of Technology(佐治亚理工学院)

Fangke Ye, Jisheng Zhao, Vivek Sarkar

摘要:

诸如JavaScript和Python之类的动态类型语言已经成为使用中最流行的程序设计语言。在动态类型化程序中包含类型注释可以带来重要的好处。这种渐进类型化的方法以TypeScript编程系统为例,它允许程序员指定部分类型化的程序,然后使用静态分析来推断剩余的类型。然而,一般来说,静态类型推断的有效性是有限的,并且取决于程序结构和初始类型注释的复杂性。因此,存在对于新方法的强烈动机,所述新方法可以推进动态类型化程序中的静态预测类型的现有技术,并且以用于交互式编程环境中的可接受的性能这样做。以前的工作已经证明了使用深度学习进行概率类型推理的前景。在本文中,我们提出了过去的工作,通过引入一系列的图神经网络(GNN)模型,操作一个新的类型流图(TFG)表示。TFG将输入程序的元素表示为与语法边和数据流边连接的图节点,并且我们的GNN模型被训练来预测给定输入程序的TFG中的类型标签。我们研究了评估数据集中100种最常见类型的GNN模型的不同设计选择,并表明我们准确度最好的两种GNN配置分别达到了87.76%和86.89%的前1准确度,在过去的工作中,表现优于两种最密切相关的深度学习类型推断方法--DeepTyper,准确率为84.62%和LambdaNet,前1名的准确率为79.45%。此外,这两种配置的平均推理吞吐量分别为353.8和1,303.9文件/秒,而DeepTyper为186.7文件/秒,LambdaNet为1,050.3文件/秒。

英文摘要:

Dynamically typed languages such as JavaScript and Python have emerged as the most popular programming languages in use. Important benefits can accrue from including type annotations in dynamically typed programs. This approach to gradual typing is exemplified by the TypeScript programming system which allows programmers to specify partially typed programs, and then uses static analysis to infer the remaining types. However, in general, the effectiveness of static type inference is limited and depends on the complexity of the program's structure and the initial type annotations. As a result, there is a strong motivation for new approaches that can advance the state of the art in statically predicting types in dynamically typed programs, and that do so with acceptable performance for use in interactive programming environments. Previous work has demonstrated the promise of probabilistic type inference using deep learning. In this paper, we advance past work by introducing a range of graph neural network (GNN) models that operate on a novel type flow graph (TFG) representation. The TFG represents an input program's elements as graph nodes connected with syntax edges and data flow edges, and our GNN models are trained to predict the type labels in the TFG for a given input program. We study different design choices for our GNN models for the 100 most common types in our evaluation dataset, and show that our best two GNN configurations for accuracy achieve a top-1 accuracy of 87.76% and 86.89% respectively, outperforming the two most closely related deep learning type inference approaches from past work -- DeepTyper with a top-1 accuracy of 84.62% and LambdaNet with a top-1 accuracy of 79.45%. Further, the average inference throughputs of those two configurations are 353.8 and 1,303.9 files/second, compared to 186.7 files/second for DeepTyper and 1,050.3 files/second for LambdaNet.

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

↑