Research map / Large language models / Reasoning and chain of thought
Let's Revise Step-by-Step: A Unified Local Search Framework for Code Generation with LLMs
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Proposes ReLoc, a unified local search framework for LLM code generation that iteratively revises code, guided by a revision reward model trained on revision-distance preference pairs, instantiated as Hill Climbing and Genetic Algorithm.
Problem
Inference-time scaling for LLM code generation is inefficient: construction-based tree search grows rapidly in token cost and lacks anytime behavior, while existing improvement-based methods rely on uninformative rewards (sparse public-test pass rates or unreliable self-evaluation) and costly search
Approach
Frame iterative code revision as a local search with four components (drafting, neighborhood generation, candidate evaluation, incumbent update), and score candidates with a revision reward model trained with Bradley-Terry on pairs ranked by revision distance (minimum revisions to a correct program) within local code-tree neighborhoods.
Key results
- ReLoc_HC reaches 38.4% Pass@1 on LiveCodeBench code generation vs 33.8% for the strongest baseline under a 7K token budget.
- ReLoc_GA reaches 15.3% Pass@1 on TACO code generation vs 11.5% for the strongest baseline.
- The revision reward model outperforms ORM-7B as a guidance signal for ReLoc_HC (38.4% vs 35.9% on LiveCodeBench; 13.3% vs 9.7% on TACO).
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| use ReLoc_HC instead of Plan Search | Qwen2.5-32B-Instruct · LiveCodeBench code gen | Pass@1 (%): 32.7 -> 38.4 | Helped |
| use ReLoc_HC instead of Plan Search | Qwen2.5-32B-Instruct · LiveCodeBench code repair | Pass@1 (%): 31.3 -> 33.4 | Helped |
| use ReLoc_GA instead of Plan Search | Qwen2.5-32B-Instruct · TACO code gen | Pass@1 (%): 11.2 -> 15.3 | Helped |
| use ReLoc_GA instead of Plan Search | Qwen2.5-32B-Instruct · TACO code repair | Pass@1 (%): 8.2 -> 11.5 | Helped |
| replace ORM with the revision reward model | ReLoc_HC · LiveCodeBench | Pass@1: 35.9 -> 38.4 | Helped |
| replace ORM with the revision reward model | ReLoc_HC · TACO | Pass@1: 9.7 -> 13.3 | Helped |
| remove natural language plans from initialization (ablation) | ReLoc_HC · LiveCodeBench | Pass@1 (%): 38.4 -> 36.9 | Hurt |
| remove natural language plans from initialization (ablation) | ReLoc_HC · TACO | Pass@1 (%): 13.3 -> 13.7 | No clear effect |
| remove revision strategies (ablation) | ReLoc_HC · LiveCodeBench | Pass@1 (%): 38.4 -> 35.9 | Hurt |
| remove revision strategies (ablation) | ReLoc_HC · TACO | Pass@1 (%): 13.3 -> 11.7 | Hurt |
| remove execution feedback (ablation) | ReLoc_HC · LiveCodeBench | Pass@1 (%): 38.4 -> 34.8 | Hurt |
| remove execution feedback (ablation) | ReLoc_HC · TACO | Pass@1 (%): 13.3 -> 11.4 | Hurt |
Surprising findings
- Removing revision strategies cut tokens sharply (7.1K to 4.7K) but lowered accuracy, indicating diversity from strategies matters more than cost savings.
- A reward model trained on Qwen2.5-32B-generated trajectories transferred to guide search with GPT-4o, reaching 44.2% Pass@1 with 8.7K tokens.
Limitations
- Experiments use a fixed 7K token budget and a subset of TACO (200 test problems), limiting statistical power.
- Revision distance labels depend on the sampled code tree and a finite depth limit (d_max=5, K=3).
- The reward model is trained on data from the same family of models and benchmarks used for evaluation, with limited cross-benchmark testing beyond the GPT-4o appendix.
Experimental setup
Datasets: LiveCodeBench TACO APPS CodeContests
Benchmarks: LiveCodeBench TACO
Metrics: Pass@1 token consumption
Baselines: RAP ToT Code Tree Reflexion Plan Search BoN SFS ORPS Skywork-27B reward model ORM-7B
Builds on: Bradley-Terry reward modeling Tree of Thoughts Reflexion Plan Search Best-of-N sampling
Closest papers by meaning
- Planning in Natural Language Improves LLM Search for Code Generation (ICLR 2025 · similarity 0.89)
- How efficient is LLM-generated code? A rigorous & high-standard benchmark (ICLR 2025 · similarity 0.89)
- Code Repair with LLMs gives an Exploration-Exploitation Tradeoff (NeurIPS 2024 · similarity 0.88)
- RPM-MCTS: Knowledge-Retrieval as Process Reward Model with Monte Carlo Tree Search for Code Generation (AAAI 2026 · similarity 0.88)
- EffiCoder: Enhancing Code Generation in Large Language Models through Efficiency-Aware Fine-tuning (ICML 2025 · similarity 0.88)
- CodeChain: Towards Modular Code Generation Through Chain of Self-revisions with Representative Sub-modules (ICLR 2024 · similarity 0.87)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
