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
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
冯宇完成签到,获得积分10
刚刚
我是大眼猫完成签到,获得积分10
刚刚
专注的妙竹完成签到,获得积分10
刚刚
天蓬猪大帅完成签到,获得积分10
刚刚
刚刚
舒心的糜完成签到,获得积分10
刚刚
mmacy完成签到,获得积分10
1秒前
1秒前
Apollo879完成签到,获得积分10
1秒前
YeHan完成签到,获得积分10
1秒前
千竹书笙完成签到,获得积分10
1秒前
微义完成签到,获得积分10
1秒前
自信青筠完成签到,获得积分10
1秒前
啦哈啦哈啦完成签到,获得积分10
1秒前
zhouzhou完成签到,获得积分10
1秒前
儒雅的若翠完成签到,获得积分0
2秒前
llk完成签到,获得积分10
2秒前
fanch1122完成签到,获得积分10
2秒前
牧之完成签到,获得积分10
2秒前
zdp827完成签到 ,获得积分10
2秒前
yu完成签到,获得积分10
2秒前
发十篇完成签到 ,获得积分10
2秒前
风暴战斧完成签到,获得积分10
2秒前
a水爱科研完成签到,获得积分10
3秒前
saxg_hu完成签到,获得积分10
3秒前
兔子不吃胡萝卜完成签到 ,获得积分10
3秒前
吴梦丽完成签到,获得积分10
3秒前
todo完成签到,获得积分10
3秒前
张张完成签到,获得积分10
3秒前
jiao完成签到,获得积分10
3秒前
贾贡献的应助被ydy采纳,获得10
3秒前
动听冬寒完成签到,获得积分10
3秒前
可爱的函函的应助被小赵采纳,获得10
3秒前
领导范儿的应助被叶成会采纳,获得10
3秒前
复杂一江完成签到,获得积分10
3秒前
orixero的应助被sci_zt采纳,获得10
3秒前
4秒前
牛牛完成签到,获得积分10
4秒前
explore_e完成签到,获得积分10
4秒前
九号机完成签到,获得积分10
4秒前
高分求助中
(应助此贴封号)【重要!!请各用户(尤其是新用户)详细阅读】【科研通的精品贴汇总】 10000
IRTSD: Open-Source Data and Toolset for Electromagnetic Transient Analysis of Disturbances and IBR Control Malfunctions in Transmission Systems 1000
Spec 401: Standards for Jet Fuel Facility and Equipment Commissioning and Flushing at Airports, 2026.1 (Original Issue) 1000
Spec 103: Standard for Jet Fuel Quality Control at Airports, Revision 2026.1 1000
Les Mots du discours 600
A Consideration on Use of Material Grades for Hull Structural Members Based on Fracture Toughness(Second Report) 500
AI Disclosure in Annual Reports: Evolution, Determinants, and Capital Market Participants’ Perceptions 500
热门求助领域 (近24小时)
化学 材料科学 医学 生物 纳米技术 计算机科学 工程类 有机化学 化学工程 生物化学 物理 复合材料 内科学 催化作用 光电子学 人工智能 细胞生物学 无机化学 物理化学 数学
热门帖子
关注 科研通微信公众号,转发送积分 8109029
求助须知:如何正确求助?哪些是违规求助? 9516770
关于积分的说明 21506037
捐赠科研通 7685859
什么是DOI,文献DOI怎么找? 3411038
关于科研通互助平台的介绍 2538414
邀请新用户注册赠送积分活动 2451002