Design of automatic code defect detection model based on Transformer

In order to improve the accuracy of defect detection in complex codes, an automated recognition model based on Transformer is designed to study the feature extraction, semantic encoding and defect modeling mechanism. The CodeXGLUE dataset is used as an example to construct a multi-label classification task with 21,854 samples and a maximum Token length of 512. Experimental results show that the model achieves 0.78 on multi-class F1-score, which is significantly better than that of BiLSTM (0.61) and CNN (0.65), and maintains a high recognition ability on the exception call and variable undefined classes. The ablation experiments verify the significant contribution of positional coding and Focal Loss mechanism to performance stability and class separation.

Authors

Institutions

Publication Details

Published
2025-07-18
DOI
https://doi.org/10.1109/ecnct66493.2025.11172641
Primary Topic
Software Testing and Debugging Techniques
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Design of automatic code defect detection model based on Transformer

Mingwan Luo
Software Testing and Debugging Techniques
article

Design of automatic code defect detection model based on Transformer

Mingwan Luo
article en

Abstract

In order to improve the accuracy of defect detection in complex codes, an automated recognition model based on Transformer is designed to study the feature extraction, semantic encoding and defect modeling mechanism. The CodeXGLUE dataset is used as an example to construct a multi-label classification task with 21,854 samples and a maximum Token length of 512. Experimental results show that the model achieves 0.78 on multi-class F1-score, which is significantly better than that of BiLSTM (0.61) and CNN (0.65), and maintains a high recognition ability on the exception call and variable undefined classes. The ablation experiments verify the significant contribution of positional coding and Focal Loss mechanism to performance stability and class separation.

Yangzhou Polytechnic Institute (CN)
Openalex Percentile: Top 73%
Software Testing and Debugging Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.