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

舒适区之外:分析 LLM 在软件漏洞检测中的能力

Outside the Comfort Zone: Analysing LLM Capabilities in Software Vulnerability Detection

Yuejun Guo, Constantinos Patsakis, Qiang Hu, Qiang Tang, Fran Casino

AI总结:

本文全面分析了 LLMs 在源代码漏洞检测中的能力,通过对比专用与通用模型在多个基准数据集上的二分类表现,发现微调能显著提升小型模型在特定场景下的检测能力,并指出了当前基准数据集存在错误标注等问题。

摘要:

由自动化和更快的开发生命周期驱动的软件产量大幅增加,导致了软件漏洞的相应激增。与此同时,软件漏洞检测不断演进的格局,突显了从传统方法向机器学习和大型语言模型(LLMs)的转变,这在以消耗大量计算资源为代价的同时,提供了巨大的机遇。本文通过测试模型超出其常规应用范围,研究其在网络安全任务中的潜力,全面分析了 LLMs 在检测源代码漏洞方面的能力。我们评估了六个专门针对漏洞检测训练的开源模型与六个通用 LLMs 的性能,其中三个通用模型在我们编译的数据集上进行了进一步微调。我们的数据集连同五个最先进的基准数据集,被用于创建一个流水线,以执行二分类任务,即将代码分类为有漏洞和无漏洞。研究结果突显了各基准测试之间分类准确率的显著差异,揭示了微调在增强小型 LLMs 相较于大型模型的检测能力方面的关键影响,但这仅在其训练的特定场景中有效。进一步的实验和分析还强调了当前基准数据集存在的问题,特别是错误标注及其对模型训练和性能的影响,这引发了对当前实践状况的担忧。我们还讨论了该领域未来的发展道路,提出了改进模型训练和数据集构建的策略。

英文摘要:

The significant increase in software production driven by automation and faster development lifecycles has resulted in a corresponding surge in software vulnerabilities. In parallel, the evolving landscape of software vulnerability detection, highlighting the shift from traditional methods to machine learning and large language models (LLMs), provides massive opportunities at the cost of resource-demanding computations. This paper thoroughly analyses LLMs' capabilities in detecting vulnerabilities within source code by testing models beyond their usual applications to study their potential in cybersecurity tasks. We evaluate the performance of six open-source models that are specifically trained for vulnerability detection against six general-purpose LLMs, three of which were further fine-tuned on a dataset that we compiled. Our dataset, alongside five state-of-the-art benchmark datasets, were used to create a pipeline to leverage a binary classification task, namely classifying code into vulnerable and non-vulnerable. The findings highlight significant variations in classification accuracy across benchmarks, revealing the critical influence of fine-tuning in enhancing the detection capabilities of small LLMs over their larger counterparts, yet only in the specific scenarios in which they were trained. Further experiments and analysis also underscore the issues with current benchmark datasets, particularly around mislabeling and their impact on model training and performance, which raises concerns about the current state of practice. We also discuss the road ahead in the field suggesting strategies for improved model training and dataset curation.

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

↑