Efficient transformer with code token learner for code clone detection

计算机科学 抽象语法树 安全性令牌 编码(集合论) 编码 源代码 变压器 程序设计语言 人工智能 语法 操作系统 工程类 基因 电气工程 电压 集合(抽象数据类型) 化学 生物化学
作者
Aiping Zhang,Liming Fang,Chunpeng Ge,Piji Li,Zhe Liu
出处
期刊:Journal of Systems and Software [Elsevier BV]
卷期号:197: 111557-111557 被引量:13
标识
DOI:10.1016/j.jss.2022.111557
摘要

Deep learning techniques have achieved promising results in code clone detection in the past decade. Unfortunately, current deep learning-based methods rarely explicitly consider the modeling of long codes. Worse, the code length is increasing due to the increasing requirement of complex functions. Thus, modeling the relationship between code tokens to catch their long-range dependencies is crucial to comprehensively capture the information of the code fragment. In this work, we resort to the Transformer to capture long-range dependencies within a code, which however requires huge computational cost for long code fragments. To make it possible to apply Transformer efficiently, we propose a code token learner to largely reduce the number of feature tokens in an automatic way. Besides, considering the tree structure of the abstract syntax tree, we present a tree-based position embedding to encode the position of each token in the input. Apart from the Transformer that captures the dependency within a code, we further leverage a cross-code attention module to capture the similarities between two code fragments. Our method significantly reduces the computational cost of using Transformer by 97% while achieves superior performance with state-of-the-art methods. Our code is available at https://github.com/ArcticHare105/Code-Token-Learner.
最长约 10秒,即可获得该文献文件

科研通智能强力驱动
Strongly Powered by AbleSci AI
更新
PDF的下载单位、IP信息已删除 (2025-6-4)

科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
可可发布了新的文献求助10
刚刚
风中昊焱发布了新的文献求助10
刚刚
1秒前
古月发布了新的文献求助10
1秒前
1秒前
SYLH应助图图烤肉采纳,获得10
1秒前
畅快的人雄完成签到 ,获得积分20
2秒前
2秒前
超帅飞松完成签到,获得积分10
2秒前
2秒前
2秒前
孙昊宇关注了科研通微信公众号
3秒前
3秒前
SYLH应助欧阳采纳,获得10
3秒前
自然水风完成签到,获得积分10
4秒前
棋士发布了新的文献求助10
5秒前
叶泽完成签到,获得积分10
6秒前
6秒前
方东发布了新的文献求助10
6秒前
wdb发布了新的文献求助10
6秒前
Sophie完成签到,获得积分10
6秒前
7秒前
Betty发布了新的文献求助10
7秒前
chen发布了新的文献求助10
8秒前
Leo发布了新的文献求助30
8秒前
啦啦啦发布了新的文献求助10
8秒前
英俊的毛豆完成签到 ,获得积分10
8秒前
Ll完成签到,获得积分10
8秒前
cetomacrogol发布了新的文献求助10
8秒前
甜甜的小虾米完成签到,获得积分10
8秒前
hkh发布了新的文献求助10
9秒前
wanci应助蜘蛛道理采纳,获得10
9秒前
亚米完成签到,获得积分10
10秒前
汉堡包应助古月采纳,获得10
11秒前
袁向薇发布了新的文献求助10
11秒前
11秒前
cc完成签到,获得积分10
11秒前
英姑应助Lynn采纳,获得10
11秒前
鳗鱼寄瑶完成签到,获得积分10
11秒前
花花完成签到 ,获得积分10
12秒前
高分求助中
The Mother of All Tableaux Order, Equivalence, and Geometry in the Large-scale Structure of Optimality Theory 2400
Ophthalmic Equipment Market by Devices(surgical: vitreorentinal,IOLs,OVDs,contact lens,RGP lens,backflush,diagnostic&monitoring:OCT,actorefractor,keratometer,tonometer,ophthalmoscpe,OVD), End User,Buying Criteria-Global Forecast to2029 2000
Optimal Transport: A Comprehensive Introduction to Modeling, Analysis, Simulation, Applications 800
Official Methods of Analysis of AOAC INTERNATIONAL 600
ACSM’s Guidelines for Exercise Testing and Prescription, 12th edition 588
T/CIET 1202-2025 可吸收再生氧化纤维素止血材料 500
Interpretation of Mass Spectra, Fourth Edition 500
热门求助领域 (近24小时)
化学 材料科学 医学 生物 工程类 有机化学 生物化学 物理 内科学 纳米技术 计算机科学 化学工程 复合材料 遗传学 基因 物理化学 催化作用 冶金 细胞生物学 免疫学
热门帖子
关注 科研通微信公众号,转发送积分 3954999
求助须知:如何正确求助?哪些是违规求助? 3501277
关于积分的说明 11102247
捐赠科研通 3231584
什么是DOI,文献DOI怎么找? 1786477
邀请新用户注册赠送积分活动 870090
科研通“疑难数据库(出版商)”最低求助积分说明 801798