Beyond Passing Tests: A Systematic Review and Controlled Re-evaluation of Techniques for Improving the Quality of LLM-Generated Code
Organizations: Cerby Inc., USA
Abstract
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-n 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-n 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.
Figures & tables
| Family | Stage | Typical signal sources | Section |
| Prompting | pre-generation | none; self (planning, chain of thought) | § 8 |
| Tool feedback | post-generation loop | static analyzer, compiler, tests, profiler | § 9 |
| Self-refinement | post-generation loop | self; tests (self-debugging) | § 10 |
| Multi-agent | post-generation loop | other LLM; tools invoked by agents | § 11 |
| Retrieval | pre-generation | retrieved knowledge | § 12 |
| Decoding | in-decoding | grammar or type constraints, learned verifier, tests | § 13 |
| (a) Model (abbr.) | Platform; architecture | Sampling control | Role |
| Claude Opus 5.5 (Op) | Claude API; closed | effort only; always thinks | strong anchor |
| gpt-oss-120b (oss) | Fireworks serverless; MoE | temperature, seed, effort | weak anchor |
| Gemma 4 31B IT (G31) | Fireworks dedicated; dense | temperature, seed | dense arm, tuned |
| Gemma 4 26B-A4B IT (G26) | Fireworks dedicated; MoE | temperature, seed | MoE arm, tuned |
| GPT-6.1 Sol, Gemini 4 Argon | Vercel, one pinned provider; closed | native effort only | extended grid |
| Kimi K3, GLM-5.3, Qwen3.8-Max, MiMo-V2.6-Pro, DeepSeek V4.1-Flash, V4-Flash, MiniMax M3 | Fireworks; MoE | temperature, seed | extended grid |
| Op | oss | G31 | G26 | |||||||||
| Technique | HE+ | LCB | LCBP | HE+ | LCB | LCBP | HE+ | LCB | LCBP | HE+ | LCB | LCBP |
| T0 single shot | 96.40 | – | 69.82 | 81.27 | 61.61 | 21.94 | 96.06 | 69.91 | 27.68 | 89.16 | 77.10 | 22.99 |
| T1 quality instr. | 99.10 | – | 68.71 | 83.17 | 59.64 | 22.12 | 97.96 | 80.71 | 28.07 | 89.68 | 80.97 | 23.61 |
| T2 SCoT | 91.41 | – | 69.77 | 85.31 | 60.38 | 22.49 | 85.56 | 84.17 | 30.60 | 89.80 | 82.34 | 24.51 |
| T3 analyzer loop | 90.23 | – | 72.17 | 84.86 | 58.99 | 22.71 | 86.12 | 79.48 | 28.48 | 84.11 | 73.91 | 22.34 |
| T4 Self-Refine | 89.50 | – | 67.93 | 81.58 | 63.57 | 24.14 | 84.98 | 78.90 | 26.16 | 91.25 | 80.99 | 23.16 |
| Model | T0 | T1 | T2 | T3 | T4 | T5 | T6 | T7 | T8 | T9 | T10 |
| Claude Opus 5.5 | 75.17 | 71.78 | 68.18 | 66.24 | 68.48 | 76.55 | 67.03 | 71.88 | – | – | – |
| GPT-6.1 Sol | 76.59 | 76.49 | 75.29 | 73.59 | 77.19 | 80.25 | 72.18 | 79.90 | – | – | – |
| Gemini 4 Argon | 76.38 | 75.86 | 75.85 | 71.15 | 76.43 | 78.05 | 73.71 | 80.26 | – | – | – |
| Kimi K3 | 65.47 | 70.80 | 66.63 | 62.62 | 68.58 | 68.28 | 64.85 | 70.68 | – | – | – |
| GLM-5.3 | 71.95 | 72.14 | 66.92 | 67.83 | 69.27 | 72.77 | 67.54 | 73.10 | – | – | – |
| Qwen3.8-Max | 59.19 | 60.92 | 54.32 | 56.61 | 56.91 | 56.27 | 55.27 | 58.43 | – | – | – |
| (a) API-served models | ||||||||
| Op | oss | |||||||
| Technique | C% | Lint | CC | J | C% | Lint | CC | J |
| T0 single shot | 86.99 | 21.37 | 7.68 | 4.30 | 85.73 | 29.22 | 10.72 | 3.55 |
| T1 quality instr. | 82.76 | 20.01 | 7.53 | 4.42 | 79.20 | 27.14 | 10.25 | 3.73 |
| T2 SCoT | 79.78 | 18.71 | 7.32 | 4.59 | 75.11 | 26.97 | 9.97 | 4.01 |
| T3 analyzer loop | 38.35 | 7.81 | 7.75 | 4.53 | 38.31 | 11.31 | 9.79 | 3.75 |
| (a) API-served models | ||||||
| Op | oss | |||||
| Technique | DPS | ET | Bey | DPS | ET | Bey |
| T0 single shot | 78.06 | 47.79 | 75.03 | 79.41 | 61.33 | 69.70 |
| T1 quality instr. | 79.90 | 49.70 | 76.48 | 75.01 | 62.24 | 70.29 |
| T2 SCoT | 79.20 | 48.64 | 79.38 | 75.11 | 63.71 | 74.18 |
| T3 analyzer loop | 75.46 | 44.11 | 79.72 | 72.17 | 60.53 | 70.55 |
| (a) API-served models | ||||||||
| Op | oss | |||||||
| Technique | FS | SP | Ins | B/k | FS | SP | Ins | B/k |
| T0 single shot | 74.85 | 58.54 | 42.67 | 3.40 | 45.02 | 26.38 | 44.93 | 5.14 |
| T1 quality instr. | 66.87 | 55.13 | 37.80 | 3.34 | 46.07 | 28.61 | 44.79 | 4.96 |
| T2 SCoT | 74.30 | 54.74 | 40.46 | 3.37 | 46.68 | 27.47 | 46.72 | 5.14 |
| T3 analyzer loop | 79.89 | 61.53 | 13.79 | 1.20 | 53.07 | 30.47 | 16.07 | 1.84 |
| (a) better/worse than T0 | (b) better/worse than T7 | |||||||
| Technique | COR | R/M | EFF | SEC | COR | R/M | EFF | SEC |
| T1 quality instructions | 2/0 (15) | 6/1 (16) | 0/3 (12) | 4/1 (16) | 2/1 (15) | 0/13 (16) | 3/2 (12) | 0/12 (16) |
| T2 SCoT / plan first | 1/3 (15) | 15/0 (16) | 4/2 (12) | 0/0 (16) | 1/3 (15) | 3/11 (16) | 4/1 (12) | 0/13 (16) |
| T3 analyzer loop | 1/4 (15) | 12/1 (16) | 1/2 (12) | 10/0 (16) | 0/3 (15) | 9/5 (16) | 2/2 (12) | 8/0 (16) |
| T4 Self-Refine | 1/3 (15) | 8/0 (16) | 3/3 (12) | 7/0 (16) | 1/2 (15) | 1/12 (16) | 2/2 (12) | 0/10 (16) |
| T5 coder + reviewer | 2/1 (15) | 15/0 (16) | 2/2 (12) | 7/0 (16) | 1/2 (15) | 3/9 (16) | 3/0 (12) | 0/7 (16) |
| Technique | CC | J | FS | SP | T7 | J2 | H |
| T1 quality instructions | 0/1 | 0/4 | 0/1 | 0/3 | 16 of 16 | 0/3 | |
| T2 SCoT / plan first | 2/0 | 1/3 | 0/1 | 0/4 | 13 of 16 | 1/2 | |
| T3 analyzer loop | 1/1 | 0/4 | 0/0 | 0/0 | 15 of 16 | 0/3 | |
| T4 Self-Refine | 1/1 | 0/3 | 0/2 | 0/2 | 15 of 16 | 0/3 | |
| T5 coder + reviewer | 2/0 | 1/2 | 0/0 | 0/2 | 13 of 16 | 1/2 | |
| T6 RAG | 2/1 | 1/3 | 0/0 | 0/0 | 13 of 16 | 1/2 |
| Metric | Benchmark | Op | oss | G31 | G26 | ||
| COR | HE+ pass@1 | HumanEval+ | 164 | 1.41 | 4.62 | 3.16 | 4.08 |
| LCB pass@1 | LiveCodeBench v6 (dated) | 100–400 a | – | 4.00 | 5.84 | 7.65 | |
| LCBP pass@1 | LiveCodeBench Pro, post-cutoff contests | 155 | 5.67 | 5.81 | 6.26 | 5.66 | |
| DS pass@1 | DeepSWE v1.1 | 113 | 6.66 | 5.74 | 5.40 | 4.46 | |
| R/M | C% | PythonSecurityEval | 470 | 3.24 | 3.40 | 2.58 | 3.59 |
| Lint/kLOC | RACE R/M, NoFunEval | 300–600 a | 1.82 | 2.21 | 2.17 | 2.10 |
| Family | Studies | Non-targeted dim. measured | COR measured | ||
| % | % | ||||
| Prompting | 113 | 15 | 13 | 79 | 70 |
| Tool feedback | 124 | 12 | 10 | 94 | 76 |
| Self-refinement | 17 | 1 | 6 | 10 | 59 |
| Multi-agent | 75 | 10 | 13 | 66 | 88 |
| Retrieval | 37 | 4 | 11 | 28 | 76 |
| COR \ target | mixed | nr | total | |||
| 257 (136–340) | 3 (0–7) | 3 (0–7) | 26 (11–42) | 20 (8–34) | 309 (223–362) | |
| 51 (24–78) | 2 (0–5) | 0 (0–1) | 2 (0–5) | 1 (0–3) | 56 (37–74) | |
| 27 (11–44) | 1 (0–3) | 4 (1–9) | 23 (9–38) | 0 (0–1) | 55 (37–73) | |
| mixed | 65 (31–98) | 1 (0–3) | 1 (0–3) | 37 (16–58) | 3 (0–7) | 107 (74–136) |
| nr | 161 (83–225) | 3 (0–7) | 3 (0–7) | 37 (17–59) | 6 (1–12) | 210 (150–255) |
| total | 561 (409–601) | 10 (5–16) | 11 (6–17) | 125 (88–158) | 30 (19–42) | 737 |
| Family | Med. QA | Comp. % | Cont. % | Human % | Artif. % | |
| Prompting | 113 | 6.5 | 38 | 31 | 32 | 73 |
| Tool feedback | 124 | 6.0 | 69 | 31 | 9 | 65 |
| Self-refinement | 17 | 6.0 | 24 | 47 | 29 | 65 |
| Multi-agent | 75 | 5.0 | 65 | 17 | 8 | 53 |
| Retrieval | 37 | 6.0 | 41 | 46 | 30 | 62 |
| Decoding | 18 | 6.5 | 67 | 22 | 11 | 78 |
Appendix figures & tables42 assets
Supplementary material from the paper’s appendix.
Appendix
| ID | Title | Year | Family | Targets | Src |
|---|---|---|---|---|---|
| V00036 | Planning with Large Language Models for Code Generation | 2023 | Decoding | R/M | arXiv:2303.05510 |
| R00867 | Constrained Decoding for Secure Code Generation | 2024 | Decoding | SEC | arXiv:2405.00218 |
| S01754 | Make Every Move Count: LLM-based High-Quality RTL Code Generation Using MCTS | 2024 | Decoding | EFF | arXiv:2402.03289 |
| V00117 | LLMs Meet Library Evolution: Evaluating Deprecated API Usage in LLM-Based Code Completion | 2024 | Decoding, Prompting | R/M | arXiv:2406.09834 |
| R02790 | A Mixture of Linear Corrections Generates Secure Code | 2025 | Decoding | SEC | arXiv:2507.09508 |
| R03351 | HiLDE: Intentional Code Generation via Human-in-the-Loop Decoding | 2025 | Decoding | SEC | arXiv:2505.22906 |
| ID | Q1 | Q2 | Q3 | Q4 | Q5 | Q6 | Q7 | Q8 | Q9 | Q10 | Total |
|---|---|---|---|---|---|---|---|---|---|---|---|
| O00001 | 0.5 | 1 | 0.5 | 1 | 1 | 0.5 | 0 | 1 | 0.5 | 0 | 6.0 |
| O00002 | 1 | 1 | 0.5 | 1 | 1 | 0.5 | 1 | 1 | 0.5 | 0 | 7.5 |
| O00007 | 0.5 | 0.5 | 1 | 0.5 | 1 | 0.5 | 0 | 1 | 0 | 1 | 6.0 |
| O00008 | 1 | 1 | 0.5 | 0 | 1 | 1 | 0.5 | 1 | 0 | 0.5 | 6.5 |
| O00015 | 1 | 1 | 1 | 0 | 1 | 0 | 0.5 | 1 | 0.5 | 0.5 | 6.5 |
| O00021 | 1 | 1 | 0.5 | 0.5 | 1 | 0.5 | 0 | 1 | 1 | 1 | 7.5 |
| Release | Released | OW | Source |
|---|---|---|---|
| Claude (Anthropic) | |||
| Claude Sonnet 3.7 (claude-3-7-sonnet-20250219) | 2025-02 | N | ( Anthropic, 2026b ; Anthropic, 2026e ) |
| Claude Opus 4 | 2025-05 | N | ( Anthropic, 2026b ) |
| Claude Sonnet 4 | 2025-05 | N | ( Anthropic, 2026b ) |
| Claude Opus 4.1 | 2025-08 | N | ( Anthropic, 2026b ) |
| Claude Sonnet 4.5 | 2025-09 | N | ( Anthropic, 2026b ) |
| Domain | ID | Title | Year | Family | Cit. |
|---|---|---|---|---|---|
| Compiler and IR transforms | R03592 | Agentic Auto-Scheduling: An Experimental Study of LLM-Guided Loop Optimization | 2025 | Tool feedback | 6 |
| Compiler and IR transforms | R05239 | HintPilot: LLM-based Compiler Hint Synthesis for Code Optimization | 2026 | Retrieval | 4 |
| Compiler and IR transforms | R03953 | LOOPRAG: Enhancing Loop Transformation Optimization with Retrieval-Augmented Large Language Models | 2025 | Retrieval | 3 |
| Data science | R05154 | How to Build AI Agents by Augmenting LLMs with Codified Human Expert Domain Knowledge? A Software Engineering Framework | 2026 | Retrieval | 3 |
| Data science | R02038 | Engineering Systems for Data Analysis Using Interactive Structured Inductive Programming | 2025 | Prompting | 3 |
| Data science | S04182 | Diff-SQL: SQL Efficiency Optimization via Patch Generation and Constraint Alignment | 2026 | Self-refinement | 0 |
| % | % | ||||
| Year | Publisher | ||||
| 2022 | 5 | 1 | IEEE | 192 | 28 |
| 2023 | 24 | 3 | ACM | 108 | 16 |
| 2024 | 79 | 11 | Springer | 70 | 10 |
| 2025 | 235 | 34 | Elsevier | 43 | 6 |
| 2026 | 344 | 50 | MDPI | 26 | 4 |
| Study | Dim. | Setting | Headline finding (as reported) |
| Pearce et al. (2022) | SEC | Copilot; scenarios built around high-risk CWEs | about 40% of programs vulnerable |
| Perry et al. (2023) | SEC | User study; codex-davinci-002 assistant | 36% of assisted vs. 7% of control participants wrote SQL-injectable code |
| Asare et al. (2023) | SEC | Copilot; C/C++ scenarios with known human vulnerabilities | replicates vulnerable code about 33% of the time, the fix at a 25% rate |
| Fu et al. (2025) | SEC | Copilot, CodeWhisperer and Codeium snippets in GitHub projects | weaknesses in 29.5% of Python and 24.2% of JavaScript snippets |
| Vero et al. (2025) | SEC , COR | BaxBench backend-generation tasks | best model (o1) 62% correct; exploits succeed on about half of correct programs |
| Zhao et al. (2026a) | SEC , COR | SusVibes repository tasks; SWE-Agent with Claude 4 Sonnet | 57% functionally correct, 11.8% secure |
| Benchmark | Year | Dim. | Lang. | Size | Oracle / metric | Contam. |
| HumanEval+ ( Liu et al., 2023 ) | 2023 | COR | Py | 164 | amplified tests; pass@ | pub. |
| MBPP+ ( Liu et al., 2023 ) | 2023 | COR | Py | nr | subset of MBPP (974) ( Austin et al., 2021 ) ; pass@ | pub. |
| LiveCodeBench ( Jain et al., 2025 ) | 2024 | COR | Py | 511 | contest tests; pass@1 | date |
| BigCodeBench ( Zhuo et al., 2025 ) | 2024 | COR | Py | 1,140 | library-call tests; pass@1 | – |
| SWE-bench Verified ( Jimenez et al., 2024 ; Vals AI, 2026 ) | 2024 | COR | Py | 500 | repo tests; resolve rate | pub. |
| SWE-bench Pro ( Deng et al., 2026b ) | 2025 | COR | multi | 1,865 | repo tests; resolve rate | held-out |
| Benchmark | Year | Lang. | Size | Oracle / metric | Contam. | |
| Asleep at the Keyboard ( Pearce et al., 2022 ) | 2021 | C/Py | 89 | CodeQL + manual; CWE | pub. | |
| SecurityEval ( Siddiq and Santos, 2022 ) | 2022 | Py | 121 | static analyzers; no tests ( Siddiq et al., 2024b ) | pub. | |
| LLMSecEval ( Tony et al., 2023 ) | 2023 | C/Py | 150 | CodeQL | pub. | |
| CyberSecEval ( Bhatt et al., 2023 ) | 2023 | multi | nr | ICD rules (189); v3 ( Wan et al., 2024 ) | pub. | |
| CodeLMSec ( Hajipour et al., 2023 ) | 2023 | C/Py | nr | non-secure prompts found by few-shot model inversion | pub. | |
| PythonSecurityEval ( Alrashedy et al., 2023 ) | 2023 | Py | 470 | Bandit, CodeQL | pub. |
| Family (releases) | Released | OW | Arch. | Vendor-reported coding scores | Cutoff | NF |
|---|---|---|---|---|---|---|
| Anthropic. Claude Sonnet 3.7; Opus 4, 4.1, 4.5; Sonnet 4, 4.5; Haiku 4.5 | 2025-02–11 | N | nr | Sonnet 4.5: SWE-V 77.2% | Jul 2025 | nr |
| Opus 4.6, 4.7, 4.8, 5; Sonnet 4.6, 5; Fable 5 (with Mythos 5) ( Anthropic, 2026h ) | 2026-02–07 | N | nr | Fable 5: SWE-V 95%; SWE-P 80% | Jan 2026 | nr |
| Fable 5.1 (with Mythos 5.1); Opus 5.5; Sonnet 5.5; Haiku 5.5 ( Anthropic, 2026d ; Anthropic, 2026f ) | 2026-09–10 | N | nr | Opus 5.5: TB 4.0 66.4%; FC 54.4% | Jun 2026 | FC |
| OpenAI. o3-mini; GPT-4.5; GPT-4.1; o3, o4-mini; codex-1 ( OpenAI, 2025h ) | 2025-01–05 | N | nr | GPT-4.1: SWE-V 54.6%; Aider Polyglot 52.9% | June 2024 | Edit |
| gpt-oss-120b, gpt-oss-20b ( OpenAI et al., 2025 ) | 2025-08 | Y | MoE, 116.8B / 5.1B | 120b (high): SWE-V 62.4 | June 2024 | nr |
| GPT-5; GPT-5-Codex; GPT-5.1, 5.1-Codex-Max; GPT-5.2, 5.2-Codex | 2025-08–12 | N | nr | GPT-5.2 Thinking: SWE-P 55.6%; SWE-V 80.0% | Aug 31, 2025 | nr |
| (a) API-served models | ||||||||
| Op | oss | |||||||
| Technique | ||||||||
| COR HumanEval+ pass@1 (%, higher is better) | ||||||||
| T0 single shot | 96.40 | – | – | – | 81.27 | – | – | – |
| T1 quality instr. | 97.64 | 99.10 | 98.75 | 99.22 | 80.08 | 83.17 | 82.91 | 85.68 |
| T2 SCoT | 92.15 | 91.41 | 91.99 | 90.34 | 81.31 | 85.31 | 85.98 | 88.45 |
| Op | oss | G31 | G26 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Metric | SD | SD | SD | SD | |||||||||
| HE+ pass@1 | 1.29 | 1.34 | 0.45 | 4.24 | 4.34 | 0.46 | 2.77 | 2.96 | 0.42 | 3.65 | 4.02 | 0.42 | |
| LCB pass@1 | – | – | – | 4.29 | 3.63 | 0.46 | 5.83 | 5.59 | 0.36 | 7.67 | 7.40 | 0.46 | |
| LCBP pass@1 | 5.39 | 6.04 | 0.40 | 5.68 | 5.80 | 0.45 | 6.24 | 6.18 | 0.39 | 6.15 | 5.69 | 0.30 | |
| DS pass@1 | 6.91 | 6.24 | 0.39 | 5.62 | 5.49 | 0.28 | 5.27 | 6.18 | 0.45 | 4.04 | 4.83 | 0.47 | |
| C% | 3.10 | 2.93 | 0.32 | 3.12 | 3.35 | 0.44 | 2.30 | 2.84 | 0.40 | 3.34 | 3.36 | 0.38 | |
| ID | Technique | EP | LCB | LCBP | CWE | CSE | EB | DPS | RM |
|---|---|---|---|---|---|---|---|---|---|
| H01 | SCoT prompting | 2.93 | 5.88 | 5.42 | 8.04 | 2.83 | 0.16 | 2.74 | 0.42 |
| H02 | Self-planning | 2.41 | 6.74 | 5.62 | 7.04 | 2.94 | 0.18 | 4.04 | 0.40 |
| H03 | LLM4EFFI | 2.62 | 4.74 | 5.21 | 5.67 | 3.81 | 0.18 | 2.70 | 0.34 |
| H04 | Code2API | 2.73 | 4.70 | 5.39 | 5.95 | 2.86 | 0.25 | 3.42 | 0.25 |
| H05 | MPCO | 2.68 | 6.74 | 4.49 | 6.22 | 3.65 | 0.21 | 3.49 | 0.29 |
| H06 | BRACE | 2.95 | 5.95 | 6.53 | 5.88 | 2.92 | 0.23 | 3.29 | 0.36 |
| Technique, model | ||||
| T7 best-of- , Op | 71.03, 73.89, 79.63 (74.85) | 77.21, 78.92, 78.38 (78.17) | 70.91, 74.90, 77.48 (74.43) | 85.67, 85.28, 87.92 (86.29) |
| T1 quality instr., Op | 63.89, 67.07, 67.10 (66.02) | 64.05, 65.03, 71.53 (66.87) | 74.54, 78.33, 80.95 (77.94) | 84.19, 80.40, 87.35 (83.98) |
| T7 best-of- , G31 | 48.05, 51.13, 49.26 (49.48) | 55.03, 52.30, 58.93 (55.42) | 52.31, 50.72, 52.37 (51.80) | 43.80, 45.67, 50.57 (46.68) |
| T10 RL, G26 | 49.42, 42.87, 50.00 (47.43) | 49.32, 53.58, 56.73 (53.21) | 48.19, 53.03, 52.17 (51.13) | 56.41, 51.18, 60.74 (56.11) |
| Op | oss | G31 | G26 | |||||||||
| Technique | CC | J | J2 | CC | J | J2 | CC | J | J2 | CC | J | J2 |
| T0 single shot | 7.68 | 4.30 | 3.66 | 10.72 | 3.55 | 3.20 | 9.83 | 3.74 | 3.35 | 9.69 | 3.96 | 3.44 |
| T1 quality instr. | † | † | ||||||||||
| T2 SCoT | † | † | ||||||||||
| T6 RAG | ||||||||||||
| (a) Maintainability, RACE R/M and NoFunEval | ||||||||
| Op | oss | G31 | G26 | |||||
| Technique | LOC | Mnt | LOC | Mnt | LOC | Mnt | LOC | Mnt |
| T0 single shot | 31.2 | 0.67 | 44.7 | 1.31 | 38.2 | 1.01 | 39.2 | 1.13 |
| T1 quality instr. | 36.1 | 0.72 | 49.6 | 1.35 | 43.8 | 1.08 | 45.4 | 1.29 |
| T2 SCoT | 34.5 | 0.65 | 44.9 | 1.21 | 38.0 | 0.90 | 40.3 | 1.01 |
| T3 analyzer loop | 34.2 | 0.27 | 44.8 | 0.51 | 37.6 | 0.38 | 40.4 | 0.44 |
| Experiment | Tasks per model | Models | Per task and seed | Seeds | Call-eq. | Requests |
| Main grid (E2–E8) | 2,632 (Op: 2,552, no LCB) | 4; T8–T10 on 2 | 161.5; +85 (T8–T10) | 3 | 6,404 | 3,121 |
| Extended grid (E9) | 2,552 | 9 | 23.9 (T0, T1–T7 at ) | 3 | 1,647 | 994 |
| Agent benchmarks (E2b) | 113 DeepSWE + 1,037 other | 13 | 25 runs (DeepSWE; +11 on the Gemma pair); 1 run (other) | 3 | 158 runs | 5,819 |
| Head-to-head (E12) | 3,988 | 1 | 280.6 (66 techniques at 3.9 mean calls, T0, best-of- , best-of-2/3/5/8) | 3 | 3,357 | 2,887 |
| Judges | 417k outputs | 2 judges | 1 | – | 834 | 834 |
| Fidelity checks and reruns | authors’ settings | – | – | – | 34 | 34 |
| Experiment | Calls | In tok. | Out tok. | Claude | Vercel | Fireworks | Total |
| Main grid (E2–E8) | 3,121 | 3,910 | 2,747 | 25,269 | – | 1,791 | 27,060 |
| Extended grid (E9, function level) | 994 | 986 | 746 | – | 5,304 | 1,495 | 6,799 |
| Agent benchmarks (E2b, agent table) | 5,819 | 52,911 | 1,833 | 7,288 | 7,659 | 5,433 | 20,380 |
| Head-to-head (E12) | 2,887 | 3,109 | 1,351 | – | – | 1,136 | 1,136 |
| Judges and manual-rating support | 834 | 1,213 | 172 | 5,056 | 2,853 | – | 7,909 |
| Fidelity checks and reruns | 34 | 59 | 18 | 1,046 | – | – | 1,046 |
| COR | R/M | EFF | SEC | ||||||
| Model | Cutoff | LCBP | Lint | J | DPS | Bey | FS | SP | B/k |
| Claude Opus 5.5 | Jun 2026 | 69.82 | 21.37 | 4.30 | 78.06 | 75.03 | 74.85 | 58.54 | 3.40 |
| GPT-6.1 Sol | Apr 2026 | 66.79 | 22.56 | 4.19 | 76.32 | 72.76 | 72.79 | 57.39 | 3.59 |
| Gemini 4 Argon | Mar 2026 | 67.43 | 21.08 | 4.34 | 80.36 | 76.19 | 73.72 | 56.22 | 3.39 |
| Kimi K3 | nr | 55.31 | 24.34 | 4.12 | 78.22 | 76.30 | 69.43 | 49.11 | 3.80 |
| GLM-5.3 | nr | 57.50 | 23.51 | 4.09 | 77.77 | 73.07 | 68.74 | 50.66 | 3.81 |
| Technique | LCBP | Lint | DPS | FS |
|---|---|---|---|---|
| GPT-6.1 Sol | ||||
| T0 single shot | 66.79 | 22.56 | 76.32 | 72.79 |
| T1 quality instr. | 63.66 | 21.84 | 77.78 | 72.74 |
| T2 SCoT | 70.69 | 20.72 | 82.16 | 69.89 |
| T3 analyzer loop | 67.35 | 8.30 | 80.15 | 81.37 |
| T4 Self-Refine | 65.24 | 20.80 | 80.05 | 68.92 |
| COR | R/M | EFF | SEC | ||||||
| Model | DS | TB | FC | FC c | Er | GSO | SWf | SV s | SV f |
| Claude Opus 5.5 | 75.17 | 61.79 | 53.08 | 59.20 | 0.33 | 21.19 | 53.87 | 56.52 | 94.58 |
| GPT-6.1 Sol | 76.59 | 55.51 | 49.12 | 56.49 | 0.36 | 17.81 | 51.19 | 50.11 | 90.18 |
| Gemini 4 Argon | 76.38 | 57.28 | 46.86 | 54.45 | 0.35 | 19.54 | 51.74 | 47.73 | 91.29 |
| Kimi K3 | 65.47 | 35.29 | 44.63 | 49.56 | 0.41 | 16.15 | 45.26 | 42.18 | 84.37 |
| GLM-5.3 | 71.95 | 41.97 | 40.07 | 45.34 | 0.38 | 15.68 | 47.90 | 44.09 | 83.21 |
| ID | Technique | EP | LCB | LCBP | CWE | CSE | EB | DPS | RM | Calls |
|---|---|---|---|---|---|---|---|---|---|---|
| – | T0 single shot (reference) | 93.83 | 69.91 | 27.14 | 47.85 | 32.59 | 2.64 | 79.37 | 6.83 | 1 |
| – | best-of- (reference) | 89.97 | 73.42 | 30.92 | 57.07 | 26.55 | 2.87 | 82.42 | 7.69 | 4.19 |
| Prompting | ||||||||||
| H01 | SCoT prompting | 88.04 | 72.97 | 30.03 | 51.24 | 28.34 | 2.78 | 73.72 | 7.87 | 1.93 |
| H02 | Self-planning | 83.45 | 71.26 | 28.82 | 51.84 | 29.38 | 2.85 | 82.02 | 6.77 | 2.10 |
| H03 | LLM4EFFI | 94.51 | 75.79 | 31.59 | 48.79 | 31.12 | 2.44 | 76.28 | 6.86 | 4.10 |
| ID | Technique | Setting (metric; benchmark; model) | Original | Reproduced |
|---|---|---|---|---|
| H01 | SCoT prompting | Maintainability, human rating (0-2); 200 programs from HumanEval, MBPP, MBCPP; ChatGPT gpt-3.5-turbo-0301 (closed) | n.c. | – |
| H02 | Self-planning | Readability, human rating (0-4, violin plot only); 50 HumanEval tasks; code-davinci-002 (175B, closed) | n.c. | – |
| H03 | LLM4EFFI | eff@1; ENAMEL (142 HumanEval problems); DeepSeek-V3 (open) | 60.41 | 60.94 |
| H04 | Code2API | Method-name expressiveness, human rating (1-4); APIzator set (200 Stack Overflow Java snippets); GPT-3.5-turbo (closed) | n.c. | – |
| H05 | MPCO | Average statistical rank of mean %PI (lower is better); 5 projects, 50 hotspots; GPT-4o, Gemini 2.5 Pro, Claude 3.7 Sonnet (closed) | n.c. | – |
| H06 | BRACE | CWEval Sec pass@10, mean of 6 models; CWEval (119 tasks); Qwen3-8B/14B, Qwen3.6-27B, Gemma-3-4B/12B, Gemma-4-31B (open) † | 75.77 | 72.35 |
| COR \ target | mixed | nr | total | |||
| 102 | 0 | 0 | 14 | 10 | 126 | |
| 18 | 1 | 0 | 1 | 0 | 20 | |
| 12 | 1 | 1 | 9 | 0 | 23 | |
| mixed | 30 | 0 | 1 | 13 | 1 | 45 |
| nr | 58 | 1 | 2 | 13 | 6 | 80 |
| total | 220 | 3 | 4 | 50 | 17 | 294 |
| Family | Studies | Non-targeted dim. measured | COR measured | ||
| % | % | ||||
| Prompting | 58 | 9 | 16 | 40 | 69 |
| Tool feedback | 43 | 4 | 9 | 32 | 74 |
| Self-refinement | 6 | 1 | 17 | 5 | 83 |
| Multi-agent | 20 | 1 | 5 | 17 | 85 |
| Retrieval | 15 | 1 | 7 | 12 | 80 |
| Family | Med. QA | Comp. % | Cont. % | Human % | Artif. % | |
| Prompting | 58 | 6.5 | 31 | 34 | 34 | 79 |
| Tool feedback | 43 | 6.5 | 49 | 33 | 23 | 74 |
| Self-refinement | 6 | 5.8 | 17 | 67 | 33 | 67 |
| Multi-agent | 20 | 5.5 | 45 | 15 | 10 | 60 |
| Retrieval | 15 | 6.0 | 53 | 53 | 40 | 60 |
| Decoding | 6 | 6.2 | 67 | 17 | 33 | 100 |
| Mechanisms | Studies | Representative studies |
|---|---|---|
| retrieval + self-refinement + tool feedback | 33 | Retrieval Augmented Search ( Anupam et al., 2026 ) ; SCGAgent ( Saul et al., 2025 ) ; ECO ( Kim et al., 2025 ) ; Safety Sidecar ( Wang et al., 2026a ) |
| tool feedback | 27 | LLM4PLC (R00632); RustMap (R02061); LLMigrate (R02100); DeRep (R02183) |
| retrieval + tool feedback | 26 | SBLLM ( Gao et al., 2025b ) ; RAG + multi-tool ( Sriram et al., 2026 ) ; LLM-driven HLS repair framework (R01058); APILOT (R01272) |
| another LLM + tool feedback | 16 | Codexity Preshot Repair ( Kim et al., 2024 ) ; Hybrid pipeline P10 ( Sabir et al., 2026 ) ; CodeEvolve ( Borra et al., 2026 ) ; SecureForge ( Liu et al., 2026a ) |
| retrieval + another LLM + tool feedback | 15 | MARCO ( Rahman et al., 2025 ) ; SysLLMatic ( Peng et al., 2026a ) ; HLSPilot (R01152); VeriOpt (R03540) |
| self-refinement + tool feedback | 13 | CodeChain ( Le et al., 2024a ) ; SecCode ( Liu et al., 2024c ) ; LLM4EFFI ( Ye et al., 2025 ) ; ArchCode (R00592) |
| Study | Strategy | Models; benchmark | Target-dimension effect | COR effect |
| Tony ( Tony et al., 2025 ) | RCI (one critique–improve round) | GPT-3/3.5/4; LLMSecEval, Bandit | SEC : weakness density 77.55% lower (GPT-4) | nr |
| Bruni ( Bruni et al., 2025 ) | Security-aware persona prefix | GPT-4o; LLMSecEval + SecurityEval, Semgrep/CodeQL | SEC : 56% fewer vulnerabilities | HumanEval pass@1 86.77% 86.65% (GPT-4o-mini) |
| Bruni ( Bruni et al., 2025 ) | RCI on baseline code | GPT-4o; as above | SEC : 64.7% fewer vulnerabilities | pass@1 86.77% 76.65% (GPT-4o-mini) |
| Kharma ( Kharma et al., 2026a ) | WA-0CoT (CWE-aware CoT) | 5 LLMs; Java, C++, C, Python | SEC frequency and density; CWE mix shifts; R/M more warnings (C) | nr |
| Urmi ( Urmi et al., 2026 ) | Structured + security guidance | GPT-4o; 424 Python tasks, Bandit/CodeQL | SEC high-severity 20.8% 13.6%; low-severity 32% 43.5% | nr (requested constructs sometimes removed) |
| Pereira ( Pereira and Garcia, 2026 ) | ISO/IEC 25010-grounded requirements | GPT-5.4; HumanEval/ET | R/M unreadability density 0.88 0.69 (performance requirement) | not reliably improved; ET pass rate (error handling) |
| Technique | Year | Cit. | L/R | Core idea | Target | Reported result | COR | Code |
| SCoT ( Li et al., 2025b ) | 2025 | 405 | L | Constrains the chain of thought to sequence, branch and loop structures, then implements code from it. | R/M | Maintainability, human rating 0–2, ChatGPT: CoT 1.616 1.873 | – | |
| Self-planning ( Jiang et al., 2024 ) | 2024 | 306 | L | Few-shot prompts make the model write a concise step plan, then code guided by that plan. | R/M | Readability, human rating: gain reported without numbers ( nr ) | – | |
| LLM4EFFI ( Ye et al., 2025 ) | 2025 | 15 | L | Explores algorithms in a logic domain, optimizes the implementation in a code domain, then verifies with synthetic tests. | EFF | eff@1, ENAMEL, DeepSeek-V3: Effi-Learner 52.22 60.41 | ✓ | |
| Code2API ( Mai et al., 2024 ) | 2024 | 12 | L | Role, chain-of-thought and few-shot prompting turn Stack Overflow snippets into reusable, well-named API methods. | R/M | Method-name expressiveness, human rating 1–4, GPT-3.5: APIzator 2.23 3.65 | mixed | ✓ |
| MPCO ( Gong et al., 2025a ) | 2025 | 10 | L | A meta-prompter LLM writes project-, task- and model-aware code-optimization prompts. | EFF | Mean rank of %PI over five projects (lower is better): contextual prompting 2.00 1.00 | nr | – |
| BRACE ( Xu et al., 2026a ) | 2026 | 1 | R | A separate LLM predicts the task’s likely CWEs; after catalog validation they are given to the target model as a cue. | SEC | Safe Code Rate (judge classifier), CyberNative, open-weight models (avg.): Secure Prompt 33.9% 91.2% | mixed | – |
| Study | Tool(s) | Feedback format | Max iter. | Gate | COR | Lang.; models |
| Blyth et al. (2025) | Bandit, Pylint | inline tags, severity order | 10 | fitness | Py; GPT-4o | |
| Wadhwa et al. (2024) | CodeQL, Sonar | rule + fix advice; ranker | one pass, 10 samples | ranker | review | Py, Java; GPT-3.5/4 |
| Abtahi and Azim (2025) | SonarQube | issue table + RAG | two phases | manual | manual | one project; GPT-3.5/4o |
| Joos et al. (2026) | SonarQube | agent + rejection context | 40 cycles | build, tests | manual | Java; GPT-4.1 mini |
| Islam et al. (2026) | Pylint, Radon, Bandit, … | metric diagnostics | five | none | no | Py; several |
| Ravi et al. (2025) | javac, PMD, tests | errors, violations | five/loop | tests | Java; GPT-4o-mini |
| Study | Setting | Target-dimension effect | COR effect |
| Blyth et al. (2025) | GPT-4o; PythonSecurityEval | insecure 40% 13%; readability viol. 80% 11% | pass@1 38.16% 47.81% |
| Wadhwa et al. (2024) | GPT-3.5/4; CodeQL, Python | pass checks 81.57%; reviewer rejection 55.11% (47.55% ranked) | review only |
| Joos et al. (2026) | GPT-4.1 mini; SonarQube | plausible 96.8%; correct 86.3% | gated |
| Abtahi and Azim (2025) | GPT-3.5 4o; one project | issues 7,599 4,340 1,058 | manual |
| Alrashedy et al. (2023) | GPT-4; PythonSecurityEval | vulnerable: Bandit 40.2% 7.4%; CodeQL 17.9% 7.7% | nr |
| PromSec in ( Dai et al., 2026a ) | GPT-3.5; BigCodeBench | Secure-Pass@1 0.3219 0.2447 | Pass@1 |
| Technique | Year | Cit. | L/R | Core idea | Target | Reported result | COR | Code |
| SBLLM ( Gao et al., 2025b ) | 2025 | 76 | L | Evolves optimized programs: selects representative executed samples, retrieves optimization patterns, combines them with genetic-operator-style prompts. | EFF | SP@5 (%), GPT-4, PIE Python: ICL 181.53 209.59 | ✓ | |
| PerfCodeGen ( Peng et al., 2025b ) | 2025 | 58 | L | After a correctness phase, returns the most time-consuming unit test and asks for a faster program. | EFF | %Opt Best@8, GPT-4, MBPP: base 43.48 56.52 | – | |
| PromSec ( Nazzal et al., 2024 ) | 2024 | 55 | L | A contrastively trained graph GAN repairs the vulnerable code graph; the repaired code is turned into an improved prompt, iteratively. | SEC | nr (CWE counts shown only in plots) | ✓ | |
| DeepDevVuln filter ( Chan et al., 2023 ) | 2023 | 41 | L | A fine-tuned transformer vulnerability detector flags incomplete code; completions it flags are discarded. | SEC | vulnerable scenarios, text-davinci-003: unfiltered 78.00% filtered 8.0% | nr | – |
| FRANC repair ( Siddiq et al., 2024a ) | 2024 | 32 | L | Builds a repair prompt from Bandit or SpotBugs messages (generated-knowledge prompting, three prompt structures) and re-queries the model. | SEC , R/M | prompts with a good suggestion after repair: up to 80%; no pre-repair value | nr | ✓ |
| Optimo ( Peng et al., 2026b ) | 2026 | 0 | R | Differential profiling finds bottlenecks, routed to multi-level, pattern-specific optimization prompts with shared and special strategies and correctness reflection. | EFF | Opt%, GPT-4o code, EffiBench: SBLLM 3.58% 35.79% | ✓ |
| Study (model) | Setting and metric | Before after | COR |
| Self-Refine (GPT-4) | CodeNet rewrite; GPT-4-judged meaningful names ( R/M ) | 27.4 56.2 | nr |
| EffiLearner (StarCoder2-15B) | EffiBench; execution time, s ( EFF ) | 0.93 0.12 | 0% to 0.5% |
| EffiLearner (StarCoder2-15B) | EffiBench; total memory usage, Mb s ( EFF ) | 22.02 2.03 | as above |
| Self-Refine in EffiLearner (CodeLlama-70B) | EffiBench; execution time change ( EFF ) | 51.9% | nr |
| Reflexion + ICD (five open code LLMs) | Instruct Prime; ICD secure rate ( SEC ) | 70.74% 79.43% | nr |
| Technique | Year | Cit. | L/R | Core idea | Target | Reported result | COR | Code |
| Self-Refine ( Madaan et al., 2023 ) | 2023 | 5050 | L | One LLM alternates between feedback on its own output and refinement using that feedback, for several iterations. | EFF | % programs optimized, PIE, GPT-4: no refinement 27.3 36.0 | nr | ✓ |
| CodeChain ( Le et al., 2024a ) | 2024 | 91 | L | Modular chain of thought, then self-revisions conditioned on clustered representative sub-modules from earlier samples. | R/M | Modularity and reusability, GPT-4 Likert rating, 20 APPS tasks: shown only as a figure ( nr ) | ✓ | |
| SecCode ( Liu et al., 2024c ) | 2024 | 8 | L | Score-based “encouragement” prompts drive repeated vulnerability detection and fixing, cross-checked with CodeQL. | SEC | Fix success rate after ten iterations, LEval, GPT-3.5: CoT 0.64 0.96 | – | |
| RefleXGen ( Wang et al., 2025a ) | 2025 | 7 | L | Self-reflection on code security; reflections and secure snippets accumulate in a knowledge base retrieved for later tasks. | SEC | CodeQL security rate, SVEN scenarios, GPT-3.5 Turbo: base 75.5 89.1 | mixed | – |
| GRASP ( Patir et al., 2025 ) | 2025 | 4 | L | Revises a seed solution by traversing a dependency graph (DAG) of the relevant secure coding practices. | SEC | CodeQL security rate, 37 Python scenarios, GPT-4o: PromSec 0.52 0.79 | mixed | – |
| Safety Sidecar ( Wang et al., 2026a ) | 2026 | 1 | R | A lightweight self-check routes risky code to a reflective prompt fed by a memory of past secure repairs. | SEC | CodeQL security rate, SVEN scenarios, GPT-4o: base agent 85.7 95.0 | mixed | – |
| Technique | Year | Cit. | L/R | Core idea | Target | Reported result | COR | Code |
| SecAwareCoder ( Wang et al., 2026e ) | 2026 | 54 | L | Task-adaptive threat modeling yields vulnerability hypotheses that guide constraint-aware generation and security-test synthesis; execution feedback drives repair. | SEC | S-Pass@1, CodeSecEval, GPT-5: CoT 27.45 34.90 | ✓ | |
| FlowGen ( Lin et al., 2025b ) | 2025 | 51 | L | Agents in requirement-engineer, architect, developer, tester and scrum-master roles emulate Waterfall, TDD or Scrum, with self-refinement. | R/M | Pylint error-smell density, GPT-3.5: 81.8% to 96.0% lower than RawGPT | ✓ | |
| INDICT ( Le et al., 2024b ) | 2024 | 4 | L | A safety critic and a helpfulness critic, grounded in web search and code execution, give preemptive and post-hoc feedback to the coder. | SEC | Safety, CyberSecEval-1 split, GPT-4o-mini: direct 78.2 90.9 | nr | ✓ |
| ContextEvolve ( Su et al., 2026 ) | 2026 | 2 | R | Summarizer, Navigator and Sampler agents compress evolutionary-search context into semantic state, optimization direction and retrieved exemplars. | EFF | ADRS combined score vs. top baseline: 6.5% higher on average | ✓ | |
| Just-in-time remediation (P1) ( Surikov, 2026 ) | 2026 | 0 | R | A validator LLM reviews generated code; its findings, enriched with ATT&CK techniques, CWE examples and best practices, drive remediation. | SEC | CodeQL+Bandit findings per sample, four Claude models pooled: initial 1.34 0.78 | nr | ✓ |
| LessonL ( Liu et al., 2025c ) | 2025 | 0 | R | Agents solicit lessons from each other’s successes and failures, bank them, and select relevant lessons for later rounds. | EFF | Geometric-mean speedup, ParEval serial: Reflexion (Qwen14B) 1.88 2.16 | ✓ |
| Method | Retrieved unit | Models; benchmark | Target-dimension effect | COR effect |
| SecCoder ( Zhang et al., 2024a ) | Secure demonstrations | CodeGen, SantaCoder, InCoder; CodeQL | SEC 7.20% avg. on unseen cases | “almost the same” |
| RESCUE ( Shi and Zhang, 2026 ) | Distilled guidelines, sliced examples | 6 LLMs; 4 benchmarks | SEC SecurePass@1 4.8 points | comparable |
| SEEK ( Gadey et al., 2026 ) | CWE-graph fix instances | 5 open LLMs; CodeGuard+ | SEC SecurePass@1 77.45% | in SecurePass@1 |
| SOSecure ( Mukherjee and Hellendoorn, 2026 ) | Stack Overflow critiques (post-draft) | GPT-4; LLMSecEval | SEC fix rate 91.3% vs. 56.5% | nr |
| A3-CodGen ( Liao et al., 2024 ) | Local functions | GPT-3.5; 13,784 PyPI functions | R/M reuse F1 0.589 (vanilla 0) | nr |
| Technique | Year | Cit. | L/R | Core idea | Target | Reported result | COR | Code |
| PIE dynamic retrieval ( Shypula et al., 2024 ) | 2024 | 171 | L | Retrieves the slow–fast program pairs most similar to the input and uses them as few-shot examples for optimization. | EFF | Speedup (Best@8), PIE, CodeLlama 34B: CoT 1.30 2.28 | mixed | ✓ |
| LAIL ( Li et al., 2025c ) | 2025 | 92 | L | Labels candidate examples by how much they raise the LLM’s likelihood of the reference program; trains a contrastive retriever on these labels. | R/M | Human code-quality score: best example selector 1.738 1.839 | – | |
| KPC ( Ren et al., 2023 ) | 2023 | 50 | L | Builds an exception-handling knowledge base from Java API documentation; chained prompts check generated code for unhandled exceptions and rewrite it. | R/M | Good exception-handling practice (manual review), GPT-3.5: direct 14.58% 98.86% | ✓ | |
| RAPGen ( Garg et al., 2025 ) | 2025 | 36 | L | Retrieves an instruction from a knowledge base of past performance-bug fixes and builds a zero-shot fix prompt from it. | EFF | Expert-judged closest-match top-100 accuracy, C# fixes, GPT-3.5: reasoning prompt 43.2 60.6 | nr | – |
| CodeGuarder ( Lin et al., 2025a ) | 2025 | 30 | L | Decomposes the query into sub-tasks, retrieves root causes and secure samples, re-ranks by model susceptibility, injects them into the prompt. | SEC | Security rate, CyberSecEval, average over LLMs: RACG without security knowledge 60.84 73.08 | – | |
| RAS ( Anupam et al., 2026 ) | 2026 | 6 | R | Beam search over candidate optimizations; slow–fast exemplars are retrieved by an LLM-written natural-language description of the program. | EFF | Average speedup, PIE, Qwen3-Coder: dynamic retrieval 4.23 8.70 | ✓ |
| Method | Dim. | Setting (model; benchmark; metric) | Reported |
| Type-constrained ( Mündler et al., 2025 ) | COR | 2B–34B; HumanEval (TypeScript); compiler-error reduction | 74.8% |
| MRepE ( Gao et al., 2026 ) | R/M | DeepSeek-R1 14B; MBPP; correctness loss | 0.79% |
| CodeT ( Chen et al., 2023 ) | COR | code-davinci-002; HumanEval; pass@1 | 65.8% |
| S* ( Li et al., 2025a ) | COR | R1-Distill-Qwen-32B; LiveCodeBench; accuracy | 85.7% |
| Technique | Year | Cit. | L/R | Core idea | Target | Reported result | COR | Code |
| PG-TD, length reward ( Zhang et al., 2023b ) | 2023 | 272 | L | Tree search during decoding; replacing the test reward with a length penalty or comment reward controls code style. | R/M | code length, APPS: default reward 248.42 length penalty 190.73 | ✓ | |
| Constrained beam sampling ( Fu et al., 2024 ) | 2024 | 61 | L | Beam sampling with hand-written positive and negative key-phrase constraints per prompt, enforcing secure API patterns. | SEC | secure-pass@1, CodeGen-2.7B, CodeGuard+: beam 33.77 51.25 | mixed | ✓ |
| RPG ( Dong et al., 2025b ) | 2025 | 15 | L | A grammar-based pushdown automaton detects structural repetition during decoding and decays the likelihood of tokens causing it. | R/M | TR-S (lower is better), real-world repos: greedy 0.631, repetition penalty 0.358, RPG 0.335 | ✓ | |
| Surprisal-guided selection ( Barnes, 2026 ) | 2026 | 1 | R | Among correct samples, keeps the one with the highest surprisal (lowest model confidence) instead of the most confident. | EFF | fast and correct, GPT-OSS-120B, KernelBench L1 subset: most confident 50% 80% | nr | – |
| DuoSteer ( Yan and Yao, 2026 ) | 2026 | 0 | R | Adds safety and correctness steering vectors at causally identified attention heads during inference. | SEC | vulnerability rate, Llama-3.1-8B-Instruct, five CWEs: average change 26.9% vs. unsteered | ✓ | |
| FunPRM ( Zhang et al., 2026 ) | 2026 | 4 | R | Prompts for code written function by function, treats each function as a step, and selects best-of- with a meta-corrected process reward model. | R/M | readability preference, Qwen2.5-7B-Coder, correct pairs: base 45.8 vs. FunPRM 54.2 | – |
| Method | Signal | Base model | Target effect | COR effect |
| HexaCoder | SFT (CodeQL) | four LLMs | SEC up to 85% fewer vulnerable a (3 benchmarks) | b |
| ProSec | PO (CWE tasks) | several code LLMs | SEC 25.2%–35.4% vs. SafeCoder data (PurpleLlama) | b |
| PurpCode | SFT+RL | Qwen2.5-32B | SEC 12% over next best (CyberSecEval) | b |
| SecCoderX | RL (learned RM) | CodeLlama-7B, Qwen2.5-Coder | SEC COR ESR about 10% | in ESR |
| PIE | SFT (gem5) | GPT-3.5 | EFF 6.86 speedup, best of 8 (PIE) | filtered |
| EffiCoder | SFT (profiler) | Qwen2.5-Coder-7B-Instr. | EFF time 48.4% lower (EffiBench) | 44.8% 57.7% |
| Technique | Year | Cit. | L/R | Core idea | Target | Reported result | COR | Code |
| SVEN ( He and Vechev, 2023 ) | 2023 | 337 | L | Learns property-specific prefixes with region-specific losses on vulnerability-fix diffs; LM weights unchanged. | SEC | Secure rate, CodeGen-2.7B: original LM 59.1% 92.3% | mixed | ✓ |
| SafeCoder ( He et al., 2024 ) | 2024 | 110 | L | Joint standard and security instruction tuning; masked likelihood on secure code, masked unlikelihood on vulnerable code. | SEC | Code security, StarCoder-1B: standard instr. tuning 62.9 92.1 | ✓ | |
| CodeUltraFeedback ( Weyssow et al., 2026 ) | 2026 | 81 | L | GPT-3.5 judge rates responses of many LLMs on five coding preferences; SFT then DPO on the ratings. | R/M , EFF (judged) | Judge score, complexity/efficiency, CodeLlama-7B-Instr.: base 6.16 7.89 | ✓ | |
| CodeDPO ( Zhang et al., 2025a ) | 2025 | 63 | L | Ranks self-generated code and tests by PageRank-style mutual validation, adds fastest-versus-slowest pairs, trains with DPO. | EFF | Mean time (s), HumanEval+, commonly solved: before 0.250 0.172 | ✓ | |
| Afterburner ( Du et al., 2025 ) | 2025 | 20 | R | GRPO with execution-time rewards inside an iterative optimization loop that feeds back measured performance. | EFF | Beyond-I, Venus, Qwen2.5-3B: 31% 45% | ✓ | |
| PurpCode ( Liu et al., 2025a ) | 2025 | 23 | R | Rule-learning SFT on safety rules, then GRPO with multi-objective rewards from code analyzers, tests and a learned verifier. | SEC | Secure code, CodeLMSec, Qwen2.5-32B: base 29.2 94.8 | ✓ |
| Study | Scope | Dims | Technique coverage | Exp. | Years | Studies |
| Hou et al. (2024) | LLMs for software engineering | – | Model use, data, tuning, evaluation by task | no | 2017–2024 | 395 |
| Jiang et al. (2026) | LLM code generation | – | Data, training, prompting, retrieval, agents | no | nr | 235 |
| Dong et al. (2025a) | LLM-based code generation agents | – | Single- and multi-agent architectures | no | 2022–2025 | nr |
| Yang et al. (2024c) | Non-functional properties of code models | SEC ; efficiency of models, not code | Evaluation and enhancement methods per property | no | nr | 146 |
| Kamoi et al. (2024) | Self-correction of LLMs (all tasks) | – | Intrinsic and external feedback, fine-tuning | no | nr | nr |
| Chochlov et al. (2026) | Secondary studies of LLM code generation (tertiary) | – | Effects, scenarios, integration challenges | no | 2017–2025 | 30 |
LLM Code Generation
Large language model code generation studies how models translate instructions and context into executable programs and how to make them reliable.
See all 314 papers