AI Made Friendly HERE

Detailed Prompts Lead Language Models to Reject Working Code in Automated

Large language models deployed as automated code reviewers exhibit a systematic over-correction bias when judging whether program implementations satisfy natural-language task requirements without executable test cases. In software development pipelines, engineering teams increasingly consider generative artificial intelligence systems to evaluate source code alignment against functional specifications, aiming to streamline verification. However, an empirical investigation reveals that when these models evaluate code solely against descriptive task specifications, they routinely misclassify fully functional, conforming source code as non-compliant or defective. This pervasive failure pattern results in elevated false negative rates across multiple model architectures and task benchmarks. Rather than serving as dependable virtual reviewers, the models demonstrate an inherent skew toward false rejection, identifying non-existent flaws in correct code and undermining the practical reliability of automated evaluation in workflows where verification decisions govern continuous integration and deployment.

Crucially, the research demonstrates that conventional prompt engineering strategies intended to improve reasoning fail to resolve this strictness bias and instead significantly worsen it. A prevalent intuition suggests that requiring a neural model to articulate explicit reasoning steps, enumerate behavioral discrepancies, or propose corrective patches will cultivate methodical scrutiny and reduce errors. In requirement-conformance evaluation, however, structured and elaborate instructions produce the opposite outcome. As prompts become progressively more complex—demanding that models first deliver a formal verdict, then provide an analytical explanation, and ultimately supply a revised code patch—misjudgment rates climb sharply. The requirement to generate repairs appears to prime models to assume defects exist, inadvertently encouraging excessive fault-finding. Instead of improving review fidelity, detailed prompts reshape the decision boundary, turning automated assistants into aggressive over-correctors that persistently reject sound software solutions.

To rigorously evaluate the prevalence and mechanisms of this phenomenon, researchers Haolin Jin and Huaming Chen designed an extensive empirical benchmark incorporating over 1,400 paired code instances derived from three recognized programming suites. The experimental design drew foundational task specifications from HumanEval, the Mostly Basic Python Problems dataset, and the QuixBugs algorithmic defect repository. For every individual task specification across these datasets, the investigators paired the original natural-language requirement with two aligned implementation variants: a canonical, functionally correct program labeled as positive, and a defective version containing injected faults labeled as negative. Datasets such as HumanEval-X-Bugs provided standardized defect annotations detailing specific fault types and failure symptoms, while the remaining benchmarks were normalized into a unified evaluation schema encompassing six fault categories and observable runtime failure symptoms to guarantee equitable confusion-matrix evaluation across all experimental conditions.

The experimental framework subjected five representative language models to three distinct and progressively structured prompting approaches under identical task specifications. The assessed systems comprised three widely utilized proprietary closed-source models—GPT-4o, Claude-4.5-sonnet, and Google Gemini-2.0-flash—alongside two prominent open-source instruction-tuned models, specifically meta-llama/llama-3.1-8b-instruct and mistralai/mistral-small-3.1-24b-instruct. To systematically assess the influence of instruction design, each language model processed every code implementation under three controlled prompt templates: a baseline Direct prompt soliciting an unelaborated binary yes-or-no determination; a Direct+Explain prompt requiring a binary judgment accompanied by a brief rationale; and a comprehensive Full prompt demanding a three-stage output consisting of an explicit verdict, a detailed diagnostic explanation, and a functional code patch whenever non-conformance was declared. Model outputs were captured in structured formats to facilitate precise auditing of verdicts, rationales, and proposed fixes.

The resulting performance metrics revealed profound behavioral shifts among leading closed-source architectures, characterized by a sharp trade-off between false rejections and false acceptances. Under simple Direct prompting, GPT-4o exhibited moderate false negative rates of 26.2 percent on HumanEval and 35.9 percent on the Mostly Basic Python Problems benchmark. When shifted to the comprehensive Full prompting protocol requiring explanations and corrective patches, however, the model’s false negative rate escalated dramatically to 73.2 percent on HumanEval and 87.9 percent on the Python problems dataset. Concurrently, its false positive rate dropped to zero or near-zero levels across several settings, illustrating an extreme shift toward conservative rejection where buggy code is rarely admitted but valid code is overwhelmingly condemned. Claude-4.5-sonnet followed a similar pattern of prompt-induced conservatism, whereas Gemini-2.0-flash maintained lower false negative rates between 22.5 and 39.6 percent but permitted substantially higher false acceptance rates.

Open-source architectures displayed even more pronounced operational instability and acute vulnerability to severe over-correction under identical experimental constraints. Llama-3.1-8B suffered from extraordinarily high false rejection rates across all benchmarks, registering false negative rates above 74.7 percent on the Mostly Basic Python Problems benchmark even under minimal Direct prompting and surging past 91.9 percent when required to supply rationales. Similarly, its false negative rate on QuixBugs reached 87.5 percent under intermediate prompting, reflecting an overwhelming tendency to reject valid code. Mistral-Small-3.1-24B exhibited an erratic error distribution, recording elevated false negative figures alongside high false positive rates reaching 40.0 percent on QuixBugs under both direct and explanatory prompts. These statistical patterns translate into substantial practical disruption: for GPT-4o on the Python problems benchmark, moving to richer prompts eliminated 19 false acceptances but introduced 267 additional false rejections, creating hundreds of spurious failure reports for software engineers.

To diagnose why language models persistently reject functional implementations, the researchers analyzed rationales generated across false negative outcomes and mapped them into a unified taxonomy of perceived fault categories. Unlike false acceptances where ground-truth defects exist, false rejections stem entirely from subjective model perceptions. The analysis established that 48.2 percent of all false negative explanations attributed rejection to purported Logic Errors, with models broadly asserting algorithmic flaws or missing procedures without furnishing concrete counterexamples. An additional 14.1 percent of rejections were driven by Added Requirements, wherein models invented unstated constraints absent from the original specification. Boundary Errors accounted for 13.2 percent, reflecting misplaced suspicion regarding inequality operators and terminal conditions, while Misread Specifications represented 11.7 percent. Together, these four semantic categories constituted 87.2 percent of all false rejection rationales, confirming that over-correction stems from substantive functional mis-calibration rather than cosmetic stylistic preferences or performance critiques.

Beyond evaluating raw verdict accuracy, the study introduced self-consistency auditing to determine whether models’ written justifications logically supported their declared binary decisions. Utilizing GPT-4o as an external evaluator instructed solely to verify internal alignment between statements, the investigation discovered widespread internal dissonance within rationale-enabled outputs. Most notably, the direction of contradiction was strongly model-dependent. In 93 percent of its contradiction instances, GPT-4o produced an affirmative, supportive rationale that argued the code was functional, yet concurrently finalized its output with a negative rejection verdict. Conversely, Gemini-2.0-flash exhibited the opposite dissonance in 88 percent of its conflicting cases, issuing an affirmative verdict while detailing potential functional defects within its written text. The open-source Llama and Mistral models mirrored this permissive contradiction pattern in more than 70 percent of their inconsistent outputs, demonstrating that verbose justifications frequently fail to substantiate the models’ recorded determinations.

A complementary fault-awareness assessment conducted on buggy implementations further demonstrated that correct model rejections rarely correspond to reliable causal diagnoses. When evaluating defective code where models successfully rendered negative verdicts, the researchers compared generated explanations against ground-truth defect annotations encompassing six root-cause categories and observable failure symptoms. Across all evaluated systems, symptom awareness approached ceiling levels; GPT-4o correctly identified observable failure manifestations, such as incorrect outputs or runtime crashes, in 94.7 to 100 percent of instances. However, its accuracy in identifying underlying defect types was substantially lower, ranging between 58.3 and 70.8 percent. Open-source models exhibited an even wider divergence, matching symptom descriptions in over 96 percent of cases while identifying the correct bug category in only 41.7 to 52.2 percent of instances, proving that automated reviewers routinely reject defective software for entirely inaccurate reasons.

To counteract systematic over-correction without relying on subjective text explanations, the authors formulated a lightweight mitigation pipeline designated as the Fix-guided Verification Filter. Integrated directly into the evaluation workflow, this framework treats the model’s proposed code correction as an executable counterfactual hypothesis. Whenever a reviewer model issues a rejection verdict accompanied by a repair patch, the system executes both the original submission and the suggested modification against existing benchmark test suites alongside spec-constrained augmented tests generated by GPT-4o. The filter arbitrates the final determination across four discrete execution conditions: if both programs execute successfully and produce identical outputs on augmented inputs, the fix is deemed superfluous and the rejection is reversed to an approval; if the proposed fix introduces runtime regressions, over-repair is recognized and reversed; and if the patch remedies genuine test failures, the initial rejection is confirmed.

Empirical deployment of this counterfactual verification pipeline demonstrated substantial reductions in false negative outcomes across all evaluated language models and benchmark environments. When applied to outputs generated under the comprehensive Full prompting regime, the verification filter decreased the average false negative rate from 54.8 percent to 16.3 percent on HumanEval and from 69.0 percent to 28.9 percent on the Mostly Basic Python Problems dataset. For heavily conservative models such as Llama-3.1-8B, false rejections on the Python problems benchmark plummeted from 90.81 percent down to 23.56 percent. Although the filter caused minor increases in false positive rates when shallow test harnesses failed to detect subtle bugs, the findings establish that anchoring code review decisions in differential runtime execution provides an effective, model-agnostic safeguard against prompt-induced conservatism, offering practical architectural guidance for integrating generative language models into mission-critical software engineering workflows.

Subject of Research: Empirical evaluation of over-correction bias and rationale unreliability in language model code review

Article Title: Are LLMs reliable code reviewers? systematic overcorrection in requirement conformance judgement

Article References: Jin, H., & Chen, H. (2026). Are LLMs reliable code reviewers? systematic overcorrection in requirement conformance judgement. Automated Software Engineering, 33(3), Article 90. https://doi.org/10.1007/s10515-026-00638-5

Image Credits: AI Generated

DOI: 10.1007/s10515-026-00638-5

Keywords: large language models, automated code review, software engineering, requirement conformance, overcorrection bias, false negative rate, prompt engineering, rationale self-consistency, fault awareness, counterfactual verification, fix-guided filter, HumanEval, Mostly Basic Python Problems, QuixBugs, GPT-4o, Claude-4.5-sonnet, Gemini-2.0-flash, Llama-3.1-8B

Originally Appeared Here

You May Also Like

About the Author:

Early Bird