mlsanityData to 14 Oct 2026

Uncovering the Limits of Machine Learning for Automatic Vulnerability Detection

arXiv 2306.17193 ↗First posted 28 Jun 2023cs.CR cs.LGcited by 30

Not on the map. Why?

Abstract (arXiv)

Recent results of machine learning for automatic vulnerability detection (ML4VD) have been very promising. Given only the source code of a function f, ML4VD techniques can decide if f contains a security flaw with up to 70% accuracy. However, as evident in our own experiments, the same top-performing models are unable to distinguish between functions that contain a vulnerability and functions where the vulnerability is patched. So, how can we explain this contradiction and how can we improve the way we evaluate ML4VD techniques to get a better picture of their actual capabilities? In this paper, we identify overfitting to unrelated features and out-of-distribution generalization as two problems, which are not captured by the traditional approach of evaluating ML4VD techniques. As a remedy, we propose a novel benchmarking methodology to help researchers better evaluate the true capabilities and limits of ML4VD techniques. Specifically, we propose (i) to augment the training and validation dataset according to our cross-validation algorithm, where a semantic preserving transformation is applied during the augmentation of either the training set or the testing set, and (ii) to augment the testing set with code snippets where the vulnerabilities are patched. Using six ML4VD techniques and two datasets, we find (a) that state-of-the-art models severely overfit to unrelated features for predicting the vulnerabilities in the testing data, (b) that the performance gained by data augmentation does not generalize beyond the specific augmentations applied during training, and (c) that state-of-the-art ML4VD techniques are unable to distinguish vulnerable functions from their patches.

Key facts. Cited by 30 papers in the map (data through 14 Oct 2026). Builds on 25 of its 46 references that are in the map. First posted on arXiv 28 Jun 2023.

Builds on

25 of 46 references.

References · 25

  1. 2015Neural Machine Translation of Rare Words with Subword Unitscited by 2,918
  2. 2020The Many Faces of Robustness: A Critical Analysis of Out-of-Distribution Generalizationcited by 1,850
  3. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
  4. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 744
  5. 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
  6. 2021Towards Out-Of-Distribution Generalization: A Surveycited by 436
  7. 2021Unified Pre-training for Program Understanding and Generationcited by 366
  8. 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 361
  9. 2019Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networkscited by 272
  10. 2020Deep Learning based Vulnerability Detection: Are We There Yet?cited by 144
  11. 2020Dos and Don'ts of Machine Learning in Computer Securitycited by 102
  12. 2023DiverseVul: A New Vulnerable Source Code Dataset for Deep Learning Based Vulnerability Detectioncited by 102
13 more
  1. 2022Natural Attack for Pre-trained Models of Codecited by 75
  2. 2019Adversarial Examples for Models of Codecited by 63
  3. 2021CoTexT: Multi-task Learning with Code-Text Transformercited by 61
  4. 2022VulBERTa: Simplified Source Code Pre-Training for Vulnerability Detectioncited by 51
  5. 2022An Empirical Study of Deep Learning Models for Vulnerability Detectioncited by 46
  6. 2020Semantic Robustness of Models of Source Codecited by 45
  7. 2020On the Generalizability of Neural Program Models with respect to Semantic-Preserving Program Transformationscited by 44
  8. 2020Adversarial Robustness for Codecited by 38
  9. 2019How Often Do Single-Statement Bugs Occur? The ManySStuBs4J Datasetcited by 36
  10. 2019A Manually-Curated Dataset of Fixes to Vulnerabilities of Open-Source Softwarecited by 28
  11. 2021Generating Adversarial Computer Programs using Optimized Obfuscationscited by 22
  12. 2022On Distribution Shift in Learning-based Bug Detectorscited by 15
  13. 2021Towards Making Deep Learning-based Vulnerability Detectors Robustcited by 4

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2023: 1; 2024: 6; 2025: 17; 2026: 6.

30 papers.

Sort:

By area:

  1. 2024Vulnerability Detection with Code Language Models: How Far Are We?cited by 139
  2. 2024Vul-RAG: Enhancing LLM-based Vulnerability Detection via Knowledge-level RAGcited by 68
  3. 2023Unifying the Perspectives of NLP and Software Engineering: A Survey on Language Models for Codecited by 62
  4. 2025LessLeak-Bench: A First Investigation of Data Leakage in LLMs Across 83 Software Engineering Benchmarkscited by 37
  5. 2025Benchmarking LLMs and LLM-based Agents in Practical Vulnerability Detection for Code Repositoriescited by 31
  6. 2024Top Score on the Wrong Exam: On Benchmarking in Machine Learning for Vulnerability Detectioncited by 28
  7. 2025Let the Trial Begin: A Mock-Court Approach to Vulnerability Detection using LLM-Based Agentscited by 20
  8. 2025From CVE Entries to Verifiable Exploits: An Automated Multi-Agent Framework for Reproducing CVEscited by 18
  9. 2025VulnLLM-R: Specialized Reasoning LLM with Agent Scaffold for Vulnerability Detectioncited by 11
  10. 2025Locus: Agentic Predicate Synthesis for Directed Fuzzingcited by 9
  11. 2025SV-TrustEval-C: Evaluating Structure and Semantic Reasoning in Large Language Models for Source Code Vulnerability Analysiscited by 8
  12. 2024An Empirical Study on Capability of Large Language Models in Understanding Code Semanticscited by 7
18 more
  1. 2024VulScribeR: Exploring RAG-based Vulnerability Augmentation with LLMscited by 7
  2. 2025Vulnerability Detection: From Formal Verification to Large Language Models and Hybrid Approaches: A Comprehensive Overviewcited by 7
  3. 2025Trace Gadgets: Minimizing Code Context for Machine Learning-Based Vulnerability Predictioncited by 5
  4. 2025A Systematic Study of Code Obfuscation Against LLM-based Vulnerability Detectioncited by 5
  5. 2025Revisiting Pre-trained Language Models for Vulnerability Detectioncited by 3
  6. 2025Data and Context Matter: Towards Generalizing AI-based Software Vulnerability Detectioncited by 3
  7. 2025VULPO: Context-Aware Vulnerability Detection via On-Policy LLM Optimizationcited by 3
  8. 2026Measuring and Exploiting Contextual Bias in LLM-Assisted Security Code Reviewcited by 3
  9. 2025Semantic-Preserving Transformations as Mutation Operators: A Study on Their Effectiveness in Defect Detectioncited by 2
  10. 2025A Multi-Dataset Evaluation of Models for Automated Vulnerability Repaircited by 1
  11. 2026LLM-Based Agents for Identifying Bug-Introducing Commitscited by 1
  12. 2024Direction for Detection: A Survey of Automated Vulnerability Detection and all of its Pain Pointscited by 0
  13. 2025Today's Cat Is Tomorrow's Dog: Accounting for Time-Based Changes in the Labels of ML Vulnerability Detection Approachescited by 0
  14. 2025SoK: Understanding (New) Security Issues Across AI4Code Use Casescited by 0
  15. 2026Beyond Function-Level Analysis: Context-Aware Reasoning for Inter-Procedural Vulnerability Detectioncited by 0
  16. 2026Improving Generalization on Cybersecurity Tasks with Multi-Modal Contrastive Learningcited by 0
  17. 2026CLEAR: Causal Context-Based Agentic Reasoning for Vulnerability Detectioncited by 0
  18. 2026A Function-Level Vulnerability Score Measures Flag Rate More Than the Model: Protocol Effects on Paired Benchmarkscited by 0