arrow
Return

Efficient transformer with code token learner for code clone detection

delete2023-03-01
delete14
PRE
AI
A
Aiping Zhang
方
方黎明 (Liming Fang) *
C
Chunpeng Ge
P
Piji Li
刘哲 cover
刘哲 (Zhe Liu)
DOI:10.1016/j.jss.2022.111557delete
deleteOriginal
deleteShare
deleteSave
Abstract

Abstract

En 中文
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.(c) 2022 Elsevier Inc. All rights reserved.
Keywords:
Code clone detection
Code token learner
Efficient transformer
CCStokener: Fast yet accurate code clone detection with semantic token
err2023-05-01
err7
PREAI
errWang, Wenjie; Deng, Zihan; Xue, Yinxing; Xu, Yun
errShare
errSave
Code2Img: Tree-Based Image Transformation for Scalable Code Clone Detection
err2023-09-01
err5
PREAI
errHu, Yutao; Fang, Yilin; Sun, Yifan; Jia, Yaru; Wu, Yueming; Zou, Deqing; Jin, Hai
errShare
errSave
Graph-based code semantics learning for efficient semantic code clone detection
err2023-04-01
err12
PREAI
errYu, Dongjin; Yang, Quanxin; Chen, Xin; Chen, Jie; Xu, Yihang
errShare
errSave
A Systematic Review on Code Clone Detection
err2019-01-01
err84
errOAAI
errUl Ain, Qurat; Butt, Wasi Haider; Anwar, Muhammad Waseem; Azam, Farooque; Maqbool, Bilal
errShare
errSave
An enhanced transformer-based framework for interpretable code clone detection
err2025-04-01
err0
PREAI
errNashaat, Mona; Amin, Reem; Eid, Ahmad Hosny; Abdel-Kader, Rabab F.
errShare
errSave
errShare
errSave

Journal

Journal of Systems and Software cover
Journal of Systems and Software
IF:
4.1
Papers:
5.5K
Citations:
1.0W

Organization

No organization information available
Cited Papers

Cited Papers

Xbox 360 Hoaxes, Social Engineering, and Gamertag Exploits
err2013-01-01
err0
PREAI
errAshley Podhradsky; Rob DOvidio; Pat Engebretson; Cindy Casey
errShare
errSave
What are the most important factors determining different vegetation types in the Chapada Diamantina, Brazil?
err2016-03-01
err0
errOAAI
errS. P. S. Neves; R. Funch; A. A. Conceição; L. A. P. Miranda; L. S. Funch
errShare
errSave
errShare
errSave
Synthesis of TiN/a-Si3N4thin film by using a Mather type dense plasma focus system
err2013-05-16
err0
PREAI
errT. Hussain; R. Ahmad; N. Khalid; Z. A. Umar; A. Hussnain
errShare
errSave
The association of the UHRF1BP1 gene with systemic lupus erythematosus was replicated in a Han Chinese population from mainland China
err2019-11-05
err0
PREAI
errLeilei Wen; Lu Liu; Xue Shen; Hui Li; Zhengwei Zhu; He Huang; Minglong Cai; Danfeng Qian; Songke Shen; Ying Qiu; Yong Cui; Yujun Sheng
errShare
errSave
researcher View more