On the generalizability of Neural Program Models with respect to semantic-preserving program transformations

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. Al...

Full description

Saved in:
Bibliographic Details
Main Authors: RABIN, Md Rafiqul Islam, BUI, Nghi D. Q., WANG, Ke, YU, Yijun, JIANG, Lingxiao
Format: text
Language:English
Published: Institutional Knowledge at Singapore Management University 2021
Subjects:
Online Access:https://ink.library.smu.edu.sg/sis_research/6044
https://ink.library.smu.edu.sg/context/sis_research/article/7047/viewcontent/IST20generalizability.pdf
Tags: Add Tag
No Tags, Be the first to tag this record!
Institution: Singapore Management University
Language: English
id sg-smu-ink.sis_research-7047
record_format dspace
spelling sg-smu-ink.sis_research-70472021-07-14T09:40:16Z On the generalizability of Neural Program Models with respect to semantic-preserving program transformations RABIN, Md Rafiqul Islam BUI, Nghi D. Q. WANG, Ke YU, Yijun JIANG, Lingxiao 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. 2021-07-01T07:00:00Z text application/pdf https://ink.library.smu.edu.sg/sis_research/6044 info:doi/10.1016/j.infsof.2021.106552 https://ink.library.smu.edu.sg/context/sis_research/article/7047/viewcontent/IST20generalizability.pdf http://creativecommons.org/licenses/by-nc-nd/4.0/ Research Collection School Of Computing and Information Systems eng Institutional Knowledge at Singapore Management University Code representation Generalizability Model evaluation Neural models Program transformation Software Engineering
institution Singapore Management University
building SMU Libraries
continent Asia
country Singapore
Singapore
content_provider SMU Libraries
collection InK@SMU
language English
topic Code representation
Generalizability
Model evaluation
Neural models
Program transformation
Software Engineering
spellingShingle Code representation
Generalizability
Model evaluation
Neural models
Program transformation
Software Engineering
RABIN, Md Rafiqul Islam
BUI, Nghi D. Q.
WANG, Ke
YU, Yijun
JIANG, Lingxiao
On the generalizability of Neural Program Models with respect to semantic-preserving program transformations
description 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.
format text
author RABIN, Md Rafiqul Islam
BUI, Nghi D. Q.
WANG, Ke
YU, Yijun
JIANG, Lingxiao
author_facet RABIN, Md Rafiqul Islam
BUI, Nghi D. Q.
WANG, Ke
YU, Yijun
JIANG, Lingxiao
author_sort RABIN, Md Rafiqul Islam
title On the generalizability of Neural Program Models with respect to semantic-preserving program transformations
title_short On the generalizability of Neural Program Models with respect to semantic-preserving program transformations
title_full On the generalizability of Neural Program Models with respect to semantic-preserving program transformations
title_fullStr On the generalizability of Neural Program Models with respect to semantic-preserving program transformations
title_full_unstemmed On the generalizability of Neural Program Models with respect to semantic-preserving program transformations
title_sort on the generalizability of neural program models with respect to semantic-preserving program transformations
publisher Institutional Knowledge at Singapore Management University
publishDate 2021
url https://ink.library.smu.edu.sg/sis_research/6044
https://ink.library.smu.edu.sg/context/sis_research/article/7047/viewcontent/IST20generalizability.pdf
_version_ 1770575747212115968