当前位置: 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.)
On the generalizability of Neural Program Models with respect to semantic-preserving program transformations
Information and Software Technology ( IF 3.8 ) Pub Date : 2021-02-18 , DOI: 10.1016/j.infsof.2021.106552
Md Rafiqul Islam Rabin , Nghi D.Q. Bui , Ke Wang , Yijun Yu , Lingxiao Jiang , Mohammad Amin Alipour

Context:

With the prevalence of publicly available source code repositories to train deep neural network models, neural program models can do well in source code analysis tasks such as predicting method names in given programs that cannot be easily done by traditional program analysis techniques. Although such neural program models have been tested on various existing datasets, the extent to which they generalize to unforeseen source code is largely unknown.

Objective:

Since it is very challenging to test neural program models on all unforeseen programs, in this paper, we propose to evaluate the generalizability of neural program models with respect to semantic-preserving transformations: a generalizable neural program model should perform equally well on programs that are of the same semantics but of different lexical appearances and syntactical structures.

Method:

We compare the results of various neural program models for the method name prediction task on programs before and after automated semantic-preserving transformations. We use three Java datasets of different sizes and three state-of-the-art neural network models for code, namely code2vec, code2seq, and GGNN, to build nine such neural program models for evaluation.

Results:

Our results show that even with small semantically preserving changes to the programs, these neural program models often fail to generalize their performance. Our results also suggest that neural program models based on data and control dependencies in programs generalize better than neural program models based only on abstract syntax trees (ASTs). On the positive side, we observe that as the size of the training dataset grows and diversifies the generalizability of correct predictions produced by the neural program models can be improved too.

Conclusion:

Our results on the generalizability of neural program models provide insights to measure their limitations and provide a stepping stone for their improvement.



中文翻译:

关于神经程序模型在保留语义的程序转换方面的可推广性

语境:

借助广泛使用的公共源代码存储库来训练深度神经网络模型,神经程序模型可以很好地完成源代码分析任务,例如预测给定程序中的方法名称,而这是传统程序分析技术无法轻松完成的。尽管已经在各种现有数据集上测试了这种神经程序模型,但是在很大程度上,它们推广到无法预料的源代码的程度仍然未知。

客观的:

由于在所有无法预见的程序上测试神经程序模型非常具有挑战性,因此在本文中,我们建议评估神经程序模型在保留语义的转换方面的可推广性:可推广的神经程序模型应该在具有相同的语义,但具有不同的词汇表象和句法结构。

方法:

我们比较各种神经程序模型的结果,以进行自动语义保留转换前后程序上的方法名称预测任务。我们使用三个大小不同的Java数据集和三个最新的神经网络代码模型(即code2veccode2seqGGNN)来构建九个此类神经程序模型进行评估。

结果:

我们的结果表明,即使对程序进行小的语义保留更改,这些神经程序模型也常常无法概括其性能。我们的结果还表明,基于程序中数据和控件依赖性的神经程序模型比仅基于抽象语法树(AST)的神经程序模型具有更好的泛化能力。从积极的方面,我们观察到随着训练数据集规模的增长和多样化,神经程序模型产生的正确预测的泛化性也可以得到改善。

结论:

我们对神经程序模型的可推广性的研究结果为衡量其局限性提供了见识,并为改进它们提供了垫脚石。

更新日期:2021-02-28
down
wechat
bug