A Neural Network Architecture for Program Understanding Inspired by Human Behaviors

Renyu Zhu, Lei Yuan, Xiang Li, Ming Gao, Wenyuan Cai


Abstract
Program understanding is a fundamental task in program language processing. Despite the success, existing works fail to take human behaviors as reference in understanding programs. In this paper, we consider human behaviors and propose the PGNN-EK model that consists of two main components. On the one hand, inspired by the “divide-and-conquer” reading behaviors of humans, we present a partitioning-based graph neural network model PGNN on the upgraded AST of codes. On the other hand, to characterize human behaviors of resorting to other resources to help code comprehension, we transform raw codes with external knowledge and apply pre-training techniques for information extraction. Finally, we combine the two embeddings generated from the two components to output code embeddings. We conduct extensive experiments to show the superior performance of PGNN-EK on the code summarization and code clone detection tasks. In particular, to show the generalization ability of our model, we release a new dataset that is more challenging for code clone detection and could advance the development of the community. Our codes and data are publicly available at https://github.com/RecklessRonan/PGNN-EK.
Anthology ID:
2022.acl-long.353
Volume:
Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)
Month:
May
Year:
2022
Address:
Dublin, Ireland
Editors:
Smaranda Muresan, Preslav Nakov, Aline Villavicencio
Venue:
ACL
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
5142–5153
Language:
URL:
https://aclanthology.org/2022.acl-long.353
DOI:
10.18653/v1/2022.acl-long.353
Bibkey:
Cite (ACL):
Renyu Zhu, Lei Yuan, Xiang Li, Ming Gao, and Wenyuan Cai. 2022. A Neural Network Architecture for Program Understanding Inspired by Human Behaviors. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 5142–5153, Dublin, Ireland. Association for Computational Linguistics.
Cite (Informal):
A Neural Network Architecture for Program Understanding Inspired by Human Behaviors (Zhu et al., ACL 2022)
Copy Citation:
PDF:
https://aclanthology.org/2022.acl-long.353.pdf
Software:
 2022.acl-long.353.software.zip
Code
 recklessronan/pgnn-ek
Data
CodeSearchNetCodeXGLUE