Seedlabs
Source research

Boosting Vulnerability Detection of LLMs via Curriculum Preference Optimization with Synthetic Reasoning Data

Xin-Cheng Wen, Yijun Yang, Cuiyun Gao, Yang Xiao, Deheng Ye · 2025 · 23 citationsRead the paper

Large language models (LLMs) demonstrate considerable proficiency in numerous codingrelated tasks; however, their capabilities in detecting software vulnerabilities remain limited.This limitation primarily stems from two factors: (1) the absence of reasoning data related to vulnerabilities, which hinders the models' ability to capture underlying vulnerability patterns; and (2) their focus on learning semantic representations rather than the reason behind them, thus failing to recognize semantically similar vulnerability samples.Furthermore, the development of LLMs specialized in vulnerability detection is challenging, particularly in environments characterized by the scarcity of high-quality datasets.In this paper, we propose a novel framework ReVD that excels at mining vulnerability patterns through reasoning data synthesizing and vulnerability-specific preference optimization.Specifically, we construct forward and backward reasoning processes for vulnerability and corresponding fixed code, ensuring the synthesis of high-quality reasoning data.Moreover, we design the triplet supervised fine-tuning followed by curriculum online preference optimization for enabling ReVD to better understand vulnerability patterns.The extensive experiments conducted on PrimeVul and SVEN datasets demonstrate that ReVD sets new state-of-the-art for LLM-based software vulnerability detection, e.g., 12.24%-22.77%improvement in the accuracy.

What the full text shows

Working prototype
  • ReVD achieved state-of-the-art accuracy on PrimeVul and SVEN datasets, showing an improvement over baselines. — 12.24%-22.77% improvement in accuracy (Integrated with Qwen2.5-Coder-7B-Instruct)
  • ReVD achieved specific performance metrics on the PrimeVul dataset. — 58.05% accuracy, 63.83% F1 score, 16.09% VP-Score (Using Qwen2.5-Coder-7B-Instruct)
  • ReVD achieved specific performance metrics on the SVEN dataset. — 63.72% accuracy, 69.49% F1 score, 27.44% VP-Score (Using Qwen2.5-Coder-7B-Instruct)
  • Bi-directional vulnerability interpretation data (BVD) significantly improved accuracy over original data. — 6.29% improvement on PrimeVul and 10.96% on SVEN (Compared to w/o BVD + T-SFT variant)
  • Curriculum Online Preference Optimization (COPO) increased the performance upper bound. — 2.04% accuracy increase on PrimeVul and 4.53% on SVEN (Compared to w/o COPO variant)
Setup
Evaluated on PrimeVul (6,968 vulnerable samples, 140 CWEs) and SVEN (416 vulnerable/fixed codes) datasets using C/C++ code; base models included Qwen2.5-Coder-7B-Instruct, Llama-3.1-8B-Instruct, and StarCoder2-7B.
How
The ReVD framework uses a two-stage approach: first, it synthesizes bi-directional reasoning data (BVD) for vulnerabilities and fixes, followed by triplet supervised fine-tuning (T-SFT). Second, it applies Curriculum Online Preference Optimization (COPO) using LoRA to refine the model's ability to identify difficult vulnerability patterns.
Limitations
Limited to LLM sizes of 7B and 8B due to computing resource constraints. · Struggles with code snippets exceeding 4,096 tokens. · Performance declines if COPO training exceeds 3 rounds due to limited training sample pool.

Summarized by Gemma 4 from the open-access full text · 22 Nov 2026. Read it