多模型协同是否能提升安全代码生成?基于多LLMSecCodeEval的全面评估
Does Teaming-Up LLMs Improve Secure Code Generation? A Comprehensive Evaluation with Multi-LLMSecCodeEval
AI总结:
本文通过多LLMSecCodeEval框架评估多模型协同对安全代码生成的影响,发现混合策略在安全性能上表现最佳,而模型规模并非安全保障的关键因素。
摘要:
利用大型语言模型(LLMs)自动从自然语言生成源代码已变得普遍,但安全漏洞仍持续存在,尽管在微调和提示技术上有所进步。本文系统评估了多LLM集成和协作策略是否能显著提升安全代码生成。我们提出了MULTI-LLMSECCODEEVAL框架,通过结合多个LLM与静态分析和结构化协作,评估和增强整个漏洞管理生命周期的安全性。使用SecLLMEval和SecLLMHolmes,我们基准测试了十个涵盖单模型、集成、协作和混合设计的管道。结果显示,集成管道结合静态分析在SecLLMEval上比单个LLM基线提高了47.3%,在SecLLMHolmes上提高了19.3%。纯LLM协作管道的提升较小,为8.9%至22.3%。混合管道整合集成、检测和修补,实现了最强的安全性能,优于最佳集成基线1.78%至4.72%,优于协作基线19.81%至26.78%。消融研究揭示模型规模本身并不保证安全。较小的结构化多模型集成持续优于大型单体LLM。总体而言,我们的发现表明,安全代码不源于规模,而源于精心设计的多模型系统。
英文摘要:
Automatically generating source code from natural language using large language models (LLMs) is becoming common, yet security vulnerabilities persist despite advances in fine tuning and prompting. In this work, we systematically evaluate whether multi LLM ensembles and collaborative strategies can meaningfully improve secure code generation. We present MULTI-LLMSECCODEEVAL, a framework for assessing and enhancing security across the vulnerability management lifecycle by combining multiple LLMs with static analysis and structured collaboration. Using SecLLMEval and SecLLMHolmes, we benchmark ten pipelines spanning single model, ensemble, collaborative, and hybrid designs. Our results show that ensemble pipelines augmented with static analysis improve secure code generation over single LLM baselines by up to 47.3% on SecLLMEval and 19.3% on SecLLMHolmes, while purely LLM based collaborative pipelines yield smaller gains of 8.9% to 22.3%. Hybrid pipelines that integrate ensembling, detection, and patching achieve the strongest security performance, outperforming the best ensemble baseline by 1.78% to 4.72% and collaborative baselines by 19.81% to 26.78%. Ablation studies reveal that model scale alone does not ensure security. Smaller, structured multi model ensembles consistently outperform large monolithic LLMs. Overall, our findings demonstrate that secure code does not emerge from scale, but from carefully orchestrated multi model system design.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。