arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2507.03051cs.CRcs.AIcs.CL
收藏

通过分组相对策略优化提升大语言模型在漏洞检测中的推理能力

Improving LLM Reasoning for Vulnerability Detection via Group Relative Policy Optimization

Institute of Informatics and Telematics, National Research Council of Italy(意大利国家研究理事会信息与电信研究所);Department of Excellence in Robotics and AI, TeCIP, Scuola Superiore Sant'Anna(卓越机器人与人工智能系,TeCIP,圣安娜高等学院)

Marco Simoni, Aleksandar Fontana, Giulio Rossolini, Andrea Saracino

AI总结:

本文针对大语言模型在漏洞检测中预测偏差的问题,提出基于分组相对策略优化(GRPO)和规则化奖励的微调方法,并利用 BigVul、DiverseVul、CleanVul 数据集验证其在泛化、推理和性能上优于监督微调。

摘要:

提升和理解大语言模型(LLMs)的训练动态与推理能力,对于其在基于人工智能的安全工具(如软件漏洞检测)中的部署已变得至关重要。在本工作中,我们开展了一项广泛研究,旨在推进近期基于强化学习的大语言模型微调技术在漏洞检测场景中的应用。我们首先指出常用大语言模型的关键局限,例如它们倾向于过度预测某些类型的漏洞,而无法检测其他类型的漏洞。为应对这一挑战,我们探索使用分组相对策略优化(Group Relative Policy Optimization,GRPO)这一近期提出的策略梯度方法,通过结构化的、基于规则的奖励来引导大语言模型的行为。我们通过重新定义其优势函数和奖励信号,使其能够应用于漏洞检测任务,所使用的标注来自该领域广泛使用的数据集,包括 BigVul、DiverseVul 和 CleanVul。所提出的方法支持开展大量实验,以回答多个研究问题,涉及 GRPO 对泛化能力、推理能力以及相对于标准监督微调(SFT)的性能提升的影响。我们的研究结果为基于强化学习的训练在软件漏洞检测场景中提升大语言模型性能和推理能力的潜力提供了有价值的见解。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑