mlsanityData to 14 Oct 2026

Uncovering Systematic Failures of LLMs in Verifying Code Against Natural Language Specifications

arXiv 2508.12358 ↗First posted 17 Aug 2025cs.SE cs.AIcited by 5

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

  1. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
  2. 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,695
  3. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  4. 2022Large Language Models are Zero-Shot Reasonerscited by 4,374
  5. 2021Program Synthesis with Large Language Modelscited by 3,637
  6. 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,442
  7. 2022Survey of Hallucination in Natural Language Generationcited by 2,075
  8. 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,391
  9. 2024LLM Evaluators Recognize and Favor Their Own Generationscited by 686
  10. 2023A Prompt Pattern Catalog to Enhance Prompt Engineering with ChatGPTcited by 619
  11. 2023JudgeLM: Fine-tuned Large Language Models are Scalable Judgescited by 367
  12. 2022A Systematic Evaluation of Large Language Models of Codecited by 363
15 more
  1. 2024Who Validates the Validators? Aligning LLM-Assisted Evaluation of LLM Outputs with Human Preferencescited by 144
  2. 2024Graph Chain-of-Thought: Augmenting Large Language Models by Reasoning on Graphscited by 119
  3. 2024From LLMs to LLM-based Agents for Software Engineering: A Survey of Current, Challenges and Futurecited by 86
  4. 2024A Survey on LLM-based Code Generation for Low-Resource and Domain-Specific Programming Languagescited by 66
  5. 2024CodeUltraFeedback: An LLM-as-a-Judge Dataset for Aligning Large Language Models to Coding Preferencescited by 57
  6. 2024CodeJudge: Evaluating Code Generation with Large Language Modelscited by 44
  7. 2025MCTS-Judge: Test-Time Scaling in LLM-as-a-Judge for Code Correctness Evaluationcited by 32
  8. 2024Evaluating Human-AI Collaboration: A Review and Methodological Frameworkcited by 27
  9. 2024ThinkRepair: Self-Directed Automated Program Repaircited by 23
  10. 2024AI-powered Code Review with LLMs: Early Resultscited by 22
  11. 2018A Comprehensive Study of Automatic Program Repair on the QuixBugs Benchmarkcited by 18
  12. 2025Don't Judge Code by Its Cover: Exploring Biases in LLM Judges for Code Evaluationcited by 18
  13. 2024Exploring LLMs for Verifying Technical System Specifications Against Requirementscited by 7
  14. 2025Towards Advancing Code Generation with Large Language Models: A Research Roadmapcited by 5
  15. 2025Do Chains-of-Thoughts of Large Language Models Suffer from Hallucinations, Cognitive Biases, or Phobias in Bayesian Reasoning?cited by 4

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 5.

5 papers.