An enhanced transformer-based framework for interpretable code clone detection

被引:0
|
作者
Nashaat, Mona [1 ]
Amin, Reem [1 ]
Eid, Ahmad Hosny [1 ]
Abdel-Kader, Rabab F. [1 ]
机构
[1] Port Said Univ, Fac Engn, Elect Engn Dept, Port Said 42526, Egypt
关键词
Software development; Code clone detection; Software productivity; Large language models; Transformer-based models;
D O I
10.1016/j.jss.2025.112347
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
In software development, the replication of specific source code segments is known as code cloning. This practice allows reusing source code instead of developing these segments from scratch, enhancing software productivity. However, code cloning can introduce bugs, complicate code refactoring, and increase maintenance costs. Consequently, code clone detection (CCD) is an essential concern for the software industry. While various techniques have been proposed for detecting code clones, many existing tools generate a high ratio of false positives/negatives and a need for more contextual awareness. Therefore, this paper introduces CloneXformer, an innovative framework for code clone detection. The framework adopts a collaborative approach that harnesses multiple large language models for code understanding. The framework employs a preliminary phase to preprocess the input code, which helps the models understand and represent the code efficiently. Then, it captures the semantic level of the code and the syntactic level as it relies on a set of transformer-based models. Afterward, these models are finetuned to detect code clones with interpretable results that explain the detected clone types. Finally, the output of these models is combined to provide a unified final prediction. The empirical evaluation indicates that the framework improves detection performance, achieving an approximately 16.88 % higher F1 score than the state-of-the-art techniques.
引用
收藏
页数:9
相关论文
共 50 条
  • [21] SeTransformer: A Transformer-Based Code Semantic Parser for Code Comment Generation
    Li, Zheng
    Wu, Yonghao
    Peng, Bin
    Chen, Xiang
    Sun, Zeyu
    Liu, Yong
    Paul, Doyle
    IEEE TRANSACTIONS ON RELIABILITY, 2023, 72 (01) : 258 - 273
  • [22] A Transformer-Based GAN for Anomaly Detection
    Yang, Caiyin
    Lan, Shiyong
    Huangl, Weikang
    Wang, Wenwu
    Liul, Guoliang
    Yang, Hongyu
    Ma, Wei
    Li, Piaoyang
    ARTIFICIAL NEURAL NETWORKS AND MACHINE LEARNING - ICANN 2022, PT II, 2022, 13530 : 345 - 357
  • [23] Transformer-Based Fire Detection in Videos
    Mardani, Konstantina
    Vretos, Nicholas
    Daras, Petros
    SENSORS, 2023, 23 (06)
  • [24] Mask DINO: Towards A Unified Transformer-based Framework for Object Detection and Segmentation
    Li, Feng
    Zhang, Hao
    Xu, Huaizhe
    Liu, Shilong
    Zhang, Lei
    Ni, Lionel M.
    Shum, Heimg-Yeung
    2023 IEEE/CVF CONFERENCE ON COMPUTER VISION AND PATTERN RECOGNITION, CVPR, 2023, : 3041 - 3050
  • [25] A transformer-based adversarial network framework for steganography
    Xiao, Chaoen
    Peng, Sirui
    Zhang, Lei
    Wang, Jianxin
    Ding, Ding
    Zhang, Jianyi
    EXPERT SYSTEMS WITH APPLICATIONS, 2025, 269
  • [26] Transformer-based fall detection in videos
    Nunez-Marcos, Adrian
    Arganda-Carreras, Ignacio
    ENGINEERING APPLICATIONS OF ARTIFICIAL INTELLIGENCE, 2024, 132
  • [27] TBCUP: A Transformer-based Code Comments Updating Approach
    Liu, Shifan
    Cui, Zhanqi
    Chen, Xiang
    Yang, Jun
    Li, Li
    Zheng, Liwei
    2023 IEEE 47TH ANNUAL COMPUTERS, SOFTWARE, AND APPLICATIONS CONFERENCE, COMPSAC, 2023, : 892 - 897
  • [28] A Transformer-Based Framework for Geomagnetic Activity Prediction
    Abduallah, Yasser
    Wang, Jason T. L.
    Xu, Chunhui
    Wang, Haimin
    FOUNDATIONS OF INTELLIGENT SYSTEMS (ISMIS 2022), 2022, 13515 : 325 - 335
  • [29] Transformer-based code model with compressed hierarchy representation
    Zhang, Kechi
    Li, Jia
    Li, Zhuo
    Jin, Zhi
    Li, Ge
    EMPIRICAL SOFTWARE ENGINEERING, 2025, 30 (02)
  • [30] Transformer-based Text Detection in the Wild
    Raisi, Zobeir
    Naiel, Mohamed A.
    Younes, Georges
    Wardell, Steven
    Zelek, John S.
    2021 IEEE/CVF CONFERENCE ON COMPUTER VISION AND PATTERN RECOGNITION WORKSHOPS, CVPRW 2021, 2021, : 3156 - 3165