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

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.

Authors

Institutions

Publication Details

Journal
Sensors
Published
2026-11-24
DOI
https://doi.org/10.3390/s26237426
Primary Topic
Software Engineering Research
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
article

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

Alexios Mylonas, Fiza Naseer, Javed Ali Khan, Muhammad Yaqoob
Sensors
Software Engineering Research
article

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

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

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.

SensorsVol. 26(23)
University of Hertfordshire (GB)
Software Engineering Research
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.

Laika access coming soon