VulnLLM-R:基于代理架构的专用推理LLM用于漏洞检测
VulnLLM-R: Specialized Reasoning LLM with Agent Scaffold for Vulnerability Detection
AI总结:
VulnLLM-R通过专用推理模型和代理架构,在漏洞检测中实现高效准确的AI驱动检测。
摘要:
我们提出了VulnLLM-R,首个专为漏洞检测设计的推理LLM。我们的核心观点是LLM能够对程序状态进行推理并分析潜在漏洞,而非简单的模式匹配。这可以提高模型的泛化能力并防止学习捷径。然而,最先进的推理LLM通常是超大规模、闭源或在漏洞检测方面性能有限。为了解决这一问题,我们提出了一种新的训练配方,包括专用数据选择、推理数据生成、推理数据过滤和校正,以及测试阶段优化。使用我们提出的方法,我们训练了一个具有70亿参数的推理模型。通过在Python、C/C++和Java等领域的广泛实验,我们展示了VulnLLM-R在静态分析工具和开源及商业大型推理模型上的优越效果和效率。我们进一步进行了详细的消融研究以验证训练配方中的关键设计。最后,我们围绕我们的模型构建了一个代理架构,并展示了其在真实世界项目中优于CodeQL和AFL++。我们的代理进一步在活跃维护的仓库中发现了若干零日漏洞。这项工作代表了利用专用推理模型驱动的AI代理进行真实世界、项目级漏洞检测的开创性努力。代码可在github.com/ucsb-mlsec/VulnLLM-R获取。
英文摘要:
We propose VulnLLM-R, the~\emph{first specialized reasoning LLM} for vulnerability detection. Our key insight is that LLMs can reason about program states and analyze the potential vulnerabilities, rather than simple pattern matching. This can improve the model's generalizability and prevent learning shortcuts. However, SOTA reasoning LLMs are typically ultra-large, closed-source, or have limited performance in vulnerability detection. To address this, we propose a novel training recipe with specialized data selection, reasoning data generation, reasoning data filtering and correction, and testing-phase optimization. Using our proposed methodology, we train a reasoning model with seven billion parameters. Through extensive experiments on SOTA datasets across Python, C/C++, and Java, we show that VulnLLM-R has superior effectiveness and efficiency than SOTA static analysis tools and both open-source and commercial large reasoning models. We further conduct a detailed ablation study to validate the key designs in our training recipe. Finally, we construct an agent scaffold around our model and show that it outperforms CodeQL and AFL++ in real-world projects. Our agent further discovers a set of zero-day vulnerabilities in actively maintained repositories. This work represents a pioneering effort to enable real-world, project-level vulnerability detection using AI agents powered by specialized reasoning models. The code is available at~\href{https://github.com/ucsb-mlsec/VulnLLM-R}{github}.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。