Can LLMs Find Bugs in Code? An Evaluation from Beginner Errors to Security Vulnerabilities in Python and C++
Not on the map. Why?
Abstract (arXiv)
Large Language Models (LLMs) such as ChatGPT-4, Claude 3, and LLaMA 4 are increasingly embedded in software/application development, supporting tasks from code generation to debugging. Yet, their real-world effectiveness in detecting diverse software bugs, particularly complex, security-relevant vulnerabilities, remains underexplored. This study presents a systematic, empirical evaluation of these three leading LLMs using a benchmark of foundational programming errors, classic security flaws, and advanced, production-grade bugs in C++ and Python. The dataset integrates real code from SEED Labs, OpenSSL (via the Suresoft GLaDOS database), and PyBugHive, validated through local compilation and testing pipelines. A novel multi-stage, context-aware prompting protocol simulates realistic debugging scenarios, while a graded rubric measures detection accuracy, reasoning depth, and remediation quality. Our results show that all models excel at identifying syntactic and semantic issues in well-scoped code, making them promising for educational use and as first-pass reviewers in automated code auditing. Performance diminishes in scenarios involving complex security vulnerabilities and large-scale production code, with ChatGPT-4 and Claude 3 generally providing more nuanced contextual analyses than LLaMA 4. This highlights both the promise and the present constraints of LLMs in serving as reliable code analysis tools.
Key facts. Cited by 3 papers in the map (data through 14 Oct 2026). Builds on 18 of its 24 references that are in the map. First posted on arXiv 22 Aug 2025.
Builds on
18 of 24 references.
References · 18
- 2023GPT-4 Technical Reportcited by 18,396
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
- 2023A Survey on Evaluation of Large Language Modelscited by 1,242
- 2024RepairAgent: An Autonomous, LLM-Based Agent for Program Repaircited by 232
- 2022GitHub Copilot AI pair programmer: Asset or Liability?cited by 152
- 2021BERT: A Review of Applications in Natural Language Processing and Understandingcited by 109
- 2024A Systematic Literature Review on Large Language Models for Automated Program Repaircited by 37
- 2024How Far Can We Go with Practical Function-Level Program Repair?cited by 16
- 2025Do LLMs Consider Security? An Empirical Study on Responses to Programming Questionscited by 9
- 2024LProtector: An LLM-driven Vulnerability Detection Systemcited by 8
- 2025LLM & HPC:Benchmarking DeepSeek's Performance in High-Performance Computing Taskscited by 8
- 2024An Empirical Study on Low-Code Programming using Traditional vs Large Language Model Supportcited by 7
6 more
- 2024Evaluating AI-generated code for C++, Fortran, Go, Java, Julia, Matlab, Python, R, and Rustcited by 5
- 2025Benchmarking Large Language Models for Multi-Language Software Vulnerability Detectioncited by 5
- 2025LLM Benchmarking with LLaMA2: Evaluating Code Development Performance Across Multiple Programming Languagescited by 5
- 2025FuncVul: An Effective Function Level Vulnerability Detection Model using LLM and Code Chunkcited by 4
- 2025SecureFed: A Two-Phase Framework for Detecting Malicious Clients in Federated Learningcited by 2
- 2025AndroIDS : Android-based Intrusion Detection System using Federated Learningcited by 1
Built on by
Citing papers per year: 2025: 1; 2026: 2.
3 papers.