Robust vulnerability detection with limited data via training-efficient adversarial reprogramming

Zhenzhou Tian, Chuang Zhang, Yunpeng Hui, Jiaze Sun, Yanping Chen, Lingwei Chen

Published: 2026, Last Modified: 07 May 2026Autom. Softw. Eng. 2026EveryoneRevisionsBibTeXCC BY-SA 4.0
Abstract: The substantial increase in software vulnerabilities poses a significant threat to system security, prompting a surge of interest in applying deep learning (DL) to vulnerability detection. However, current DL-based detectors heavily rely on large-scale labeled data, leading to inefficiency and notable performance degradation in scenarios with limited data. Furthermore, these detectors often lack robustness against adversarial code transformation attacks. To address these challenges, this paper proposes ArVD (Adversarial Reprogramming-Based Vulnerability Detector), which implements a novel and computationally inexpensive approach to reprogram a pre-trained model for detecting vulnerabilities at the function level. Specifically, ArVD first constructs structure-aware token sequences from source code. Given these inputs, the model then exclusively learns universal perturbation elements to be added into the token sequences and leverages self-attention mechanism to enhance non-linear interactions among tokens and perturbations, such that the learning capabilities from the pre-trained model can be adapted to vulnerability detection with less training data and time yet higher detection effectiveness and robustness. Extensive experiments conducted on multiple datasets demonstrate that ArVD significantly reduces the trainable parameters to approximately 20,000 while outperforming DL-based baselines in terms of detection effectiveness, data-limited performance, as well as runtime overhead. Moreover, ArVD effectively counters code transformation attacks; compared to the state-of-the-art ZigZag framework that is designed to enhance detector robustness, ArVD exhibits an averaged relative improvement of 18.89% in F1, with a decrease of 43.25% and 42.65% in FPR and FNR, respectively.
Loading