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

M2CVD:通过多模型协作增强漏洞语义以进行代码漏洞检测

M2CVD: Enhancing Vulnerability Semantic through Multi-Model Collaboration for Code Vulnerability Detection

Ziliang Wang, Ge Li, Jia Li, Yingfei Xiong, Jia Li, Meng Yan, Zhi Jin

AI总结:

本文提出M2CVD方法,通过LLMs与代码模型协作增强漏洞语义描述,提升代码漏洞检测准确性,并在真实数据集上显著优于基线。

摘要:

大型语言模型(LLMs)在代码理解方面具有强大的能力,但微调成本和语义对齐问题限制了其在特定项目上的优化;相反,诸如CodeBERT之类的代码模型易于微调,但通常难以从复杂的代码语言中学习漏洞语义。为了解决这些挑战,本文引入了多模型协作漏洞检测方法(M2CVD),该方法利用LLMs分析漏洞语义的强大能力来提高代码模型的检测准确性。M2CVD采用了一种新颖的协作过程:首先通过代码模型对项目代码的理解来提高LLMs生成的漏洞语义描述的质量,然后利用这些改进的漏洞语义描述来提高代码模型的检测准确性。我们在两个真实世界数据集上展示了M2CVD的有效性,其中M2CVD显著优于基线。此外,我们证明了M2CVD协作方法可以扩展到其他不同的LLMs和代码模型,以提高它们在漏洞检测任务中的准确性。

英文摘要:

Large Language Models (LLMs) have strong capabilities in code comprehension, but fine-tuning costs and semantic alignment issues limit their project-specific optimization; conversely, code models such CodeBERT are easy to fine-tune, but it is often difficult to learn vulnerability semantics from complex code languages. To address these challenges, this paper introduces the Multi-Model Collaborative Vulnerability Detection approach (M2CVD) that leverages the strong capability of analyzing vulnerability semantics from LLMs to improve the detection accuracy of code models. M2CVD employs a novel collaborative process: first enhancing the quality of vulnerability semantic description produced by LLMs through the understanding of project code by code models, and then using these improved vulnerability semantic description to boost the detection accuracy of code models. We demonstrated M2CVD's effectiveness on two real-world datasets, where M2CVD significantly outperformed the baseline. In addition, we demonstrate that the M2CVD collaborative method can extend to other different LLMs and code models to improve their accuracy in vulnerability detection tasks.

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

↑