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

VULPO:基于策略优化的上下文感知漏洞检测

VULPO: Context-Aware Vulnerability Detection via On-Policy LLM Optimization

University of Texas at Dallas(德克萨斯大学达拉斯分校);Microsoft(微软)

Youpeng Li, Fuxun Yu, Weiliang Qi, Xinda Wang

AI总结:

提出VULPO框架,通过构建包含上下文信息和推理轨迹的数据集ContextVul,结合冷启动监督微调和自适应策略优化,显著提升大语言模型在真实仓库中的漏洞检测能力。

摘要:

大语言模型(LLM)最近在漏洞检测(VD)中展现出强大潜力。然而,准确检测真实仓库中的漏洞需要推理复杂的上下文交互。现有的基于LLM的VD方法仍然有限,因为当前数据集缺乏完整的上下文信息和高质量的推理监督,而现有的优化方法主要依赖于粗粒度的结果中心监督信号,无法建模漏洞推理过程。为解决这些限制,我们首先构建了ContextVul,这是一个新数据集,用仓库级上下文信息和精心整理的漏洞推理轨迹增强了高质量函数级漏洞基准。基于ContextVul,我们引入了一个两阶段优化框架,包括轻量级冷启动监督微调,随后是漏洞自适应策略优化(VULPO)。VULPO结合了多维奖励,共同评估漏洞识别、漏洞相关定位和因果推理质量,以及难度自适应奖励缩放,以减轻奖励黑客攻击并提高强化学习效果。大量实验证明了VULPO在上下文感知VD中的优越性。我们的VULPO-4B,第一个专门的漏洞推理LLM,显著优于现有的VD基线,相对于Qwen3-4B将Pairwise Pass@1提高了203%,并实现了与规模大150%的LLM DeepSeek-V3.1相竞争的性能。

英文摘要:

Large language models (LLMs) have recently shown strong potential in vulnerability detection (VD). However, accurately detecting vulnerabilities in real-world repositories requires reasoning over complex contextual interactions. Existing LLM-based VD approaches remain limited because current datasets lack complete contextual information and high-quality reasoning supervision, while existing optimization methods primarily rely on coarse outcome-centric supervision signals that fail to model the vulnerability reasoning process. To address these limitations, we first construct ContextVul, a new dataset that augments high-quality function-level vulnerability benchmarks with repository-level contextual information and curated vulnerability reasoning traces. Building upon ContextVul, we introduce a two-stage optimization framework consisting of lightweight cold-start supervised fine-tuning followed by vulnerability-adaptive on-policy optimization (VULPO). VULPO incorporates multidimensional rewards that jointly evaluate vulnerability identification, vulnerability-relevant localization, and causal reasoning quality, along with difficulty-adaptive reward scaling to mitigate reward hacking and improve RL effectiveness. Extensive experiments demonstrate the superiority of VULPO for context-aware VD. Our VULPO-4B, the first specialized vulnerability reasoning LLM, substantially outperforms existing VD baselines, improving Pairwise Pass@1 by 203% relative to Qwen3-4B and achieving competitive performance against a 150% larger-scale LLM, DeepSeek-V3.1.

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

↑