Are LLMs Reliable Code Reviewers? Systematic Overcorrection in Requirement Conformance Judgement
Organizations: University of Sydney, Sydney, NSW, Australia.
Abstract
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 verify if code implementation satisfy task requirements, thereby ensuring code robustness and accuracy. However, it remains unclear whether LLMs can reliably determine code against the given task descriptions, which is usually in a form of natural language specifications. In this paper, we uncover a systematic failure of LLMs in matching code to natural language requirements. Specifically, with widely adopted benchmarks and unified prompts design, we demonstrate that LLMs frequently misclassify correct code implementation as non-compliant or defective. Surprisingly, we find that more detailed prompt design, particularly with those requiring explanations and proposed corrections, leads to higher misjudgment rates, highlighting critical reliability issues for LLM-based code assistants. We further analyze the mechanisms driving these failures and evaluate the reliability of rationale-required judgments. Building on these findings, we propose a Fix-guided Verification Filter that treats the model proposed fix as executable counterfactual evidence, and validates the original and revised implementations using benchmark tests and spec-constrained augmented tests. Our results expose previously under-explored limitations in LLM-based code review capabilities, and provide practical guidance for integrating LLM-based reviewers with safeguards in automated review and development pipelines.
Figures & tables
| Category | Explanation |
| Misread Spec | The model misreads or overlooks key requirement semantics (e.g., interpreting constraint A as constraint B). |
| Added Requirement | The model introduces constraints not stated in the requirement and rejects the code for violating these hallucinated requirements. |
| Overthink Edge | The model overemphasizes extreme or unspecified edge cases, despite the requirement not mandating such handling (or the code already covering it). |
| Assumed Type | The model assumes stricter (or different) input types/formats and rejects the implementation based on those assumptions. |
| Imagined Runtime | The model speculates about runtime errors (e.g., index error, None handling, exceptions) without concrete evidence from the given code and requirement. |
| Performance Nitpick | The model treats efficiency/complexity as a hard requirement even when not mentioned, and rejects correct code due to perceived inefficiency. |
| Model | Approch | HumanEval | MBPP | Quixbugs | |||||
|---|---|---|---|---|---|---|---|---|---|
| FPR | FNR | FPR | FNR | FPR | FNR | ||||
| GPT-4o | Direct | 2.44 | 26.2 | 3.70 | 35.9 | 10.9 | 35.0 | ||
| Direct + Explain | 0.00 | 58.5 | 0.00 | 74.1 | 5.00 | 45.0 | |||
| Full | 0.00 | 73.2 | 0.20 | 87.9 | 5.00 | 60.0 | |||
| Gemini-2.0-flash | Direct | 8.54 | 25.6 | 10.3 | 34.7 | 22.5 | 25.0 | ||
| Direct + Explain | 7.32 | 23.2 | 11.1 | 35.1 | 22.5 | 22.5 |
| Model | HumanEval | MBPP | QuixBugs | |||
|---|---|---|---|---|---|---|
| BugMatch | SymMatch | BugMatch | SymMatch | BugMatch | SymMatch | |
| GPT-4o | 59.1 | 98.2 | 70.8 | 94.7 | 58.3 | 100.0 |
| Claude-4.5 | 65.0 | 97.5 | 75.2 | 93.3 | 57.9 | 92.1 |
| Gemini-2.0 | 52.0 | 98.7 | 67.2 | 95.8 | 38.2 | 91.2 |
| Llama-3.1 | 44.2 | 96.8 | 52.2 | 96.0 | 41.7 | 100.0 |
| Mistral-3.1 | 50.0 | 96.8 | 65.7 | 94.5 | 58.3 | 95.8 |
| Model | Setting | HumanEval | MBPP | QuixBugs | |||
| FPR | FNR | FPR | FNR | FPR | FNR | ||
| GPT-4o | Full (Before) | 0.0 | 70.7 | 0.0 | 88.7 | 5.0 | 57.5 |
| Full+Filter (After) | 1.8 | 23.2 ( 47.6 ) | 0.4 | 40.0 ( 48.8 ) | 7.5 | 27.5 ( 30.0 ) | |
| Gemini-2.0-flash | Full (Before) | 7.8 | 25.0 | 11.1 | 30.1 | 22.5 | 20.0 |
| Full+Filter (After) | 6.4 | 5.8 ( 19.2 ) | 10.2 | 10.2 ( 19.9 ) | 22.5 | 12.5 ( 7.5 ) | |
| Claude-4-5-sonnet | Full (Before) | 1.9 | 46.0 | 5.3 | 61.2 | 5.0 | 50.0 |
Automated Code Review
Automated code review uses software analysis and AI to find defects, assess changes, and support pull-request decisions.
See all 48 papers