arXiv:2511.16708cs.SEcs.AI2025-11被引 1

多智能体协作提升代码漏洞检测率,理论与实证均证明组合优于单个工具。

Multi-Agent Code Verification via Information Theory

  • 设计四个专精智能体,通过信息论证明组合可覆盖更多漏洞类型。
  • 在99个样本上检出76.1%的漏洞,比单智能体提升近40个百分点。
  • 实时检测300个真实补丁仅需200毫秒,适合生产环境部署。

大型语言模型生成的代码存在严重缺陷:在SWE-bench中,29.6%的修复补丁失败;在BaxBench中,62%的解决方案含漏洞;现有工具仅能捕获65%的错误,且误报率达35%。为此,我们构建了CodeX-Verify,一个由四个专精智能体组成的多代理系统,用于检测不同类型的漏洞。我们从信息论角度证明,在条件独立下,互信息的次模性保证了多个具有不同检测模式的智能体组合能发现比单一智能体更多的漏洞。实测显示,各智能体相关系数ρ为0.05至0.25,表明其检测路径差异显著。在99个带标注的代码样本上,系统检出率76.1%,与最佳现有方法Meta Prompt Testing(75%)相当,但无需执行测试且速度更快。测试全部15种智能体组合后发现,相比单智能体平均32.8%的准确率,多智能体组合最高达72.4%,提升39.7个百分点,且后续每增加一个智能体带来的增益依次为+14.9、+13.5、+11.2个百分点,验证了理论模型。最优双智能体组合(Correctness + Performance)准确率达79.3%。对300个来自Claude Sonnet 4.5的真实补丁进行测试,每个样本处理时间低于200毫秒,具备实际部署可行性。

原文摘要 · Abstract (English)

LLMs generate buggy code: 29.6% of SWE-bench solved patches fail, 62% of BaxBench solutions have vulnerabilities, and existing tools only catch 65% of bugs with 35% false positives. We built CodeX-Verify, a multi-agent system that uses four specialized agents to detect different types of bugs. We prove mathematically that combining agents with different detection patterns finds more bugs than any single agent when the agents look for different problems, using submodularity of mutual information under conditional independence. Measuring agent correlation of rho = 0.05 to 0.25 confirms they detect different bugs. Testing on 99 code samples with verified labels shows our system catches 76.1% of bugs, matching the best existing method (Meta Prompt Testing: 75%) while running faster and without test execution. We tested all 15 agent combinations and found that using multiple agents improves accuracy by 39.7 percentage points (from 32.8% to 72.4%) compared to single agents, with diminishing returns of +14.9pp, +13.5pp, and +11.2pp for agents 2, 3, and 4, validating our theoretical model. The best two-agent combination (Correctness + Performance) reaches 79.3% accuracy. Testing on 300 real patches from Claude Sonnet 4.5 runs in under 200ms per sample, making this practical for production use.

代码验证多智能体信息论漏洞检测

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