paperbot · PL 论文追踪

全部论文 待读 收藏

P1 Vulnerability Detection with Code Language Models: How Far are We?

代码语言模型的漏洞检测:我们还差多远?
ICSE 2025 IEEE/ACM 47th International Conference on Software Engineering (ICSE)2025匹配度 5/10 · 该工作面向代码 LMs 的漏洞检测,属于 LLM 与程序分析的交叉,且通过构建更真实的基准揭示已有评测严重高估模型能力,契合画像中“问题驱动、指出已有 benchmark 失效并解释原因”“在重要但缺乏可靠基准的场景下设计 benchmark”的偏好。但它既不做静态分析/形式化验证,也不涉及 Agentic 程序、浮点或贝叶斯程序分析,且核心仍是评测 LLM 本身的能力,而非用 LLM 改进分析技术,因此并非研究主线。引用 80 inbox
Yangruibo Ding, Yanjun Fu, Omniyyah Ibrahim, Chawin Sitawarin, Xinyun Chen, Basel Alomair, David Wagner, Baishakhi Ray, Yizheng Chen
crossref: 2026-09-12

AI 速览

一句话:提出 Primevul 数据集与真实评测,揭示现有基准严重高估代码 LMs 的漏洞检测能力。

本文研究代码语言模型(code LMs)在漏洞检测中的有效性。分析发现,现有漏洞数据集存在数据质量差、标签准确率低和重复率高的问题,且常用评测方法不能代表真实漏洞检测场景。为此,作者提出 Primevul,一个用于训练和评测代码 LMs 漏洞检测的新数据集。它采用新的数据标注技术,在显著扩大数据规模的同时达到接近人工验证基准的标签准确率;还实施严格的去重和按时间划分策略以缓解数据泄漏,并引入更真实的评测指标与设置。在 Primevul 上评测表明,现有基准显著高估模型性能:某先进 7B 模型在 BigVul 上 F1 为 68.26%,在 Primevul 上仅 3.09%;GPT-3.5 和 GPT-4 在最严格设置下也接近随机猜测。

问题
现有代码语言模型漏洞检测研究依赖的数据集质量差、标签准确率低、重复率高,且评测方法不符合真实漏洞检测场景。
方法
构建 Primevul 数据集,采用新的标注技术、严格去重与按时间划分策略,并引入更真实的评测指标和设置。
评估
在 Primevul 上评测多种代码 LMs,发现 BigVul 等基准显著高估性能:某 7B 模型 F1 从 68.26% 降至 3.09%,GPT-3.5/4 在最严格设置下接近随机猜测。
原文摘要(Abstract)

In the context of the rising interest in code language models (code LMs) and vulnerability detection, we study the effectiveness of code LMs for detecting vulnerabilities. Our analysis reveals significant shortcomings in existing vulnerability datasets, including poor data quality, low label accuracy, and high duplication rates, leading to unreliable model performance in realistic vulnerability detection scenarios. Additionally, the evaluation methods used with these datasets are not representative of real-world vulnerability detection. To address these challenges, we introduce Primevul, a new dataset for training and evaluating code LMs for vulnerability detection. Primevul incorporates a novel set of data labeling techniques that achieve comparable label accuracy to human-verified benchmarks while significantly expanding the dataset. It also implements a rigorous data de-duplication and chronological data splitting strategy to mitigate data leakage issues, alongside introducing more realistic evaluation metrics and settings. This comprehensive approach aims to provide a more accurate assessment of code LMs' performance in real-world conditions. Evaluating code LMs on Primevul reveals that existing benchmarks significantly overestimate the performance of these models. For instance, a state-of-the-art 7B model scored 68.26% Fl on BigVul but only 3.09% Fl on Primevul. Attempts to improve performance through advanced training techniques and larger models like GPT-3.5 and GPT-4 were unsuccessful, with results akin to random guessing in the most stringent settings. These findings underscore the considerable gap between current capabilities and the practical requirements for deploying code LMs in security roles, highlighting the need for more innovative research in this domain.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot8850,
  title = {Vulnerability Detection with Code Language Models: How Far are We?},
  author = {Yangruibo Ding and Yanjun Fu and Omniyyah Ibrahim and Chawin Sitawarin and Xinyun Chen and Basel Alomair and David Wagner and Baishakhi Ray and Yizheng Chen},
  booktitle = {ICSE},
  year = {2025},
  doi = {10.1109/icse55347.2025.00038}
}