arXiv:2507.03051cs.CRcs.AI2025-07被引 7

用强化学习优化大模型漏洞检测,提升准确率与推理能力。

Improving LLM Reasoning for Vulnerability Detection via Group Relative Policy Optimization

  • 采用分组相对策略优化(GRPO)增强模型推理能力
  • 在BigVul等数据集上显著降低误报率,提升检出率
  • 适合安全方向研究者和工业界漏洞检测系统开发者

提升大型语言模型(LLM)在软件漏洞检测中的推理能力与训练动态已成为部署AI安全工具的关键。本文深入研究基于强化学习的微调技术在漏洞检测中的应用。针对现有模型过度预测特定漏洞类型而漏检其他类型的问题,提出使用分组相对策略优化(GRPO)方法,通过结构化规则奖励引导模型行为。我们基于BigVul、DiverseVul和CleanVul等常用数据集的标注信息重构了优势函数与奖励信号,使GRPO适用于漏洞检测任务。通过大量实验,探讨了GRPO对泛化性、推理能力及性能提升的影响。结果表明,相较于标准监督微调(SFT),GRPO能有效提升模型在多种漏洞类型上的检测表现,并增强其可解释的推理过程,为强化学习驱动的安全型大模型提供了重要实践参考。

原文摘要 · Abstract (English)

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.

大模型安全强化学习漏洞检测

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。