An Insight into Security Code Review with LLMs: Capabilities, Obstacles, and Influential Factors
On the map: LLM reasoning → Reasoning for agents, planning and code
Abstract (arXiv)
Security code review is a time-consuming and labor-intensive process typically requiring integration with automated security defect detection tools. However, existing security analysis tools struggle with poor generalization, high false positive rates, and coarse detection granularity. Large Language Models (LLMs) have been considered promising candidates for addressing those challenges. In this study, we conducted an empirical study to explore the potential of LLMs in detecting security defects during code review. Specifically, we evaluated the performance of seven LLMs under five different prompts and compared them with state-of-the-art static analysis tools. We also performed linguistic and regression analyses for the two top-performing LLMs to identify quality problems in their responses and factors influencing their performance. Our findings show that: (1) In security code review, LLMs significantly outperform state-of-the-art static analysis tools, and the reasoning-optimized LLM performs better than general-purpose LLMs. (2) DeepSeek-R1 achieves the highest performance, followed by GPT-4 provided in the ChatGPT platform. The optimal prompt for DeepSeek-R1 incorporates both the commit message and chain-of-thought (CoT) guidance, while for GPT-4 via ChatGPT, the prompt with a Common Weakness Enumeration (CWE) list works best. (3) GPT-4 via ChatGPT frequently produces vague expressions and exhibits difficulties in accurately following instructions in the prompts, while DeepSeek-R1 more commonly generates inaccurate code details in its outputs. (4) LLMs are more adept at identifying security defects in code files that have fewer tokens and security-relevant annotations. (5) Higher code complexity correlates with enhanced detection capabilities of DeepSeek-R1 for specific security defect types.
Key facts. Cited by 6 papers in the map (data through 14 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 25 of its 113 references that are in the map. First posted on arXiv 29 Jan 2024.
Builds on
25 of 113 references.
References · 25
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,297
- 2024A Comprehensive Survey of Hallucination Mitigation Techniques in Large Language Modelscited by 269
- 2023From Sparse to Soft Mixtures of Expertscited by 248
- 2023An Empirical Evaluation of Using Large Language Models for Automated Unit Test Generationcited by 194
- 2023A Categorical Archive of ChatGPT Failurescited by 168
- 2020Deep Learning based Vulnerability Detection: Are We There Yet?cited by 144
- 2023An Empirical Study of the Non-determinism of ChatGPT in Code Generationcited by 137
- 2022Large Language Models are Few-shot Testers: Exploring LLM-based General Bug Reproductioncited by 111
- 2023ChatGPT or Human? Detect and Explain. Explaining Decisions of Machine Learning Model for Detecting Short ChatGPT-generated Textcited by 85
- 2023Impact of Code Language Models on Automated Program Repaircited by 85
- 2023Understanding the Effectiveness of Large Language Models in Detecting Security Vulnerabilitiescited by 59
- 2023Prompt-Enhanced Software Vulnerability Detection Using ChatGPTcited by 51
13 more
- 2023Exploring the Potential of ChatGPT in Automated Code Refinement: An Empirical Studycited by 44
- 2023Is Stack Overflow Obsolete? An Empirical Study of the Characteristics of ChatGPT Answers to Stack Overflow Questionscited by 42
- 2023When ChatGPT Meets Smart Contract Vulnerability Detection: How Far Are We?cited by 42
- 2023Distinguishing Look-Alike Innocent and Vulnerable Code by Subtle Semantic Representation Learning and Explanationcited by 11
- 2023Language Models as a Service: Overview of a New Paradigm and its Challengescited by 10
- 2020Recommending Stack Overflow Posts for Fixing Runtime Exceptions using Failure Scenario Matchingcited by 9
- 2023VGX: Large-Scale Sample Generation for Boosting Learning-Based Software Vulnerability Analysescited by 9
- 2023Using ChatGPT as a Static Application Security Testing Toolcited by 8
- 2018A new correlation coefficient between categorical, ordinal and interval variables with Pearson characteristicscited by 7
- 2021Why Security Defects Go Unnoticed during Code Reviews? A Case-Control Study of the Chromium OS Projectcited by 5
- 2023Security Defect Detection via Code Review: A Study of the OpenStack and Qt Communitiescited by 4
- 2021Code Reviews with Divergent Review Scores: An Empirical Study of the OpenStack and Qt Communitiescited by 2
- 2022Code Smells Detection via Modern Code Review: A Study of the OpenStack and Qt Communitiescited by 1
Built on by
Citing papers per year: 2024: 3; 2025: 1; 2026: 2.
6 papers.
- 2024Harnessing Large Language Models for Software Vulnerability Detection: A Comprehensive Benchmarking Studycited by 17
- 2025Large Language Model (LLM) for Software Security: Code Analysis, Malware Analysis, Reverse Engineeringcited by 15
- 2024Just another copy and paste? Comparing the security vulnerabilities of ChatGPT generated code and StackOverflow answerscited by 13
- 2024GenKubeSec: LLM-Based Kubernetes Misconfiguration Detection, Localization, Reasoning, and Remediationcited by 11
- 2026Measuring and Exploiting Contextual Bias in LLM-Assisted Security Code Reviewcited by 3
- 2026VulReaD: Knowledge-Graph-guided Software Vulnerability Reasoning and Detectioncited by 0
- 2026Measuring and Exploiting Contextual Bias in LLM-Assisted Security Code Review19 Mar 2026
- 2026VulReaD: Knowledge-Graph-guided Software Vulnerability Reasoning and Detection11 Feb 2026
- 2025Large Language Model (LLM) for Software Security: Code Analysis, Malware Analysis, Reverse Engineering7 Apr 2025
- 2024GenKubeSec: LLM-Based Kubernetes Misconfiguration Detection, Localization, Reasoning, and Remediation30 May 2024
- 2024Harnessing Large Language Models for Software Vulnerability Detection: A Comprehensive Benchmarking Study24 May 2024
- 2024Just another copy and paste? Comparing the security vulnerabilities of ChatGPT generated code and StackOverflow answers22 Mar 2024
Similar, not cited
Close in wording, no citation either way
- 2024Software Vulnerability and Functionality Assessment using LLMs
- 2024Can LLM Prompting Serve as a Proxy for Static Analysis in Vulnerability Detection
- 2024From Vulnerabilities to Remediation: A Systematic Literature Review of LLMs in Code Security
- 2023A Survey on Large Language Model (LLM) Security and Privacy: The Good, the Bad, and the Ugly
- 2025SecureReviewer: Enhancing Large Language Models for Secure Code Review through Secure-aware Fine-tuning
- 2025Towards Effective Complementary Security Analysis using Large Language Models
- 2025Holistic Evaluation of State-of-the-Art LLMs for Code Generation
- 2025Evaluating the efficacy of LLM Safety Solutions : The Palit Benchmark Dataset