Skip to main navigation Skip to search Skip to main content

Enhancing Fine-Grained Vulnerability Detection With Reinforcement Learning

  • School of Computer Science and Technology, Harbin Institute of Technology
  • Singapore Management University

Research output: Contribution to journalArticlepeer-review

Abstract

The rapid growth of vulnerabilities has significantly accelerated the development of automated vulnerability detection methods, especially those based on data-driven models. However, most of them primarily focus on extracting accurate code representations while overlooking the complex vulnerability patterns among vulnerable statements, thereby leaving room for improvement. To overcome this limitation, we present a novel reinforcement learning framework (RLFD) for detecting vulnerabilities at a fine-grained level. RLFD redefines the detection task as a sequential decision-making process and then employs reinforcement learning to automatically learn vulnerability-relevant structures from code snippets. Moreover, by designing reward functions aligned with fine-grained evaluation metrics, RLFD focuses on the co-existence relations among statements from a global perspective, enabling the model to capture complex interactions that lead to vulnerabilities. Additionally, the framework utilizes CodeBERT-HLS for code representation, ensuring consistency with the state-of-the-art method while highlighting the improvements brought by the proposed reinforcement learning-based approach. Comprehensive experiments show that our method achieves a locating precision (IoU) of 69.7% and a Top-5% Acc of 67.7% on the big_vul dataset, outperforming the state-of-the-art method by an overall 3.4% improvement in IoU. Notably, our method achieves up to a 19.7% increase in IoU for specific categories, e.g., CWE-416 (use-after-free).

Original languageEnglish
Pages (from-to)2900-2920
Number of pages21
JournalIEEE Transactions on Software Engineering
Volume51
Issue number10
DOIs
StatePublished - 2025
Externally publishedYes

Keywords

  • Vulnerability detection
  • data-driven methods
  • fine-grained
  • reinforcement learning

Fingerprint

Dive into the research topics of 'Enhancing Fine-Grained Vulnerability Detection With Reinforcement Learning'. Together they form a unique fingerprint.

Cite this