arXiv:2512.08493cs.CRcs.AI2025-12中稿 · ESAAN 2026, versio…被引 1

用大模型生成或重构漏洞代码,提升分类器性能

LLM-based Vulnerable Code Augmentation: Generate or Refactor?

  • 对比生成新漏洞代码与重构现有代码两种方式
  • 混合策略使分类器准确率显著提升
  • 适合做漏洞检测数据增强的研究者使用

漏洞代码库常存在严重不平衡问题,限制了基于深度学习的漏洞分类器效果。数据增强可通过缓解低频漏洞类型的稀缺性来改善这一问题。本文研究基于大模型的漏洞函数增强方法,比较了可控生成新漏洞样本与保持语义的现有样本重构两种策略。利用Qwen2.5-Coder生成增强数据,以CodeBERT作为分类器,在SVEN数据集上验证表明,该方法能通过简单流程有效丰富漏洞代码库,且质量合理;混合策略可最佳提升分类器性能。代码仓库已公开。

原文摘要 · Abstract (English)

Vulnerability code-bases often suffer from severe imbalance, limiting the effectiveness of Deep Learning-based vulnerability classifiers. Data Augmentation could help solve this by mitigating the scarcity of under-represented vulnerability types. In this context, we investigate LLM-based augmentation for vulnerable functions, comparing controlled generation of new vulnerable samples with semantics-preserving refactoring of existing ones. Using Qwen2.5-Coder to produce augmented data and CodeBERT as a classifier on the SVEN dataset, we find that our approaches are indeed effective in enriching vulnerable code-bases through a simple process and with reasonable quality, and that a hybrid strategy best boosts vulnerability classifiers' performance. Code repository is available here : https://github.com/DynaSoumhaneOuchebara/LLM-based-code-augmentation-Generate-or-Refactor-

漏洞检测数据增强大模型代码生成

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。