Learning to represent programs with heterogeneous graphs

计算机科学 理论计算机科学 图形 源代码 杠杆(统计) 代码生成 人工智能 程序设计语言 钥匙(锁) 计算机安全
作者
Kechi Zhang,Wenhan Wang,Huangzhao Zhang,Ge Li,Zhi Jin
标识
DOI:10.1145/3524610.3527905
摘要

Code representation, which transforms programs into vectors with semantics, is essential for source code processing. We have witnessed the effectiveness of incorporating structural information (i.e., graph) into code representations in recent years. Specifically, the abstract syntax tree (AST) and the AST-augmented graph of the program contain much structural and semantic information, and most existing studies apply them for code representation. The graph adopted by existing approaches is homogeneous, i.e., it discards the type information of the edges and the nodes lying within AST. That may cause plausible obstruction to the representation model. In this paper, we propose to leverage the type information in the graph for code representation. To be specific, we propose the heterogeneous program graph (HPG), which provides the types of the nodes and the edges explicitly. Furthermore, we employ the heterogeneous graph transformer (HGT) architecture to generate representations based on HPG, considering the type of information during processing. With the additional types in HPG, our approach can capture complex structural information, produce accurate and delicate representations, and finally perform well on certain tasks. Our in-depth evaluations upon four classic datasets for two typical tasks (i.e., method name prediction and code classification) demonstrate that the heterogeneous types in HPG benefit the representation models. Our proposed HPG+HGT also outperforms the SOTA baselines on the subject tasks and datasets.
最长约 10秒,即可获得该文献文件

科研通智能强力驱动
Strongly Powered by AbleSci AI
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
科研通AI5应助jiabaoyu采纳,获得10
刚刚
木木木完成签到,获得积分10
刚刚
suka完成签到,获得积分10
1秒前
1秒前
就好ih完成签到,获得积分10
1秒前
yao发布了新的文献求助10
1秒前
孙瞳发布了新的文献求助30
2秒前
西瓜应助奋斗的凡采纳,获得10
2秒前
酷波er应助谨言采纳,获得10
2秒前
小白君完成签到,获得积分10
2秒前
3秒前
赘婿应助sunyanghu369采纳,获得10
3秒前
3秒前
猪哥哥完成签到,获得积分10
4秒前
4秒前
yangaiyao发布了新的文献求助10
4秒前
OJL完成签到 ,获得积分10
5秒前
星辰大海应助十月采纳,获得10
5秒前
Owen应助luym采纳,获得10
5秒前
努力毕业发布了新的文献求助10
5秒前
希望天下0贩的0应助1234采纳,获得10
6秒前
分风吹完成签到 ,获得积分10
6秒前
7秒前
8秒前
渊崖曙春应助hanni采纳,获得10
8秒前
ding应助徐徐徐采纳,获得10
9秒前
grace完成签到,获得积分20
9秒前
刘佳佳完成签到 ,获得积分10
10秒前
fireflieszy完成签到,获得积分10
10秒前
小W爱吃梨完成签到,获得积分10
11秒前
12秒前
12秒前
李健应助112采纳,获得10
12秒前
傲娇的凡旋应助努力毕业采纳,获得10
12秒前
12秒前
LSY-henu发布了新的文献求助10
13秒前
哈罗发布了新的文献求助10
13秒前
14秒前
Jasper应助热情的戾采纳,获得10
14秒前
科研通AI5应助活力的初之采纳,获得10
15秒前
高分求助中
Continuum thermodynamics and material modelling 3000
Production Logging: Theoretical and Interpretive Elements 2500
Healthcare Finance: Modern Financial Analysis for Accelerating Biomedical Innovation 2000
Applications of Emerging Nanomaterials and Nanotechnology 1111
Les Mantodea de Guyane Insecta, Polyneoptera 1000
Theory of Block Polymer Self-Assembly 750
지식생태학: 생태학, 죽은 지식을 깨우다 700
热门求助领域 (近24小时)
化学 医学 材料科学 生物 工程类 有机化学 生物化学 纳米技术 内科学 物理 化学工程 计算机科学 复合材料 基因 遗传学 物理化学 催化作用 细胞生物学 免疫学 电极
热门帖子
关注 科研通微信公众号,转发送积分 3476364
求助须知:如何正确求助?哪些是违规求助? 3068018
关于积分的说明 9106299
捐赠科研通 2759594
什么是DOI,文献DOI怎么找? 1514136
邀请新用户注册赠送积分活动 700071
科研通“疑难数据库(出版商)”最低求助积分说明 699284