mlsanityData to 14 Oct 2026

Understanding the Effectiveness of Large Language Models in Detecting Security Vulnerabilities

arXiv 2311.16169 ↗First posted 16 Nov 2023cs.CR cs.PL cs.SEcited by 59

Not on the map. Why?

Abstract (arXiv)

While automated vulnerability detection techniques have made promising progress in detecting security vulnerabilities, their scalability and applicability remain challenging. The remarkable performance of Large Language Models (LLMs), such as GPT-4 and CodeLlama, on code-related tasks has prompted recent works to explore if LLMs can be used to detect vulnerabilities. In this paper, we perform a more comprehensive study by concurrently examining a higher number of datasets, languages and LLMs, and qualitatively evaluating performance across prompts and vulnerability classes while addressing the shortcomings of existing tools. Concretely, we evaluate the effectiveness of 16 pre-trained LLMs on 5,000 code samples from five diverse security datasets. These balanced datasets encompass both synthetic and real-world projects in Java and C/C++ and cover 25 distinct vulnerability classes. Overall, LLMs across all scales and families show modest effectiveness in detecting vulnerabilities, obtaining an average accuracy of 62.8% and F1 score of 0.71 across datasets. They are significantly better at detecting vulnerabilities only requiring intra-procedural analysis, such as OS Command Injection and NULL Pointer Dereference. Moreover, they report higher accuracies on these vulnerabilities than popular static analysis tools, such as CodeQL. We find that advanced prompting strategies that involve step-by-step analysis significantly improve performance of LLMs on real-world datasets in terms of F1 score (by upto 0.18 on average). Interestingly, we observe that LLMs show promising abilities at performing parts of the analysis correctly, such as identifying vulnerability-related specifications and leveraging natural language information to understand code behavior (e.g., to check if code is sanitized). We expect our insights to guide future work on LLM-augmented vulnerability detection systems.

Key facts. Cited by 59 papers in the map (data through 14 Oct 2026). First posted on arXiv 16 Nov 2023.

Builds on

No reference list yet.

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2023: 1; 2024: 20; 2025: 27; 2026: 11.

59 papers.

Sort:

By area:

  1. 2024Vulnerability Detection with Code Language Models: How Far Are We?cited by 139
  2. 2024When LLMs Meet Cybersecurity: A Systematic Literature Reviewcited by 71
  3. 2024Large Language Models for Cyber Security: A Systematic Literature Reviewcited by 68
  4. 2024Vul-RAG: Enhancing LLM-based Vulnerability Detection via Knowledge-level RAGcited by 68
  5. 2024LLM4Vuln: A Unified Evaluation Framework for Decoupling and Enhancing LLMs' Vulnerability Reasoningcited by 59
  6. 2025LLMs in Software Security: A Survey of Vulnerability Detection Techniques and Insightscited by 47
  7. 2024An LLM-Assisted Easy-to-Trigger Backdoor Attack on Code Completion Models: Injecting Disguised Vulnerabilities against Strong Detectioncited by 40
  8. 2024How secure is AI-generated Code: A Large-Scale Comparison of Large Language Modelscited by 24
  9. 2025Security and Quality in LLM-Generated Code: A Multi-Language, Multi-Model Analysiscited by 19
  10. 2024To Err is Machine: Vulnerability Detection Challenges LLM Reasoningcited by 18
  11. 2024Harnessing Large Language Models for Software Vulnerability Detection: A Comprehensive Benchmarking Studycited by 17
  12. 2025A Framework for Evaluating Emerging Cyberattack Capabilities of AIcited by 16
38 more
  1. 2024RTL-Breaker: Assessing the Security of LLMs against Backdoor Attacks on HDL Code Generationcited by 15
  2. 2025Measuring and Augmenting Large Language Models for Solving Capture-the-Flag Challengescited by 15
  3. 2025A.S.E: A Repository-Level Benchmark for Evaluating Security in AI-Generated Codecited by 14
  4. 2024VulDetectBench: Evaluating the Deep Capability of Vulnerability Detection with Large Language Modelscited by 11
  5. 2024From Vulnerabilities to Remediation: A Systematic Literature Review of LLMs in Code Securitycited by 10
  6. 2025Rethinking the Evaluation of Secure Code Generationcited by 10
  7. 2024VulnLLMEval: A Framework for Evaluating Large Language Models in Software Vulnerability Detection and Patchingcited by 9
  8. 2024Python is Not Always the Best Choice: Embracing Multilingual Program of Thoughtscited by 8
  9. 2025SV-TrustEval-C: Evaluating Structure and Semantic Reasoning in Large Language Models for Source Code Vulnerability Analysiscited by 8
  10. 2025Reasoning with LLMs for Zero-Shot Vulnerability Detectioncited by 7
  11. 2024An Insight into Security Code Review with LLMs: Capabilities, Obstacles, and Influential Factorscited by 6
  12. 2024ProveRAG: Provenance-Driven Vulnerability Analysis with Automated Retrieval-Augmented LLMscited by 6
  13. 2023Asymmetric Bias in Text-to-Image Generation with Adversarial Attackscited by 5
  14. 2025Trace Gadgets: Minimizing Code Context for Machine Learning-Based Vulnerability Predictioncited by 5
  15. 2025A Systematic Study of Code Obfuscation Against LLM-based Vulnerability Detectioncited by 5
  16. 2026Reducing False Positives in Static Bug Detection with LLMs: An Empirical Study in Industrycited by 5
  17. 2026Sifting the Noise: A Comparative Study of LLM Agents in Vulnerability False Positive Filteringcited by 5
  18. 2024Can LLM Prompting Serve as a Proxy for Static Analysis in Vulnerability Detectioncited by 4
  19. 2025The Hitchhiker's Guide to Program Analysis, Part II: Deep Thoughts by LLMscited by 4
  20. 2025AutoPatch: Multi-Agent Framework for Patching Real-World CVE Vulnerabilitiescited by 4
  21. 2025A Mixture of Linear Corrections Generates Secure Codecited by 4
  22. 2026From SFT to RL: Demystifying the Post-Training Pipeline for LLM-based Vulnerability Detectioncited by 4
  23. 2025Evaluating LLaMA 3.2 for Software Vulnerability Detectioncited by 3
  24. 2025Revisiting Pre-trained Language Models for Vulnerability Detectioncited by 3
  25. 2024Generative transformations and patterns in LLM-native approaches for software verification and falsificationcited by 2
  26. 2025Evaluating Large Language Models in Vulnerability Detection Under Variable Context Windowscited by 2
  27. 2025Adaptive Plan-Execute Framework for Smart Contract Security Auditingcited by 2
  28. 2025LLM Embedding-based Attribution (LEA): Quantifying Source Contributions to Generative Model's Response for Vulnerability Analysiscited by 2
  29. 2024Comparing Unidirectional, Bidirectional, and Word2vec Models for Discovering Vulnerabilities in Compiled Lifted Codecited by 1
  30. 2025A Blueprint for AI-Driven Software Quality: Integrating LLMs with Established Standardscited by 1
  31. 2026Syntax- and Compilation-Preserving Evasion of LLM Vulnerability Detectorscited by 1
  32. 2026Argus: Reorchestrating Static Analysis via a Multi-Agent Ensemble for Full-Chain Security Vulnerability Detectioncited by 1
  33. 2026Calibration Without Comprehension: Diagnosing the Limits of Fine-Tuning LLMs for Vulnerability Detection in Systems Softwarecited by 1
  34. 2024Direction for Detection: A Survey of Automated Vulnerability Detection and all of its Pain Pointscited by 0
  35. 2025MetaLint: Easy-to-Hard Generalization for Code Lintingcited by 0
  36. 2025Large Language Models in Cybersecurity: Applications, Vulnerabilities, and Defense Techniquescited by 0
  37. 2025Fine-Tuning Code Language Models to Detect Cross-Language Bugscited by 0
  38. 2025Distilling Lightweight Language Models for C/C++ Vulnerabilitiescited by 0

50 most cited of 59 All 59 (JSON)