Why LLMs Fail: A Failure Analysis and Partial Success Measurement for Automated Security Patch Generation
Not on the map. Why?
Abstract (arXiv)
Large Language Models (LLMs) show promise for Automated Program Repair (APR), yet their effectiveness on security vulnerabilities remains poorly characterized. This study analyzes 319 LLM-generated security patchesacross 64 Java vulnerabilities from the Vul4J benchmark. Using tri-axis evaluation (compilation, security via PoV tests, functionality via test suites), the analysis reveals that only 24.8% of patches achieve full correctness, while 51.4% fail both security and functionality. The dominant failure mode is semantic misunderstanding: LLMs produce syntactically valid code but apply incorrect repair strategies. The proposed Security Repair Score (SRS) quantifies this gap, showing LLMs preserve functionality (mean 0.832) but struggle with security (mean 0.251). Vulnerability type strongly predicts difficulty, with fix rates ranging from 0% (input validation) to 45% (infinite loop). These findings demonstrate that LLM security patches require rigorous validation before deployment.
Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 6 of its 16 references that are in the map. First posted on arXiv 10 Mar 2026.
Builds on
6 of 16 references.
References · 6
- 2023Safe RLHF: Safe Reinforcement Learning from Human Feedbackcited by 630
- 2024RepairAgent: An Autonomous, LLM-Based Agent for Program Repaircited by 225
- 2025CWEval: Outcome-driven Evaluation on Functionality and Security of LLM Code Generationcited by 55
- 2025A Survey of LLM-based Automated Program Repair: Taxonomies, Design Paradigms, and Applicationscited by 24
- 2025PATCHEVAL: A New Benchmark for Evaluating LLMs on Patching Real-World Vulnerabilitiescited by 19
- 2025SoK: Automated Vulnerability Repair: Methods, Tools, and Assessmentscited by 11
Built on by
Citing papers per year: 2026: 1.
1 paper.