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]
卷期号: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
6秒前
浮游应助xh采纳,获得10
7秒前
中原第一深情完成签到,获得积分10
8秒前
8秒前
10秒前
海洋球完成签到 ,获得积分10
12秒前
呆萌安萱完成签到,获得积分10
13秒前
她的城完成签到,获得积分0
14秒前
15秒前
研友_ZG4ml8完成签到 ,获得积分10
15秒前
zrrr完成签到 ,获得积分10
16秒前
呆萌安萱发布了新的文献求助10
17秒前
我是老大应助小Y采纳,获得10
19秒前
Youth完成签到 ,获得积分20
22秒前
FCL完成签到,获得积分10
25秒前
小蘑菇应助飞丹采纳,获得10
27秒前
27秒前
科研通AI2S应助YOLO采纳,获得10
28秒前
十月天秤完成签到,获得积分10
32秒前
浮游应助小萝卜123采纳,获得10
33秒前
overThat完成签到,获得积分10
36秒前
37秒前
38秒前
Akim应助史念薇采纳,获得10
39秒前
来了来了完成签到 ,获得积分10
41秒前
红毛兔完成签到 ,获得积分10
41秒前
岁月如歌完成签到 ,获得积分0
42秒前
wao完成签到 ,获得积分10
42秒前
43秒前
飞丹发布了新的文献求助10
44秒前
寒冷的月亮完成签到,获得积分10
46秒前
研友_ndvWy8完成签到,获得积分10
48秒前
wxxz完成签到,获得积分10
49秒前
Yina完成签到 ,获得积分10
49秒前
飞丹完成签到,获得积分10
52秒前
52秒前
Jane完成签到,获得积分10
53秒前
雪白书南完成签到 ,获得积分10
54秒前
科研通AI2S应助xh采纳,获得10
56秒前
高分求助中
(应助此贴封号)【重要!!请各用户(尤其是新用户)详细阅读】【科研通的精品贴汇总】 10000
Vertébrés continentaux du Crétacé supérieur de Provence (Sud-Est de la France) 600
A complete Carnosaur Skeleton From Zigong, Sichuan- Yangchuanosaurus Hepingensis 四川自贡一完整肉食龙化石-和平永川龙 600
Elle ou lui ? Histoire des transsexuels en France 500
FUNDAMENTAL STUDY OF ADAPTIVE CONTROL SYSTEMS 500
微纳米加工技术及其应用 500
Nanoelectronics and Information Technology: Advanced Electronic Materials and Novel Devices 500
热门求助领域 (近24小时)
化学 材料科学 医学 生物 工程类 有机化学 生物化学 物理 纳米技术 计算机科学 内科学 化学工程 复合材料 物理化学 基因 遗传学 催化作用 冶金 量子力学 光电子学
热门帖子
关注 科研通微信公众号,转发送积分 5315270
求助须知:如何正确求助?哪些是违规求助? 4457945
关于积分的说明 13868470
捐赠科研通 4347468
什么是DOI,文献DOI怎么找? 2387790
邀请新用户注册赠送积分活动 1381932
关于科研通互助平台的介绍 1351243