arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2506.07503cs.SE
收藏

评估大型语言模型在双粒度多语言漏洞检测中的性能

Evaluating Large Language Models for Multilingual Vulnerability Detection at Dual Granularities

Tianjin University(天津大学);Kyushu University(九州大学);The University of Melbourne(墨尔本大学);Monash University(蒙纳士大学)

Honglin Shu, Michael Fu, Junji Yu, Dong Wang, Chakkrit Tantithamthavorn, Junjie Chen, Yasutaka Kamei

AI总结:

本研究评估了大型语言模型在多语言漏洞检测中的性能,发现GPT-4o在函数级和行级检测中表现优异,优于其他模型。

摘要:

各种基于深度学习的方法利用预训练语言模型(PLMs)进行自动化漏洞检测。随着大型语言模型(LLMs)的最新进展,一些研究开始探索其在漏洞检测任务中的应用。然而,现有研究主要集中在特定编程语言(如C/C++)和函数级检测上,留下PLMs和LLMs在多语言和多粒度场景中的优势和劣势未被探索。为填补这一空白,我们进行了全面的细粒度实证研究,评估了最先进的PLMs和LLMs在多语言漏洞检测中的有效性。使用超过30,000个真实世界漏洞修复补丁,涵盖七种编程语言,我们系统地评估了模型在函数级和行级的表现。我们的关键发现表明,通过指令微调和少样本提示增强的GPT-4o显著优于所有其他评估模型,包括CodeT5P。进一步,基于LLM的方法在检测独特多语言漏洞方面表现出更强的能力,特别是在识别最危险和高严重性漏洞方面。这些结果突显了在函数级和行级采用LLMs进行多语言漏洞检测的潜力,揭示了其互补优势和对PLM方法的显著改进。对PLMs和LLMs在多语言漏洞检测中的实证评估突显了LLMs在解决现实软件安全挑战中的价值。

英文摘要:

Various deep learning-based approaches utilizing pre-trained language models (PLMs) have been proposed for automated vulnerability detection. With recent advancements in large language models (LLMs), several studies have begun exploring their application to vulnerability detection tasks. However, existing studies primarily focus on specific programming languages (e.g., C/C++) and function-level detection, leaving the strengths and weaknesses of PLMs and LLMs in multilingual and multi-granularity scenarios largely unexplored. To bridge this gap, we conduct a comprehensive fine-grained empirical study evaluating the effectiveness of state-of-the-art PLMs and LLMs for multilingual vulnerability detection. Using over 30,000 real-world vulnerability-fixing patches across seven programming languages, we systematically assess model performance at both the function-level and line-level. Our key findings indicate that GPT-4o, enhanced through instruction tuning and few-shot prompting, significantly outperforms all other evaluated models, including CodeT5P. Furthermore, the LLM-based approach demonstrates superior capability in detecting unique multilingual vulnerabilities, particularly excelling in identifying the most dangerous and high-severity vulnerabilities. These results underscore the promising potential of adopting LLMs for multilingual vulnerability detection at function-level and line-level, revealing their complementary strengths and substantial improvements over PLM approaches. This empirical evaluation of PLMs and LLMs for multilingual vulnerability detection highlights LLMs' value in addressing real-world software security challenges.

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

↑