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

基于人类行为的神经网络程序理解体系结构

A Neural Network Architecture for Program Understanding Inspired by Human Behaviors

East China Normal University(华东师范大学);Shanghai Hypers Data Technology Inc.(上海海比思数据科技有限公司)

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

摘要:

程序理解是程序语言处理的一项基本任务。尽管取得了成功,但现有的工作未能将人类行为作为理解程序的参考。在本文中,我们考虑人类的行为,并提出了PGNN-EK模型,由两个主要组成部分。一方面,受人类“分而治之”的阅读行为的启发,我们提出了一个基于划分的图神经网络模型PGNN。另一方面,为了表征人类诉诸其他资源以帮助代码理解的行为,我们用外部知识转换原始代码,并应用预训练技术进行信息抽取。最后,我们将两个组件生成的两个嵌入组合起来,输出代码嵌入。我们进行了大量的实验,以显示PGNN-EK的代码摘要和代码克隆检测任务的优越性能。特别是,为了展示我们模型的泛化能力,我们发布了一个新的数据集,它对代码克隆检测更具挑战性,可以促进社区的发展。我们的代码和数据可在https://github.com/RecklessRonan/PGNN-EK上公开获取。

英文摘要:

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.

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

↑