A structured overview and empirical evaluation of fine-tuning pre-trained transformer models for software defect prediction
Nasraldeen Alnor Adam Khleel, Károly Nehéz
Key points
From the paper's conclusion- The findings demonstrate the importance of repeated-run evaluation, statistical analysis, class-wise assessment, error analysis, and computational considerations when benchmarking transformer-based models for SDP.
Abstract
Software defect prediction (SDP) is an important task in software engineering that aims to identify defect-prone software components before deployment, thereby supporting software reliability and reducing maintenance effort. Recent advances in pre-trained transformer models (PTMs) have demonstrated considerable potential for source-code understanding and automated defect detection. However, comparisons of transformer-based models across previous studies are often complicated by differences in datasets, preprocessing procedures, training configurations, and evaluation protocols. This study presents a focused literature overview and a controlled empirical benchmarking evaluation of four widely used transformer-based models BERT Base, DistilBERT, RoBERTa, and CodeBERT—for software defect prediction using the CodeXGLUE-Devign dataset. Rather than proposing a new model architecture, the study investigates the comparative behavior of existing pre-trained transformer models under a common experimental configuration. To reduce dependence on a single random initialization, each model is independently fine-tuned and evaluated using five random seeds, resulting in 20 training runs. Performance is assessed using Accuracy, Precision, Recall, and F1-score, with results reported as mean ± standard deviation across the five runs. Pairwise differences are further examined using the Wilcoxon signed-rank test with Holm correction for multiple comparisons. The experimental results show that CodeBERT achieves the highest mean Accuracy (72.69 ± 0.88%), Precision (74.33 ± 1.75%), and F1-score (66.60 ± 1.67%), whereas BERT Base obtains the highest mean Recall (61.48 ± 3.07%). DistilBERT achieves an Accuracy of 69.29 ± 0.87% and an F1-score of 64.33 ± 1.48% while requiring substantially less training time than the larger models. RoBERTa exhibits lower and considerably more variable performance across the five runs. Nevertheless, none of the pairwise performance differences remain statistically significant at α = 0.05 after Holm correction. The findings demonstrate the importance of repeated-run evaluation, statistical analysis, class-wise assessment, error analysis, and computational considerations when benchmarking transformer-based models for SDP. The study therefore provides replication-oriented empirical evidence concerning the performance, stability, error characteristics, and computational trade-offs of existing transformer architectures under a controlled experimental setting.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- A Multi-Dataset Study of Language-Specific Transformer Models for Software Vulnerability Detection: Insights and ChallengesSensors · 2026
- Beyond Confidence: Rethinking Uncertainty Calibration in Deep Code ModelsarXiv · 2026
- Test Case Selection for Deep Neural Networks: A Replication Study on LLMs for Code (Replicability Study)Proceedings of the ACM on Software Engineering · 2026
- Domain Adaptation for Cross-Project Defect Prediction via Transfer-Contrastive Learning with Large Language ModelsAlgorithms · 2026
- Bug Severity Classification with Fine-Tuned Open LLMs: A Paired Comparison with TF-IDF and CodeBERT Baselines on Eclipse ReportsarXiv · 2026
- Cross‐Repository Software Defect Prediction: A Leave‐One‐Repository‐Out Empirical Study Across Five Mature Open‐Source ProjectsJournal of Software: Evolution and Process · 2026