arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2601.18847cs.SEcs.AI
收藏

MulVul: 通过跨模型提示进化实现检索增强的多智能体代码漏洞检测

MulVul: Retrieval-augmented Multi-Agent Code Vulnerability Detection via Cross-Model Prompt Evolution

Zihan Wu, Jie Xu, Yun Peng, Chun Yong Chong, Xiaohua Jia

AI总结:

MulVul通过跨模型提示进化实现多智能体代码漏洞检测,采用由粗到细的策略,利用检索工具提升漏洞识别精度,达到34.79%的Macro-F1成绩。

摘要:

大型语言模型(LLMs)在自动化现实世界漏洞检测方面面临两大关键限制:漏洞模式的异质性削弱了单一统一模型的有效性,而为大量弱点类别手动设计提示工程是不可扩展的。为解决这些挑战,我们提出了MulVul,一种检索增强的多智能体框架,用于精确且广泛覆盖的漏洞检测。MulVul采用由粗到细的策略:首先,路由器代理预测前k个粗略类别,然后将输入转发给专门的检测代理,以识别确切的漏洞类型。两个代理都配备了检索工具,以主动从漏洞知识库中获取证据,以缓解幻觉问题。关键的是,为了自动化专门提示的生成,我们设计了跨模型提示进化,一种提示优化机制,其中生成器LLM迭代优化候选提示,而不同的执行器LLM验证其有效性。这种解耦减轻了单模型优化中固有的自我纠正偏差。在130个CWE类型上评估,MulVul实现了34.79%的Macro-F1,优于最佳基线41.5%。消融研究验证了跨模型提示进化,其通过有效处理多样的漏洞模式,将性能提升了51.6%超过手动提示。

英文摘要:

Large Language Models (LLMs) struggle to automate real-world vulnerability detection due to two key limitations: the heterogeneity of vulnerability patterns undermines the effectiveness of a single unified model, and manual prompt engineering for massive weakness categories is unscalable. To address these challenges, we propose \textbf{MulVul}, a retrieval-augmented multi-agent framework designed for precise and broad-coverage vulnerability detection. MulVul adopts a coarse-to-fine strategy: a \emph{Router} agent first predicts the top-$k$ coarse categories and then forwards the input to specialized \emph{Detector} agents, which identify the exact vulnerability types. Both agents are equipped with retrieval tools to actively source evidence from vulnerability knowledge bases to mitigate hallucinations. Crucially, to automate the generation of specialized prompts, we design \emph{Cross-Model Prompt Evolution}, a prompt optimization mechanism where a generator LLM iteratively refines candidate prompts while a distinct executor LLM validates their effectiveness. This decoupling mitigates the self-correction bias inherent in single-model optimization. Evaluated on 130 CWE types, MulVul achieves 34.79\% Macro-F1, outperforming the best baseline by 41.5\%. Ablation studies validate cross-model prompt evolution, which boosts performance by 51.6\% over manual prompts by effectively handling diverse vulnerability patterns.

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

↑