Understanding the Effectiveness of Large Language Models in Detecting Security Vulnerabilities
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
Citing papers per year: 2023: 1; 2024: 20; 2025: 27; 2026: 11.
59 papers.
Sort:
By area:
- 2024Vulnerability Detection with Code Language Models: How Far Are We?cited by 139
- 2024When LLMs Meet Cybersecurity: A Systematic Literature Reviewcited by 71
- 2024Large Language Models for Cyber Security: A Systematic Literature Reviewcited by 68
- 2024Vul-RAG: Enhancing LLM-based Vulnerability Detection via Knowledge-level RAGcited by 68
- 2024LLM4Vuln: A Unified Evaluation Framework for Decoupling and Enhancing LLMs' Vulnerability Reasoningcited by 59
- 2025LLMs in Software Security: A Survey of Vulnerability Detection Techniques and Insightscited by 47
- 2024An LLM-Assisted Easy-to-Trigger Backdoor Attack on Code Completion Models: Injecting Disguised Vulnerabilities against Strong Detectioncited by 40
- 2024How secure is AI-generated Code: A Large-Scale Comparison of Large Language Modelscited by 24
- 2025Security and Quality in LLM-Generated Code: A Multi-Language, Multi-Model Analysiscited by 19
- 2024To Err is Machine: Vulnerability Detection Challenges LLM Reasoningcited by 18
- 2024Harnessing Large Language Models for Software Vulnerability Detection: A Comprehensive Benchmarking Studycited by 17
- 2025A Framework for Evaluating Emerging Cyberattack Capabilities of AIcited by 16
38 more
- 2024RTL-Breaker: Assessing the Security of LLMs against Backdoor Attacks on HDL Code Generationcited by 15
- 2025Measuring and Augmenting Large Language Models for Solving Capture-the-Flag Challengescited by 15
- 2025A.S.E: A Repository-Level Benchmark for Evaluating Security in AI-Generated Codecited by 14
- 2024VulDetectBench: Evaluating the Deep Capability of Vulnerability Detection with Large Language Modelscited by 11
- 2024From Vulnerabilities to Remediation: A Systematic Literature Review of LLMs in Code Securitycited by 10
- 2025Rethinking the Evaluation of Secure Code Generationcited by 10
- 2024VulnLLMEval: A Framework for Evaluating Large Language Models in Software Vulnerability Detection and Patchingcited by 9
- 2024Python is Not Always the Best Choice: Embracing Multilingual Program of Thoughtscited by 8
- 2025SV-TrustEval-C: Evaluating Structure and Semantic Reasoning in Large Language Models for Source Code Vulnerability Analysiscited by 8
- 2025Reasoning with LLMs for Zero-Shot Vulnerability Detectioncited by 7
- 2024An Insight into Security Code Review with LLMs: Capabilities, Obstacles, and Influential Factorscited by 6
- 2024ProveRAG: Provenance-Driven Vulnerability Analysis with Automated Retrieval-Augmented LLMscited by 6
- 2023Asymmetric Bias in Text-to-Image Generation with Adversarial Attackscited by 5
- 2025Trace Gadgets: Minimizing Code Context for Machine Learning-Based Vulnerability Predictioncited by 5
- 2025A Systematic Study of Code Obfuscation Against LLM-based Vulnerability Detectioncited by 5
- 2026Reducing False Positives in Static Bug Detection with LLMs: An Empirical Study in Industrycited by 5
- 2026Sifting the Noise: A Comparative Study of LLM Agents in Vulnerability False Positive Filteringcited by 5
- 2024Can LLM Prompting Serve as a Proxy for Static Analysis in Vulnerability Detectioncited by 4
- 2025The Hitchhiker's Guide to Program Analysis, Part II: Deep Thoughts by LLMscited by 4
- 2025AutoPatch: Multi-Agent Framework for Patching Real-World CVE Vulnerabilitiescited by 4
- 2025A Mixture of Linear Corrections Generates Secure Codecited by 4
- 2026From SFT to RL: Demystifying the Post-Training Pipeline for LLM-based Vulnerability Detectioncited by 4
- 2025Evaluating LLaMA 3.2 for Software Vulnerability Detectioncited by 3
- 2025Revisiting Pre-trained Language Models for Vulnerability Detectioncited by 3
- 2024Generative transformations and patterns in LLM-native approaches for software verification and falsificationcited by 2
- 2025Evaluating Large Language Models in Vulnerability Detection Under Variable Context Windowscited by 2
- 2025Adaptive Plan-Execute Framework for Smart Contract Security Auditingcited by 2
- 2025LLM Embedding-based Attribution (LEA): Quantifying Source Contributions to Generative Model's Response for Vulnerability Analysiscited by 2
- 2024Comparing Unidirectional, Bidirectional, and Word2vec Models for Discovering Vulnerabilities in Compiled Lifted Codecited by 1
- 2025A Blueprint for AI-Driven Software Quality: Integrating LLMs with Established Standardscited by 1
- 2026Syntax- and Compilation-Preserving Evasion of LLM Vulnerability Detectorscited by 1
- 2026Argus: Reorchestrating Static Analysis via a Multi-Agent Ensemble for Full-Chain Security Vulnerability Detectioncited by 1
- 2026Calibration Without Comprehension: Diagnosing the Limits of Fine-Tuning LLMs for Vulnerability Detection in Systems Softwarecited by 1
- 2024Direction for Detection: A Survey of Automated Vulnerability Detection and all of its Pain Pointscited by 0
- 2025MetaLint: Easy-to-Hard Generalization for Code Lintingcited by 0
- 2025Large Language Models in Cybersecurity: Applications, Vulnerabilities, and Defense Techniquescited by 0
- 2025Fine-Tuning Code Language Models to Detect Cross-Language Bugscited by 0
- 2025Distilling Lightweight Language Models for C/C++ Vulnerabilitiescited by 0
50 most cited of 59 All 59 (JSON)
- 2026On Predicting Vulnerability Severity Using In-Context Learning: An Industrial Case Study22 Aug 2026
- 2026Calibration Without Comprehension: Diagnosing the Limits of Fine-Tuning LLMs for Vulnerability Detection in Systems Software18 Jun 2026
- 2026OpenAnt: LLM-Powered Vulnerability Discovery Through Code Decomposition, Adversarial Verification, and Dynamic Testing17 Jun 2026
- 2026QASecClaw: A Multi-Agent LLM Approach for False Positive Reduction in Static Application Security Testing3 May 2026
- 2026Learning Generalizable Multimodal Representations for Software Vulnerability Detection28 Apr 2026
- 2026Argus: Reorchestrating Static Analysis via a Multi-Agent Ensemble for Full-Chain Security Vulnerability Detection8 Apr 2026
- 2026Benchmarking Zero-Shot Reasoning Approaches for Error Detection in Solidity Smart Contracts17 Feb 2026
- 2026From SFT to RL: Demystifying the Post-Training Pipeline for LLM-based Vulnerability Detection15 Feb 2026
- 2026Syntax- and Compilation-Preserving Evasion of LLM Vulnerability Detectors30 Jan 2026
- 2026Sifting the Noise: A Comparative Study of LLM Agents in Vulnerability False Positive Filtering30 Jan 2026
- 2026Reducing False Positives in Static Bug Detection with LLMs: An Empirical Study in Industry26 Jan 2026
- 2025Assessing the Software Security Comprehension of Large Language Models24 Dec 2025
38 more
- 2025SoK: Understanding (New) Security Issues Across AI4Code Use Cases20 Dec 2025
- 2025A Systematic Study of Code Obfuscation Against LLM-based Vulnerability Detection18 Dec 2025
- 2025Diverse LLMs vs. Vulnerabilities: Who Detects and Fixes Them Better?14 Dec 2025
- 2025On the Difficulty of Selecting Few-Shot Examples for Effective LLM-based Vulnerability Detection31 Oct 2025
- 2025Distilling Lightweight Language Models for C/C++ Vulnerabilities8 Oct 2025
- 2025A.S.E: A Repository-Level Benchmark for Evaluating Security in AI-Generated Code25 Aug 2025
- 2025Fine-Tuning Code Language Models to Detect Cross-Language Bugs29 Jul 2025
- 2025Revisiting Pre-trained Language Models for Vulnerability Detection22 Jul 2025
- 2025Large Language Models in Cybersecurity: Applications, Vulnerabilities, and Defense Techniques18 Jul 2025
- 2025MetaLint: Easy-to-Hard Generalization for Code Linting15 Jul 2025
- 2025A Mixture of Linear Corrections Generates Secure Code13 Jul 2025
- 2025Measuring and Augmenting Large Language Models for Solving Capture-the-Flag Challenges21 Jun 2025
- 2025LLM Embedding-based Attribution (LEA): Quantifying Source Contributions to Generative Model's Response for Vulnerability Analysis12 Jun 2025
- 2025SV-TrustEval-C: Evaluating Structure and Semantic Reasoning in Large Language Models for Source Code Vulnerability Analysis27 May 2025
- 2025Adaptive Plan-Execute Framework for Smart Contract Security Auditing21 May 2025
- 2025A Blueprint for AI-Driven Software Quality: Integrating LLMs with Established Standards19 May 2025
- 2025AutoPatch: Multi-Agent Framework for Patching Real-World CVE Vulnerabilities7 May 2025
- 2025Trace Gadgets: Minimizing Code Context for Machine Learning-Based Vulnerability Prediction18 Apr 2025
- 2025The Hitchhiker's Guide to Program Analysis, Part II: Deep Thoughts by LLMs16 Apr 2025
- 2025Reasoning with LLMs for Zero-Shot Vulnerability Detection22 Mar 2025
- 2025Rethinking the Evaluation of Secure Code Generation18 Mar 2025
- 2025A Framework for Evaluating Emerging Cyberattack Capabilities of AI14 Mar 2025
- 2025Evaluating LLaMA 3.2 for Software Vulnerability Detection10 Mar 2025
- 2025LLMs in Software Security: A Survey of Vulnerability Detection Techniques and Insights10 Feb 2025
- 2025Security and Quality in LLM-Generated Code: A Multi-Language, Multi-Model Analysis3 Feb 2025
- 2025Evaluating Large Language Models in Vulnerability Detection Under Variable Context Windows30 Jan 2025
- 2024From Vulnerabilities to Remediation: A Systematic Literature Review of LLMs in Code Security19 Dec 2024
- 2024Can LLM Prompting Serve as a Proxy for Static Analysis in Vulnerability Detection16 Dec 2024
- 2024Direction for Detection: A Survey of Automated Vulnerability Detection and all of its Pain Points15 Dec 2024
- 2024RTL-Breaker: Assessing the Security of LLMs against Backdoor Attacks on HDL Code Generation26 Nov 2024
- 2024ProveRAG: Provenance-Driven Vulnerability Analysis with Automated Retrieval-Augmented LLMs22 Oct 2024
- 2024Comparing Unidirectional, Bidirectional, and Word2vec Models for Discovering Vulnerabilities in Compiled Lifted Code26 Sep 2024
- 2024VulnLLMEval: A Framework for Evaluating Large Language Models in Software Vulnerability Detection and Patching16 Sep 2024
- 2024Vul-RAG: Enhancing LLM-based Vulnerability Detection via Knowledge-level RAG17 Jun 2024
- 2024VulDetectBench: Evaluating the Deep Capability of Vulnerability Detection with Large Language Models11 Jun 2024
- 2024An LLM-Assisted Easy-to-Trigger Backdoor Attack on Code Completion Models: Injecting Disguised Vulnerabilities against Strong Detection10 Jun 2024
- 2024Harnessing Large Language Models for Software Vulnerability Detection: A Comprehensive Benchmarking Study24 May 2024
- 2024Large Language Models for Cyber Security: A Systematic Literature Review8 May 2024
50 newest of 59 All 59 (JSON)
- 2024LLM4Vuln: A Unified Evaluation Framework for Decoupling and Enhancing LLMs' Vulnerability Reasoningcited by 59
- 2024To Err is Machine: Vulnerability Detection Challenges LLM Reasoningcited by 18
- 2024Python is Not Always the Best Choice: Embracing Multilingual Program of Thoughtscited by 8
- 2025SV-TrustEval-C: Evaluating Structure and Semantic Reasoning in Large Language Models for Source Code Vulnerability Analysiscited by 8
- 2025Reasoning with LLMs for Zero-Shot Vulnerability Detectioncited by 7
- 2024An Insight into Security Code Review with LLMs: Capabilities, Obstacles, and Influential Factorscited by 6
- 2026Argus: Reorchestrating Static Analysis via a Multi-Agent Ensemble for Full-Chain Security Vulnerability Detectioncited by 1
- 2026Argus: Reorchestrating Static Analysis via a Multi-Agent Ensemble for Full-Chain Security Vulnerability Detection8 Apr 2026
- 2025SV-TrustEval-C: Evaluating Structure and Semantic Reasoning in Large Language Models for Source Code Vulnerability Analysis27 May 2025
- 2025Reasoning with LLMs for Zero-Shot Vulnerability Detection22 Mar 2025
- 2024To Err is Machine: Vulnerability Detection Challenges LLM Reasoning25 Mar 2024
- 2024Python is Not Always the Best Choice: Embracing Multilingual Program of Thoughts16 Feb 2024
- 2024An Insight into Security Code Review with LLMs: Capabilities, Obstacles, and Influential Factors29 Jan 2024
- 2024LLM4Vuln: A Unified Evaluation Framework for Decoupling and Enhancing LLMs' Vulnerability Reasoning29 Jan 2024
- 2026Sifting the Noise: A Comparative Study of LLM Agents in Vulnerability False Positive Filteringcited by 5
- 2025AutoPatch: Multi-Agent Framework for Patching Real-World CVE Vulnerabilitiescited by 4
- 2026QASecClaw: A Multi-Agent LLM Approach for False Positive Reduction in Static Application Security Testingcited by 0
- 2026QASecClaw: A Multi-Agent LLM Approach for False Positive Reduction in Static Application Security Testing3 May 2026
- 2026Sifting the Noise: A Comparative Study of LLM Agents in Vulnerability False Positive Filtering30 Jan 2026
- 2025AutoPatch: Multi-Agent Framework for Patching Real-World CVE Vulnerabilities7 May 2025
- 2024An LLM-Assisted Easy-to-Trigger Backdoor Attack on Code Completion Models: Injecting Disguised Vulnerabilities against Strong Detectioncited by 40
- 2024RTL-Breaker: Assessing the Security of LLMs against Backdoor Attacks on HDL Code Generationcited by 15
- 2023Asymmetric Bias in Text-to-Image Generation with Adversarial Attackscited by 5
- 2024RTL-Breaker: Assessing the Security of LLMs against Backdoor Attacks on HDL Code Generation26 Nov 2024
- 2024An LLM-Assisted Easy-to-Trigger Backdoor Attack on Code Completion Models: Injecting Disguised Vulnerabilities against Strong Detection10 Jun 2024
- 2023Asymmetric Bias in Text-to-Image Generation with Adversarial Attacks22 Dec 2023
- 2024Vulnerability Detection with Code Language Models: How Far Are We?cited by 139
- 2024When LLMs Meet Cybersecurity: A Systematic Literature Reviewcited by 71
- 2024Large Language Models for Cyber Security: A Systematic Literature Reviewcited by 68
- 2024Vul-RAG: Enhancing LLM-based Vulnerability Detection via Knowledge-level RAGcited by 68
- 2025LLMs in Software Security: A Survey of Vulnerability Detection Techniques and Insightscited by 47
- 2024How secure is AI-generated Code: A Large-Scale Comparison of Large Language Modelscited by 24
- 2025Security and Quality in LLM-Generated Code: A Multi-Language, Multi-Model Analysiscited by 19
- 2024Harnessing Large Language Models for Software Vulnerability Detection: A Comprehensive Benchmarking Studycited by 17
- 2025A Framework for Evaluating Emerging Cyberattack Capabilities of AIcited by 16
- 2025Measuring and Augmenting Large Language Models for Solving Capture-the-Flag Challengescited by 15
- 2025A.S.E: A Repository-Level Benchmark for Evaluating Security in AI-Generated Codecited by 14
- 2024VulDetectBench: Evaluating the Deep Capability of Vulnerability Detection with Large Language Modelscited by 11
12 most cited of 44 All 44 (JSON)
- 2026On Predicting Vulnerability Severity Using In-Context Learning: An Industrial Case Study22 Aug 2026
- 2026Calibration Without Comprehension: Diagnosing the Limits of Fine-Tuning LLMs for Vulnerability Detection in Systems Software18 Jun 2026
- 2026OpenAnt: LLM-Powered Vulnerability Discovery Through Code Decomposition, Adversarial Verification, and Dynamic Testing17 Jun 2026
- 2026Learning Generalizable Multimodal Representations for Software Vulnerability Detection28 Apr 2026
- 2026Benchmarking Zero-Shot Reasoning Approaches for Error Detection in Solidity Smart Contracts17 Feb 2026
- 2026Syntax- and Compilation-Preserving Evasion of LLM Vulnerability Detectors30 Jan 2026
- 2026Reducing False Positives in Static Bug Detection with LLMs: An Empirical Study in Industry26 Jan 2026
- 2025Assessing the Software Security Comprehension of Large Language Models24 Dec 2025
- 2025SoK: Understanding (New) Security Issues Across AI4Code Use Cases20 Dec 2025
- 2025A Systematic Study of Code Obfuscation Against LLM-based Vulnerability Detection18 Dec 2025
- 2025Diverse LLMs vs. Vulnerabilities: Who Detects and Fixes Them Better?14 Dec 2025
- 2025On the Difficulty of Selecting Few-Shot Examples for Effective LLM-based Vulnerability Detection31 Oct 2025
12 newest of 44 All 44 (JSON)