Uncovering Systematic Failures of LLMs in Verifying Code Against Natural Language Specifications
Not on the map. Why?
Abstract (arXiv)
Large language models (LLMs) have become essential tools in software development, widely used for requirements engineering, code generation and review tasks. Software engineers often rely on LLMs to assess whether system code implementation satisfy task requirements, thereby enhancing code robustness and accuracy. However, it remains unclear whether LLMs can reliably determine whether the code complies fully with the given task descriptions, which is usually natural language specifications. In this paper, we uncover a systematic failure of LLMs in evaluating whether code aligns with natural language requirements. Specifically, with widely used benchmarks, we employ unified prompts to judge code correctness. Our results reveal that LLMs frequently misclassify correct code implementations as either ``not satisfying requirements'' or containing potential defects. Surprisingly, more complex prompting, especially when leveraging prompt engineering techniques involving explanations and proposed corrections, leads to higher misjudgment rate, which highlights the critical reliability issues in using LLMs as code review assistants. We further analyze the root causes of these misjudgments, and propose two improved prompting strategies for mitigation. For the first time, our findings reveals unrecognized limitations in LLMs to match code with requirements. We also offer novel insights and practical guidance for effective use of LLMs in automated code review and task-oriented agent scenarios.
Key facts. Cited by 5 papers in the map (data through 14 Oct 2026). Builds on 27 of its 32 references that are in the map. First posted on arXiv 17 Aug 2025.
Builds on
27 of 32 references.
References · 27
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,695
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2022Large Language Models are Zero-Shot Reasonerscited by 4,374
- 2021Program Synthesis with Large Language Modelscited by 3,637
- 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,442
- 2022Survey of Hallucination in Natural Language Generationcited by 2,075
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,391
- 2024LLM Evaluators Recognize and Favor Their Own Generationscited by 686
- 2023A Prompt Pattern Catalog to Enhance Prompt Engineering with ChatGPTcited by 619
- 2023JudgeLM: Fine-tuned Large Language Models are Scalable Judgescited by 367
- 2022A Systematic Evaluation of Large Language Models of Codecited by 363
15 more
- 2024Who Validates the Validators? Aligning LLM-Assisted Evaluation of LLM Outputs with Human Preferencescited by 144
- 2024Graph Chain-of-Thought: Augmenting Large Language Models by Reasoning on Graphscited by 119
- 2024From LLMs to LLM-based Agents for Software Engineering: A Survey of Current, Challenges and Futurecited by 86
- 2024A Survey on LLM-based Code Generation for Low-Resource and Domain-Specific Programming Languagescited by 66
- 2024CodeUltraFeedback: An LLM-as-a-Judge Dataset for Aligning Large Language Models to Coding Preferencescited by 57
- 2024CodeJudge: Evaluating Code Generation with Large Language Modelscited by 44
- 2025MCTS-Judge: Test-Time Scaling in LLM-as-a-Judge for Code Correctness Evaluationcited by 32
- 2024Evaluating Human-AI Collaboration: A Review and Methodological Frameworkcited by 27
- 2024ThinkRepair: Self-Directed Automated Program Repaircited by 23
- 2024AI-powered Code Review with LLMs: Early Resultscited by 22
- 2018A Comprehensive Study of Automatic Program Repair on the QuixBugs Benchmarkcited by 18
- 2025Don't Judge Code by Its Cover: Exploring Biases in LLM Judges for Code Evaluationcited by 18
- 2024Exploring LLMs for Verifying Technical System Specifications Against Requirementscited by 7
- 2025Towards Advancing Code Generation with Large Language Models: A Research Roadmapcited by 5
- 2025Do Chains-of-Thoughts of Large Language Models Suffer from Hallucinations, Cognitive Biases, or Phobias in Bayesian Reasoning?cited by 4
Built on by
Citing papers per year: 2026: 5.
5 papers.
- 2026Falsification, Not Exposure: An Internally Preregistered Placebo-Controlled Decomposition of Self-Repair Feedback in Frozen Small Code Modelscited by 4
- 2026Measuring and Exploiting Contextual Bias in LLM-Assisted Security Code Reviewcited by 3
- 2026Selection Without Signal, Recovery Through Expression: A Measurement Study of Post-Hoc Falsification Operators for Frozen Small Code Modelscited by 2
- 2026RepoRescue: An Empirical Study of LLM Agents on Whole-Repository Compatibility Rescuecited by 1
- 2026Is Vibe Coding the Future? An Empirical Assessment of LLM Generated Codes for Construction Safetycited by 0
- 2026RepoRescue: An Empirical Study of LLM Agents on Whole-Repository Compatibility Rescue1 Jul 2026
- 2026Falsification, Not Exposure: An Internally Preregistered Placebo-Controlled Decomposition of Self-Repair Feedback in Frozen Small Code Models30 Jun 2026
- 2026Selection Without Signal, Recovery Through Expression: A Measurement Study of Post-Hoc Falsification Operators for Frozen Small Code Models15 Jun 2026
- 2026Is Vibe Coding the Future? An Empirical Assessment of LLM Generated Codes for Construction Safety14 Apr 2026
- 2026Measuring and Exploiting Contextual Bias in LLM-Assisted Security Code Review19 Mar 2026