Improving LLM Reasoning for Vulnerability Detection via Group Relative Policy Optimization
On the map: LLM reasoning → Reasoning for agents, planning and code
Abstract (arXiv)
Improving and understanding the training dynamics and reasoning of Large Language Models (LLMs) has become essential for their deployment in AI-based security tools, such as software vulnerability detection. In this work, we present an extensive study aimed at advancing recent RL-based finetuning techniques for LLMs in the context of vulnerability detection. We start by highlighting key limitations of commonly adopted LLMs, such as their tendency to over-predict certain types of vulnerabilities while failing to detect others. To address this challenge, we explore the use of Group Relative Policy Optimization (GRPO), a recent policy-gradient method, for guiding LLM behavior through structured, rule-based rewards. We enable its application to the vulnerability detection task by redefining its advantage functions and reward signals using annotations from widely used datasets in the field, including BigVul, DiverseVul, and CleanVul. The proposed methodology enables an extensive set of experiments, addressing multiple research questions regarding the impact of GRPO on generalization, reasoning capabilities, and performance improvements over standard supervised finetuning (SFT). Our findings offer valuable insights into the potential of RL-based training to enhance both the performance and reasoning abilities of LLMs in the context of software vulnerability detection.
Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 29 of its 43 references that are in the map. First posted on arXiv 3 Jul 2025.
Builds on
29 of 43 references.
References · 29
- 2023GPT-4 Technical Reportcited by 18,396
- 2017Proximal Policy Optimization Algorithmscited by 15,215
- 2024DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Modelscited by 9,379
- 2025Qwen3 Technical Reportcited by 8,820
- 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,330
- 2025Understanding R1-Zero-Like Training: A Critical Perspectivecited by 1,345
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 885
- 2019Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networkscited by 272
- 2024ReFT: Reasoning with Reinforced Fine-Tuningcited by 239
- 2023How Abilities in Large Language Models are Affected by Supervised Fine-tuning Data Compositioncited by 223
- 2023DiverseVul: A New Vulnerable Source Code Dataset for Deep Learning Based Vulnerability Detectioncited by 102
17 more
- 2024Group Robust Preference Optimization in Reward-free RLHFcited by 95
- 2018SySeVR: A Framework for Using Deep Learning to Detect Software Vulnerabilitiescited by 92
- 2021CVEfixes: Automated Collection of Vulnerabilities and Their Fixes from Open-Source Softwarecited by 91
- 2024Vul-RAG: Enhancing LLM-based Vulnerability Detection via Knowledge-level RAGcited by 68
- 2023Large Language Models for Test-Free Fault Localizationcited by 67
- 2023Prompt-Enhanced Software Vulnerability Detection Using ChatGPTcited by 51
- 2024Large Language Model for Vulnerability Detection and Repair: Literature Review and the Road Aheadcited by 42
- 2025Beyond Reward Hacking: Causal Rewards for Large Language Model Alignmentcited by 42
- 2020VulDeeLocator: A Deep Learning-based Fine-grained Vulnerability Detectorcited by 37
- 2024BugsInPy: A Database of Existing Bugs in Python Programs to Enable Controlled Testing and Debugging Studiescited by 36
- 2023Zero-Shot Reinforcement Learning from Low Quality Datacited by 21
- 2022VUDENC: Vulnerability Detection with Deep Learning on a Natural Codebase for Pythoncited by 17
- 2024Outside the Comfort Zone: Analysing LLM Capabilities in Software Vulnerability Detectioncited by 16
- 2024Security Vulnerability Detection with Multitask Self-Instructed Fine-Tuning of Large Language Modelscited by 14
- 2024Sail into the Headwind: Alignment via Robust Rewards and Dynamic Labels against Reward Hackingcited by 13
- 2024Harnessing the Power of LLMs in Source Code Vulnerability Detectioncited by 6
- 2022DeepVulSeeker: A Novel Vulnerability Identification Framework via Code Graph Structure and Pre-training Mechanismcited by 1
Built on by
Citing papers per year: 2025: 2; 2026: 2.
4 papers.
- 2025GTPO: Stabilizing Group Relative Policy Optimization via Gradient and Entropy Controlcited by 18
- 2026CVE-Factory: Scaling Expert-Level Agentic Tasks for Code Security Vulnerabilitycited by 9
- 2026From SFT to RL: Demystifying the Post-Training Pipeline for LLM-based Vulnerability Detectioncited by 4
- 2025VULPO: Context-Aware Vulnerability Detection via On-Policy LLM Optimizationcited by 3
- 2026From SFT to RL: Demystifying the Post-Training Pipeline for LLM-based Vulnerability Detection15 Feb 2026
- 2026CVE-Factory: Scaling Expert-Level Agentic Tasks for Code Security Vulnerability3 Feb 2026
- 2025VULPO: Context-Aware Vulnerability Detection via On-Policy LLM Optimization14 Nov 2025
- 2025GTPO: Stabilizing Group Relative Policy Optimization via Gradient and Entropy Control5 Aug 2025
Similar, not cited
Close in wording, no citation either way
- 2025AD-FM: Multimodal LLMs for Anomaly Detection via Multi-Stage Reasoning and Fine-Grained Reward Optimization
- 2025VulnLLM-R: Specialized Reasoning LLM with Agent Scaffold for Vulnerability Detection
- 2025Boosting Vulnerability Detection of LLMs via Curriculum Preference Optimization with Synthetic Reasoning Data
- 2024To Err is Machine: Vulnerability Detection Challenges LLM Reasoning
- 2024LLM4Vuln: A Unified Evaluation Framework for Decoupling and Enhancing LLMs' Vulnerability Reasoning
- 2025LLMpatronous: Harnessing the Power of LLMs For Vulnerability Detection
- 2026Token-Level Policy Optimization: Linking Group-Level Rewards to Token-Level Aggregation via Sequence-Level Likelihood
- 2025Composing Policy Gradients and Prompt Optimization for Language Model Programs