Sensors

A Multi-Dataset Study of Language-Specific Transformer Models for Software Vulnerability Detection: Insights and Challenges

Fiza Naseer, Javed Ali Khan, Muhammad Yaqoob, Alexios Mylonas

Key points

From the paper's conclusion
  • All CVEFixes transformer settings produced negative mean MCC and mean ROC-AUC below 0.5.

Abstract

Background: Transformer-based vulnerability detection can produce different results across programming languages and datasets, complicating the interpretation of model effectiveness. Methods: This study evaluates CodeBERT, GraphCodeBERT, UniXcoder, CodeT5-base, and CodeT5+ on CVEALL, REEF, and CVEFixes. Models were fine-tuned independently for each dataset and language group using a common focal-loss configuration and a 512-token input limit. Three-fold outer evaluation used repository-grouped splitting for CVEALL and REEF and stratified splitting without repository grouping for CVEFixes. Checkpoints and classification thresholds were selected exclusively using inner-validation data. Accuracy, vulnerable-class precision, recall, F1, specificity, balanced accuracy, Matthews correlation coefficient (MCC), ROC-AUC, and average precision were reported as means and sample standard deviations across folds. Results: CVEALL exhibited modest discrimination, with mean MCC ranging from 0.0870 to 0.2293. REEF mean MCC ranged from −0.0006 to 0.1608, although some settings showed stronger vulnerable–patched pair ranking than standalone classification. All CVEFixes transformer settings produced negative mean MCC and mean ROC-AUC below 0.5. High accuracy or vulnerable-class F1 sometimes coincided with low vulnerable-class recall or specificity. In the proposed approach, none of the fine-tuned transformer models consistently achieved the highest scores across languages and datasets. Conclusions: The findings support interpreting transformer performance within clearly specified data and evaluation conditions. Complementary class-specific and ranking measures reveal limitations obscured by accuracy or F1 alone. Input coverage, dataset characteristics, and provenance constraints warrant further investigation, while differences between partitioning strategies limit direct cross-dataset comparisons.

Read the paper

Discussion

Science Skim's AI key points, plus readers' public thoughts

Readers' thoughts

No reader thoughts yet.

Related papers