Manuscript Offprint

arXiv:2610.38977

Beyond Passing Tests: A Systematic Review and Controlled Re-evaluation of Techniques for Improving the Quality of LLM-Generated Code

Prashank Kadam

PRASHANK KADAM, Cerby Inc., USA

Large language models pass most functional-correctness benchmarks, but passing tests says little about whether their code is readable, efficient or secure. Many techniques claim to improve these qualities, yet their evidence is scattered, usually covers one quality dimension and is rarely compared at an equal compute budget. We contribute a systematic review and a controlled re-evaluation. A systematic literature review of 628 primary studies (July 2021 to October 2026), with disclosed, author-reviewed LLM assistance, organizes the techniques by stage, signal source and quality target. Most studies measure only the dimension they target, gains often come with unchanged or unreported correctness, single automated quality signals are gamed, and compute, variance and contamination are rarely reported. A controlled re-evaluation runs ten techniques on four models at matched budgets on correctness, maintainability, efficiency and security benchmarks, extends it to thirteen current models and repository-level tasks, and compares 66 highlighted techniques head to head on Gemma 4 31B. At one call, quality prompting raises analyzer issue counts and leaves complexity and judge scores almost unchanged. At matched budgets, best-of-nn sampling with an analyzer-weighted ranker matches or beats prompting, planning, self-refinement, a reviewer agent and retrieval on measures the ranker does not optimize, while an analyzer feedback loop and fine-tuning beat it only on analyzer issue counts. Large correctness losses on HumanEval+, a likely contaminated benchmark near its ceiling, do not appear on contests held after the models' training cutoffs. In the head-to-head, 1 of 66 techniques beats best-of-nn on its primary target beyond the 95% interval, a rate consistent with chance. Gains should be reported against a budget-matched sampling baseline and on measures independent of the technique's own signal.

CCS Concepts: • Software and its engineering → Software creation and management; Software verification and validation; • Computing methodologies → Natural language processing; • General and reference → Surveys and overviews.

Additional Key Words and Phrases: large language models, code generation, code quality, maintainability, efficiency, security, systematic literature review

1 Introduction

Large language models (LLMs) now write a large share of new code, and the benchmarks used to judge them are running out of headroom. On SWE-bench Verified, the most cited measure of repository-level coding, the leading system reached 97.00% as of September 1, 2026 [185]. OpenAI stopped evaluating on it on February 23, 2026, stating that it "is increasingly contaminated" and recommending SWE-bench Pro instead [129]. Function-level suites such as HumanEval and MBPP saturated earlier ($5). When nearly every model passes, the tests no longer tell us which code is better.

Code quality is not functional correctness. A program can pass every test and still be hard to read, slow, or exploitable, and evidence of a large gap predates current models. When Pearce et al. [137] prompted GitHub Copilot with scenarios tied to high-risk weaknesses, about 40% of the 1,689 generated programs were vulnerable. In BaxBench, exploits succeeded on around half of each model's correct back-end programs [188]. Liu et al. [108] found code-style and maintainability issues in 1,930 of 4,066 ChatGPT solutions, and on EffiBench GPT-4's code ran on average 3.12 times as long as the human-written canonical solutions [73]. Agent code was 2.3x more verbose and 2.0x more eroded than code in 473 open-source Python repositories [131]. These context studies (Section 2) support our thesis: code quality is not the same as functional correctness, and a technique

Author's Contact Information: Prashank Kadam, prashank@cerby.com, Cerby Inc., USA.

that raises pass@1 while degrading maintainability, efficiency or security has produced a finding, not a success.

Many techniques, scattered evidence. A fast-growing literature improves LLM code beyond correctness through quality-oriented prompting, analyzer feedback loops, self-refinement, multi-agent pipelines, retrieval, constrained decoding and training-time alignment. The evidence, spread across software-engineering, machine-learning and security venues, is hard to use for three reasons. First, most studies measure only the dimension they target, so a security technique's effect on readability, or a readability technique's on correctness, is rarely known. Second, iterative techniques spend several times their baselines' compute, and gains often shrink once compute is matched [128]. Third, base models change faster than the studies: a technique evaluated on GPT-3.5 in 2023 says little about its value for a 2026 reasoning model.

Existing reviews. Sun et al. [178] survey 109 studies of non-functional quality through the ISO/IEC 25010 lens and add one patching experiment with three LLMs. Tony et al. [183] review prompting techniques for secure code and evaluate a subset on GPT-3, GPT-3.5 and GPT-4, for security only. Others focus on one dimension (maintainability [115], technical debt [47], code optimization [54], secure code generation [135]) or survey code generation without quality outcomes [83]; Section 3 compares them. None maps techniques across all three non-functional dimensions with their effects on correctness and non-targeted dimensions, or re-tests them head to head on the same models at matched compute.

This article. This article has two parts. The first, a systematic literature review (SLR), follows Kitchenham-style guidelines and is reported per SEGRESS [93] and PRISMA 2020 [133]. We searched OpenAlex, Semantic Scholar and arXiv from July 2021 to October 2026, calibrated the search string against a quasi-gold standard [209], screened 6942 records with LLM assistance disclosed under GUEST [94], and included 628 primary studies; the author reviewed every LLM screening, eligibility and extraction decision (§4). The second, a controlled re-evaluation (§16), re-runs ten techniques, one or more per family, and a single-shot baseline on a fixed grid of one closed frontier and three open-weight models, on fixed correctness, maintainability, efficiency and security benchmarks at matched budgets; an extended grid of thirteen current closed and open-weight models adds the repository- and agent-level benchmarks that dominate 2026 model releases (DeepSWE, Terminal-Bench, FrontierCode, SlopCodeBench, GSO, SWE-ficiency, SusVibes).

The review answers five research questions:

RQ1 (taxonomy). What techniques have been proposed to improve the non-functional quality of LLM-generated code, and how can they be organized?

RQ2 (targets and measurement). Which quality dimensions does each technique target, and how is each measured?

RQ3 (effects and trade-offs). What effects are reported on the target, on correctness, and on non-targeted dimensions?

RQ4 (evidence quality). How rigorous and reproducible is the evidence (baselines, compute reporting, contamination handling, human validation, artifacts)?

RQ5 (gaps). Which combinations of technique, dimension and setting are unstudied or understudied?

The re-evaluation adds four empirical questions (ERQ1–ERQ4, §16): matched-budget effects on the target, correctness and other dimensions; their dependence on model strength and architecture; and how the highlighted techniques compare in one setting.

Contributions.

(1) A faceted taxonomy classifying each technique by stage (pre-generation, in-decoding, post-generation loop, training-time), signal source (none, self, another LLM, static analyzer, compiler, tests, profiler, retrieved knowledge, human, learned verifier, reward model) and quality target (readability/maintainability, efficiency, security), built from a reproducible search whose queries, screening decisions and extraction data are released (§4, §6).

(2) A per-family synthesis of reported effects that sets the effect on correctness and non-targeted dimensions beside the effect on the target, and assesses evidence quality (§8–§15, §17).

(3) The highlighted techniques of each family, chosen by a fixed rule combining the most-cited techniques with recent ones reporting the largest gains, each described by its algorithmic novelty (§7).

(4) A controlled, matched-budget re-evaluation of these techniques that extends the repeated-sampling and test-time-compute comparisons made for correctness [18, 60, 128, 176] to maintainability, efficiency and security, on several models and on measures independent of each technique's own signal, with explicit treatment of contamination, compute fairness and metric validity, and a head-to-head comparison of the highlighted techniques on shared benchmarks (§16).

Main findings of the review. Against the extracted evidence: (i) only 70 of 628 extracted studies measured any quality dimension beyond their target (Table 11); (ii) among technique rows reporting a target gain, correctness was unchanged, mixed or lower in about a quarter and unreported in nearly three in ten (Table 12), and analyzer-driven loops held correctness mainly with a test or fitness gate (§9); (iii) optimizing a single automated quality signal invites gaming, from fixes that satisfy the analyzer but not reviewers to reinforcement-learning policies that emit trivial code (§9, §14); and (iv) few studies match compute, report variance or handle contamination (Table 13). Section 17 discusses them and §19 derives a research agenda.

Main findings of the re-evaluation. The matched-budget re-evaluation confirms the review's pattern (§16.1): (i) at equal budgets of four, eight or sixteen calls, best-of-nn sampling with an analyzer-weighted ranker matches or beats quality prompting, planning, self-refinement, a reviewer agent and retrieval in 13 to 16 of 16 cells on the measures it does not optimize (complexity, two judges, CWEval and BaxBench; Table 9), and the analyzer's own counts agree, so much of their reported gain over a single shot is a budget effect, and at a single call quality instructions and planning raise maintainability issues on every model; (ii) the analyzer loop and the training-time techniques beat best-of-nn beyond the 95% interval only on the issue counts their analyzers compute, while a judge rates the analyzer loop's code lower on every model; (iii) on the two models with the highest single-shot correctness, almost every technique lowers HumanEval+ pass@1 below the single shot, the analyzer loop by up to 9.94 points despite its public-test gate, and on both Gemma models best-of-nn itself loses hidden-test correctness as it draws more samples; (iv) weaker models gain more in absolute terms; (v) on LiveCodeBench Pro contests held after every cutoff, no technique changes correctness beyond the 95% interval, so much of the HumanEval+ loss is specific to HumanEval+, which is likely contaminated and near its ceiling for the strongest models; and (vi) across thirteen current models, maintainability and security rise with capability while efficiency does not, and at repository level frontier agents write working but insecure code on about four in ten SusVibes tasks. In the head-to-head of the highlighted techniques (§16.3), 1 of 66 beats best-of-nn on its primary target beyond the 95% interval and 22 fall below it, although 51 improve their target over a single shot by point estimate; security techniques lower detector hits far more often than they raise the share of functional and secure code; and in about half the cases efficiency techniques speed up execution time without improving instruction counts.

Organization. Sections 2–5 cover background, related surveys, review method and quality measurement; §6 gives the taxonomy, §7 the rule selecting each family's highlighted techniques, §8–§14 the seven families, each ending with its highlighted techniques, §15 the hybrid and other techniques, §16 the re-evaluation, and §17–§21 findings, implications for researchers and practitioners, agenda, threats and conclusions.

References (100)

Couldn't load all references. Reload the page to try again.