mlsanityData to 7 Oct 2026

Data and Context Matter: Towards Generalizing AI-based Software Vulnerability Detection

arXiv 2508.16625 ↗First posted 14 Aug 2025cs.CR cs.AI cs.SEcited by 2

Not on the map. Why?

Abstract (arXiv)

AI-based solutions demonstrate remarkable results in identifying vulnerabilities in software, but research has consistently found that this performance does not generalize to unseen codebases. In this paper, we specifically investigate the impact of model architecture, parameter configuration, and quality of training data on the ability of these systems to generalize. For this purpose, we introduce VulGate, a high quality state of the art dataset that mitigates the shortcomings of prior datasets, by removing mislabeled and duplicate samples, updating new vulnerabilities, incorporating additional metadata, integrating hard samples, and including dedicated test sets. We undertake a series of experiments to demonstrate that improved dataset diversity and quality substantially enhances vulnerability detection. We also introduce and benchmark multiple encoder-only and decoder-only models. We find that encoder-based models outperform other models in terms of accuracy and generalization. Our model achieves 6.8% improvement in recall on the benchmark BigVul dataset and outperforms others on unseen projects, demonstrating enhanced generalizability. Our results highlight the role of data quality and model selection in the development of robust vulnerability detection systems. Our findings suggest a direction for future systems with high cross-project effectiveness.

Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Builds on 44 of its 92 references that are in the map. First posted on arXiv 14 Aug 2025.

Builds on

44 of 92 references.

References · 44

  1. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  2. 2017Billion-scale similarity search with GPUscited by 2,477
  3. 2019HuggingFace's Transformers: State-of-the-art Natural Language Processingcited by 2,201
  4. 2023Code Llama: Open Foundation Models for Codecited by 2,105
  5. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
  6. 2020Contrastive Learning with Hard Negative Samplescited by 619
  7. 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 600
  8. 2020Hard Negative Mixing for Contrastive Learningcited by 399
  9. 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 355
  10. 2019Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networkscited by 266
  11. 2023Large Language Models for Code: Security Hardening and Adversarial Testingcited by 149
  12. 2020Deep Learning based Vulnerability Detection: Are We There Yet?cited by 142
32 more
  1. 2024Vulnerability Detection with Code Language Models: How Far Are We?cited by 133
  2. 2018Automated Vulnerability Detection in Source Code Using Deep Representation Learningcited by 114
  3. 2023DiverseVul: A New Vulnerable Source Code Dataset for Deep Learning Based Vulnerability Detectioncited by 98
  4. 2023LLMs Cannot Reliably Identify and Reason About Security Vulnerabilities (Yet?): A Comprehensive Evaluation, Framework, and Benchmarkscited by 94
  5. 2018SySeVR: A Framework for Using Deep Learning to Detect Software Vulnerabilitiescited by 91
  6. 2021CVEfixes: Automated Collection of Vulnerabilities and Their Fixes from Open-Source Softwarecited by 89
  7. 2024NV-Retriever: Improving text embedding models with effective hard-negative miningcited by 83
  8. 2023GPTScan: Detecting Logic Vulnerabilities in Smart Contracts by Combining GPT with Program Analysiscited by 65
  9. 2021Vulnerability Detection with Fine-grained Interpretationscited by 56
  10. 2023Data Quality for Software Vulnerability Datasetscited by 49
  11. 2021D2A: A Dataset Built for AI-Based Vulnerability Detection Methods Using Differential Analysiscited by 48
  12. 2022An Empirical Study of Deep Learning Models for Vulnerability Detectioncited by 44
  13. 2025LLMs in Software Security: A Survey of Vulnerability Detection Techniques and Insightscited by 44
  14. 2024Finetuning Large Language Models for Vulnerability Detectioncited by 39
  15. 2024ReposVul: A Repository-Level High-Quality Vulnerability Datasetcited by 35
  16. 2018SAFE: Self-Attentive Function Embeddings for Binary Similaritycited by 33
  17. 2023Uncovering the Limits of Machine Learning for Automatic Vulnerability Detectioncited by 30
  18. 2023How Far Have We Gone in Vulnerability Detection Using Large Language Modelscited by 27
  19. 2024MegaVul: A C/C++ Vulnerability Dataset with Comprehensive Code Representationcited by 27
  20. 2021VELVET: a noVel Ensemble Learning approach to automatically locate VulnErable sTatementscited by 20
  21. 2025SecVulEval: Benchmarking LLMs for Real-World C/C++ Vulnerability Detectioncited by 19
  22. 2023On the Theories Behind Hard Negative Sampling for Recommendationcited by 18
  23. 2020Predicting Defective Lines Using a Model-Agnostic Techniquecited by 14
  24. 2021JITLine: A Simpler, Better, Faster, Finer-grained Just-In-Time Defect Predictioncited by 14
  25. 2025Teaching an Old LLM Secure Coding: Localized Preference Optimization on Distilled Preferencescited by 10
  26. 2025A Systematic Literature Review on Detecting Software Vulnerabilities with Large Language Modelscited by 8
  27. 2024Automatic Data Labeling for Software Vulnerability Prediction Models: How Far Are We?cited by 6
  28. 2023Improving Code Search with Hard Negative Sampling Based on Fine-tuningcited by 5
  29. 2024An Empirical Study of False Negatives and Positives of Static Code Analyzers From the Perspective of Historical Issuescited by 4
  30. 2025Open Source, Open Threats? Investigating Security Challenges in Open-Source Softwarecited by 4
  31. 2025R+R: Security Vulnerability Dataset Quality Is Criticalcited by 3
  32. 2025Mono: Is Your "Clean" Vulnerability Dataset Really Solvable? Exposing and Trapping Undecidable Patches and Beyondcited by 2

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 1; 2026: 1.

2 papers.