arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2512.22306cs.CRcs.AI
收藏

超越单一漏洞:为多漏洞检测大规模语言模型进行基准测试

Beyond Single Bugs: Benchmarking Large Language Models for Multi-Vulnerability Detection

BITS Pilani(比斯·比兰迪大学);Virginia Tech(弗吉尼亚理工大学)

Chinmay Pushkar, Sanchit Kabra, Dhruv Kumar, Jagat Sesh Challa

AI总结:

本文提出多漏洞检测基准测试,评估LLMs在不同漏洞密度下的性能,发现高密度下性能显著下降,尤其在Python和JavaScript中表现较差。

摘要:

大规模语言模型(LLMs)在自动化软件安全领域展现出显著潜力,尤其是在漏洞检测方面。然而,现有基准测试主要关注孤立的单漏洞样本或函数级分类,无法反映现实世界软件的复杂性,其中多个相互作用的漏洞往往共存于大型文件中。最近的研究表明,LLMs在多标签任务中存在“计数偏差”和“选择偏差”,但这一现象在代码安全领域尚未被严格量化。在本工作中,我们引入了一个涵盖四种主要语言(C、C++、Python和JavaScript)的多漏洞检测综合基准测试。我们通过系统地在长上下文代码样本(7.5k-10k个标记)中注入受控数量的漏洞(1、3、5和9个)来构建包含40,000个文件的数据集。我们评估了五种最先进的LLMs,包括GPT-4o-mini、Llama-3.3-70B和Qwen-2.5系列。我们的结果表明,随着漏洞密度的增加,性能会显著下降。虽然Llama-3.3-70B在单漏洞C任务中实现了接近完美的F1分数(约0.97),但在高密度设置中性能下降高达40%。值得注意的是,Python和JavaScript相较于C/C++表现出不同的失败模式,模型在复杂Python文件中表现出严重的“低估”(召回率降至低于0.30)。

英文摘要:

Large Language Models (LLMs) have demonstrated significant potential in automated software security, particularly in vulnerability detection. However, existing benchmarks primarily focus on isolated, single-vulnerability samples or function-level classification, failing to reflect the complexity of real-world software where multiple interacting vulnerabilities often coexist within large files. Recent studies indicate that LLMs suffer from "count bias" and "selection bias" in multi-label tasks, yet this has not been rigorously quantified in the domain of code security. In this work, we introduce a comprehensive benchmark for Multi-Vulnerability Detection across four major languages: C, C++, Python, and JavaScript. We construct a dataset of 40,000 files by systematically injecting controlled counts of vulnerabilities (1, 3, 5, and 9) into long-context code samples (7.5k-10k tokens) sourced from CodeParrot. We evaluate five state-of-the-art LLMs, including GPT-4o-mini, Llama-3.3-70B, and the Qwen-2.5 series. Our results reveal a sharp degradation in performance as vulnerability density increases. While Llama-3.3-70B achieves near-perfect F1 scores (approximately 0.97) on single-vulnerability C tasks, performance drops by up to 40% in high-density settings. Notably, Python and JavaScript show distinct failure modes compared to C/C++, with models exhibiting severe "under-counting" (Recall dropping to less than 0.30) in complex Python files.

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

↑