paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Out of Distribution, Out of Luck: How Well Can LLMs Trained on Vulnerability Datasets Detect Top 25 CWE Weaknesses?

分布外即失手:基于漏洞数据集训练的 LLM 能多好地检测 Top 25 CWE 弱点?
ICSE Proceedings of the 2026 IEEE/ACM 48th International Conference on Software Engineering2026匹配度 4/10 · 论文聚焦基于LLM的漏洞检测数据集、OOD基准与Top 25 CWE检测,属于LLM用于代码/安全分析,但与用户核心的静态分析、形式化验证、浮点程序分析、贝叶斯程序分析及Agentic程序分析交叉较弱。其benchmark构建与OOD泛化分析思路有一定参考价值,但任务本身并非用户主要追踪的问题。引用 11 inbox
Yikun Li, Ngoc Tan Bui, Ting Zhang, Chengran Yang, Xin Zhou, Martin Weyssow, Jinfeng Jiang, Junkai Chen, Huihui Huang, Huu Hung Nguyen, Chiok Yew Ho, Jie Tan, Ruiyin Li, Yide Yin, Han Wei Ang, Frank Liauw, Eng Lieh Ouh, Lwin Khin Shar, David Lo
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:提出 BenchVul、TitanVul 与 RVG,揭示漏洞检测模型的分布外泛化差距并提升 Top 25 CWE 检测。

现有漏洞检测模型依赖含标签错误、重复和关键 CWE 覆盖不足的数据集,导致同分布测试虚高、真实泛化差。作者构建 BenchVul 手工平衡测试集,覆盖 MITRE Top 25 CWE;聚合七个公开来源并经去重与多智能体 LLM 验证,构建含 38,548 个函数的 TitanVul 训练集;提出 RVG 通过模拟开发流程为欠代表但关键的 CWE 合成上下文相关样本。评估表明 ID 性能不能可靠预测 BenchVul 上的 OOD 性能:BigVul 训练模型 ID 准确率 0.703 但 OOD 仅 0.493;TitanVul 训练模型 ID 仅 0.590,却在真实与合成部分分别达 0.881 和 0.785,较次优提升 5.3% 和 11.8%;加入 RVG 后真实数据准确率再升至 0.932(+5.8%)。

问题
现有漏洞数据集存在标签错误、重复和关键 CWE 覆盖不足,使模型在同分布测试上虚高,难以泛化到真实漏洞检测场景。
方法
构建覆盖 MITRE Top 25 CWE 的手工平衡测试集 BenchVul、经多智能体 LLM 去重验证的 38,548 函数训练集 TitanVul,并提出 RVG 合成欠代表关键 CWE 的上下文相关样本。
评估
在 BenchVul 上比较不同训练数据所训 LLM 的 ID 与 OOD 漏洞检测表现,并消融 RVG 增强的影响。
原文摘要(Abstract)

Automated vulnerability detection research has made substantial progress, yet its real-world impact remains limited. Prior work found that current vulnerability datasets suffer from issues including label inaccuracy rates of 20%-71%, extensive duplication, and poor coverage of critical Common Weakness Enumeration (CWE). These issues create a significant “generalization gap” where models achieve misleading In-Distribution (ID) accuracies (testing on splits from the same dataset) by exploiting spurious correlations rather than learning true vulnerability patterns. To address these limitations, we present a three-part solution. First, we introduce BenchVul, which is a manually curated and balanced test dataset covering the MITRE Top 25 Most Dangerous CWEs, to enable fair model evaluation. Second, we construct a high-quality training dataset, TitanVul, comprising 38,548 functions by aggregating seven public sources and applying deduplication and validation using a novel multi-agent LLM pipeline. Third, we propose a Realistic Vulnerability Generation (RVG) pipeline, which synthesizes context-aware vulnerability examples for underrepresented but critical CWE types through simulated development workflows. Our evaluation reveals that In-Distribution (ID) performance does not reliably predict Out-of-Distribution (OOD) performance on BenchVul. For example, a model trained on BigVul achieves the highest 0.703 ID accuracy but fails on BenchVul’s real-world samples (0.493 OOD accuracy). Conversely, a model trained on our TitanVul achieves the highest OOD performance on both the real-world (0.881) and synthesized (0.785) portions of BenchVul, improving upon the next-best performing dataset by 5.3% and 11.8% respectively, despite a modest ID score (0.590). Augmenting TitanVul with our RVG further boosts this leading OOD performance, improving accuracy on real-world data by 5.8% (to 0.932). Data is available at: https://github.com/yikun-li/TitanVul-BenchVul.

链接与引用

DOI 原文 · arXiv · DBLP

BibTeX
@inproceedings{abs-2507-21817,
  title = {Out of Distribution, Out of Luck: How Well Can LLMs Trained on Vulnerability Datasets Detect Top 25 CWE Weaknesses?},
  author = {Yikun Li and Ngoc Tan Bui and Ting Zhang and Chengran Yang and Xin Zhou and Martin Weyssow and Jinfeng Jiang and Junkai Chen and Huihui Huang and Huu Hung Nguyen and Chiok Yew Ho and Jie Tan and Ruiyin Li and Yide Yin and Han Wei Ang and Frank Liauw and Eng Lieh Ouh and Lwin Khin Shar and David Lo},
  booktitle = {ICSE},
  year = {2026},
  doi = {10.1145/3744916.3787830}
}