mlsanityData to 14 Oct 2026

An Insight into Security Code Review with LLMs: Capabilities, Obstacles, and Influential Factors

arXiv 2401.16310 ↗First posted 29 Jan 2024cs.SE cs.AIcited by 6

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

  1. 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,297
  2. 2024A Comprehensive Survey of Hallucination Mitigation Techniques in Large Language Modelscited by 269
  3. 2023From Sparse to Soft Mixtures of Expertscited by 248
  4. 2023An Empirical Evaluation of Using Large Language Models for Automated Unit Test Generationcited by 194
  5. 2023A Categorical Archive of ChatGPT Failurescited by 168
  6. 2020Deep Learning based Vulnerability Detection: Are We There Yet?cited by 144
  7. 2023An Empirical Study of the Non-determinism of ChatGPT in Code Generationcited by 137
  8. 2022Large Language Models are Few-shot Testers: Exploring LLM-based General Bug Reproductioncited by 111
  9. 2023ChatGPT or Human? Detect and Explain. Explaining Decisions of Machine Learning Model for Detecting Short ChatGPT-generated Textcited by 85
  10. 2023Impact of Code Language Models on Automated Program Repaircited by 85
  11. 2023Understanding the Effectiveness of Large Language Models in Detecting Security Vulnerabilitiescited by 59
  12. 2023Prompt-Enhanced Software Vulnerability Detection Using ChatGPTcited by 51
13 more
  1. 2023Exploring the Potential of ChatGPT in Automated Code Refinement: An Empirical Studycited by 44
  2. 2023Is Stack Overflow Obsolete? An Empirical Study of the Characteristics of ChatGPT Answers to Stack Overflow Questionscited by 42
  3. 2023When ChatGPT Meets Smart Contract Vulnerability Detection: How Far Are We?cited by 42
  4. 2023Distinguishing Look-Alike Innocent and Vulnerable Code by Subtle Semantic Representation Learning and Explanationcited by 11
  5. 2023Language Models as a Service: Overview of a New Paradigm and its Challengescited by 10
  6. 2020Recommending Stack Overflow Posts for Fixing Runtime Exceptions using Failure Scenario Matchingcited by 9
  7. 2023VGX: Large-Scale Sample Generation for Boosting Learning-Based Software Vulnerability Analysescited by 9
  8. 2023Using ChatGPT as a Static Application Security Testing Toolcited by 8
  9. 2018A new correlation coefficient between categorical, ordinal and interval variables with Pearson characteristicscited by 7
  10. 2021Why Security Defects Go Unnoticed during Code Reviews? A Case-Control Study of the Chromium OS Projectcited by 5
  11. 2023Security Defect Detection via Code Review: A Study of the OpenStack and Qt Communitiescited by 4
  12. 2021Code Reviews with Divergent Review Scores: An Empirical Study of the OpenStack and Qt Communitiescited by 2
  13. 2022Code Smells Detection via Modern Code Review: A Study of the OpenStack and Qt Communitiescited by 1

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2024: 3; 2025: 1; 2026: 2.

6 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2024Software Vulnerability and Functionality Assessment using LLMs
  2. 2024Can LLM Prompting Serve as a Proxy for Static Analysis in Vulnerability Detection
  3. 2024From Vulnerabilities to Remediation: A Systematic Literature Review of LLMs in Code Security
  4. 2023A Survey on Large Language Model (LLM) Security and Privacy: The Good, the Bad, and the Ugly
  5. 2025SecureReviewer: Enhancing Large Language Models for Secure Code Review through Secure-aware Fine-tuning
  6. 2025Towards Effective Complementary Security Analysis using Large Language Models
  7. 2025Holistic Evaluation of State-of-the-Art LLMs for Code Generation
  8. 2025Evaluating the efficacy of LLM Safety Solutions : The Palit Benchmark Dataset