VulScribeR: Exploring RAG-based Vulnerability Augmentation with LLMs
Not on the map. Why?
Abstract (arXiv)
Detecting vulnerabilities is vital for software security, yet deep learning-based vulnerability detectors (DLVD) face a data shortage, which limits their effectiveness. Data augmentation can potentially alleviate the data shortage, but augmenting vulnerable code is challenging and requires a generative solution that maintains vulnerability. Previous works have only focused on generating samples that contain single statements or specific types of vulnerabilities. Recently, large language models (LLMs) have been used to solve various code generation and comprehension tasks with inspiring results, especially when fused with retrieval augmented generation (RAG). Therefore, we propose VulScribeR, a novel LLM-based solution that leverages carefully curated prompt templates to augment vulnerable datasets. More specifically, we explore three strategies to augment both single and multi-statement vulnerabilities, with LLMs, namely Mutation, Injection, and Extension. Our extensive evaluation across four vulnerability datasets and DLVD models, using three LLMs, show that our approach beats two SOTA methods Vulgen and VGX, and Random Oversampling (ROS) by 27.48%, 27.93%, and 15.41% in f1-score with 5K generated vulnerable samples on average, and 53.84%, 54.10%, 69.90%, and 40.93% with 15K generated vulnerable samples. Our approach demonstrates its feasibility for large-scale data augmentation by generating 1K samples at as cheap as US 1.88.
Key facts. Cited by 7 papers in the map (data through 7 Oct 2026). Builds on 33 of its 70 references that are in the map. First posted on arXiv 7 Aug 2024.
Builds on
33 of 70 references.
References · 33
- 2023GPT-4 Technical Reportcited by 18,132
- 2017mixup: Beyond Empirical Risk Minimizationcited by 5,155
- 2019CutMix: Regularization Strategy to Train Strong Classifiers with Localizable Featurescited by 2,875
- 2017Improved Regularization of Convolutional Neural Networks with Cutoutcited by 1,623
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,154
- 2020Evaluation: from precision, recall and F-measure to ROC, informedness, markedness and correlationcited by 420
- 2023A Survey on Large Language Model (LLM) Security and Privacy: The Good, the Bad, and the Uglycited by 380
- 2019Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networkscited by 266
- 2020ClassMix: Segmentation-Based Data Augmentation for Semi-Supervised Learningcited by 209
- 2020Deep Learning based Vulnerability Detection: Are We There Yet?cited by 142
- 2024Vulnerability Detection with Code Language Models: How Far Are We?cited by 133
21 more
- 2019Augmenting Data with Mixup for Sentence Classification: An Empirical Studycited by 125
- 2024LLM Agents can Autonomously Exploit One-day Vulnerabilitiescited by 125
- 2023An Analysis of the Automatic Bug Fixing Performance of ChatGPTcited by 108
- 2024Vul-RAG: Enhancing LLM-based Vulnerability Detection via Knowledge-level RAGcited by 67
- 2023Comparing Code Explanations Created by Students and Large Language Modelscited by 63
- 2021Vulnerability Detection with Fine-grained Interpretationscited by 56
- 2022NatGen: Generative pre-training by "Naturalizing" source codecited by 53
- 2020Self-Supervised Contrastive Learning for Code Retrieval and Summarization via Semantic-Preserving Transformationscited by 49
- 2023Data Quality for Software Vulnerability Datasetscited by 49
- 2018Diversity in Machine Learningcited by 48
- 2023What Makes Good In-context Demonstrations for Code Intelligence Tasks with LLMs?cited by 47
- 2024Securing Large Language Models: Threats, Vulnerabilities and Responsible Practicescited by 36
- 2024LLMParser: An Exploratory Study on Using Large Language Models for Log Parsingcited by 32
- 2023Uncovering the Limits of Machine Learning for Automatic Vulnerability Detectioncited by 30
- 2021Learning Structural Edits via Incremental Tree Transformationscited by 16
- 2024LLM-Powered Code Vulnerability Repair with Reinforcement Learning and Semantic Rewardcited by 16
- 2022The impact of feature importance methods on the interpretation of defect classifierscited by 12
- 2023VGX: Large-Scale Sample Generation for Boosting Learning-Based Software Vulnerability Analysescited by 9
- 2022Exploring Representation-Level Augmentation for Code Searchcited by 8
- 2022Impact of Discretization Noise of the Dependent variable on Machine Learning Classifiers in Software Engineeringcited by 6
- 2024Enhancing Code Vulnerability Detection via Vulnerability-Preserving Data Augmentationcited by 5
Built on by
Citing papers per year: 2024: 1; 2025: 3; 2026: 3.
7 papers.
- 2025A Deep Dive into Retrieval-Augmented Generation for Code Completion: Experience on WeChatcited by 5
- 2024A Comprehensive Framework for Evaluating API-oriented Code Generation in Large Language Modelscited by 2
- 2025Augmenting Large Language Models with Static Code Analysis for Automated Code Quality Improvementscited by 2
- 2026CodePoisonRAG: Knowledge Poisoning Attacks on Retrieval-Augmented Code Generationcited by 1
- 2025AVIATOR: Towards AI-Agentic Vulnerability Injection Workflow for High-Fidelity, Large-Scale Code Security Datasetcited by 0
- 2026An Empirical Evaluation of LLM-Based Approaches for Code Vulnerability Detection: RAG, SFT, and Dual-Agent Systemscited by 0
- 2026Willing but Unable: Separating Refusal from Capability in Code LLMs via Abliterationcited by 0
- 2026CodePoisonRAG: Knowledge Poisoning Attacks on Retrieval-Augmented Code Generation2 Sep 2026
- 2026Willing but Unable: Separating Refusal from Capability in Code LLMs via Abliteration3 Jun 2026
- 2026An Empirical Evaluation of LLM-Based Approaches for Code Vulnerability Detection: RAG, SFT, and Dual-Agent Systems1 Jan 2026
- 2025AVIATOR: Towards AI-Agentic Vulnerability Injection Workflow for High-Fidelity, Large-Scale Code Security Dataset28 Aug 2025
- 2025A Deep Dive into Retrieval-Augmented Generation for Code Completion: Experience on WeChat24 Jul 2025
- 2025Augmenting Large Language Models with Static Code Analysis for Automated Code Quality Improvements12 Jun 2025
- 2024A Comprehensive Framework for Evaluating API-oriented Code Generation in Large Language Models23 Sep 2024
Similar, not cited
Close in wording, no citation either way
- 2026Revisiting Vul-RAG: Reproducibility and Replicability of RAG-based Vulnerability Detection with Open-Weight Models
- 2026VulTriage: Triple-Path Context Augmentation for LLM-Based Vulnerability Detection
- 2025Automated Vulnerability Validation and Verification: A Large Language Model Approach
- 2026Retrieve, Reproduce, Reveal: Dissecting Retrieval-Augmented Software Vulnerability Detection
- 2024Towards Explainable Vulnerability Detection with Large Language Models
- 2025Boosting Vulnerability Detection of LLMs via Curriculum Preference Optimization with Synthetic Reasoning Data
- 2025VulInstruct: Teaching LLMs Root-Cause Reasoning for Vulnerability Detection via Security Specifications
- 2025Reasoning with LLMs for Zero-Shot Vulnerability Detection