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.

科研通智能强力驱动
Strongly Powered by AbleSci AI
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
kai发布了新的文献求助10
刚刚
可爱的函函应助liu采纳,获得10
1秒前
liulei发布了新的文献求助10
1秒前
1秒前
1秒前
尧尧发布了新的文献求助10
1秒前
1秒前
研友_Z6k5Q8完成签到 ,获得积分10
2秒前
汉堡包应助stupid采纳,获得10
2秒前
Auoroa发布了新的文献求助10
2秒前
羡羡发布了新的文献求助10
2秒前
平淡的宛凝应助Miraitowa采纳,获得10
2秒前
Parsec发布了新的文献求助10
3秒前
幻画应助安静的棉花糖采纳,获得30
3秒前
singfluer完成签到 ,获得积分10
4秒前
EEE发布了新的文献求助20
4秒前
cdercder应助小呀嘛小二郎采纳,获得30
5秒前
5秒前
JamesPei应助tlm采纳,获得10
5秒前
5秒前
6秒前
6秒前
6秒前
ivy发布了新的文献求助50
6秒前
囧囧应助猫南北采纳,获得50
6秒前
pengdaiyun发布了新的文献求助10
9秒前
ming发布了新的文献求助10
9秒前
yuqinghui98发布了新的文献求助10
9秒前
925发布了新的文献求助10
9秒前
核桃发布了新的文献求助10
9秒前
香蕉觅云应助笙笙步悉采纳,获得10
9秒前
Orange应助sure采纳,获得10
9秒前
李爱国应助liulei采纳,获得10
9秒前
goubuli00完成签到,获得积分10
9秒前
寂静王完成签到,获得积分10
10秒前
自觉宛海完成签到 ,获得积分10
13秒前
heady完成签到,获得积分10
14秒前
Auoroa完成签到,获得积分10
15秒前
嗯呐完成签到,获得积分10
16秒前
科研小白_李完成签到,获得积分10
18秒前
高分求助中
Markov Chain Monte Carlo 10000
(应助此贴封号)【重要!!请各用户(尤其是新用户)详细阅读】【科研通的精品贴汇总】 10000
Common Foundations of American and East Asian Modernisation: From Alexander Hamilton to Junichero Koizumi 2000
Advanced Weaponeering Fourth Edition, Volume 2 1000
Weaponeering: An Introduction Fourth Edition, Volume 1 1000
悉尼大学博士学位论文,题目:Modelling and testing of one-sided stitched laminated composites. 作者:Kristopher P. Plain 700
Matrix Methods in Data Mining and Pattern Recognition Second Edition 610
热门求助领域 (近24小时)
化学 材料科学 医学 生物 纳米技术 工程类 有机化学 化学工程 生物化学 计算机科学 内科学 物理 复合材料 催化作用 细胞生物学 无机化学 光电子学 物理化学 电极 基因
热门帖子
关注 科研通微信公众号,转发送积分 7553990
求助须知:如何正确求助?哪些是违规求助? 9136498
关于积分的说明 19527398
捐赠科研通 7145288
什么是DOI,文献DOI怎么找? 3260797
关于科研通互助平台的介绍 2427234
邀请新用户注册赠送积分活动 2249806