atlas

Research map / Large language models / Agents, code and math

Planning in Natural Language Improves LLM Search for Code Generation

ICLR 2025 · Large language models › Agents, code and math · approach: LLM-guided program synthesis · 1 citations (OpenAlex)

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 PlanSearch, which searches over diverse natural-language plans (observations combined into ideas) before generating code, improving pass@k on LiveCodeBench, HumanEval+, and MBPP+ over repeated sampling.

Problem

LLM inference-time search for code generation is inefficient because models repeatedly sample highly similar, incorrect solutions, lacking output diversity.

Approach

Search over diverse natural-language plans (generated observations combined over subsets, then turned into ideas and code) rather than directly over code, which increases idea-level diversity and thus pass@k; diversity score predicts search gains.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Search over observation-derived natural-language plans instead of repeatedly sampling codeClaude-Sonnet-3.5 · LiveCodeBenchpass@200: 55.6 -> 77.0Helped
Search over observation-derived natural-language plans instead of repeatedly sampling codeClaude-Sonnet-3.5 · HumanEval+pass@200: 88.9 -> 98.5Helped
Search over observation-derived natural-language plans instead of repeatedly sampling codeClaude-Sonnet-3.5 · MBPP+pass@200: 83.0 -> 93.7Helped
Use PlanSearch rather than IdeaSearchGPT-4o-mini · LiveCodeBenchpass@200: 59.4 -> 64.9Helped
Use PlanSearch rather than IdeaSearchGPT-4o · HumanEval+pass@200: 97.6 -> 99.5Helped
Use PlanSearch rather than IdeaSearchDeepSeek-Coder-V2 · MBPP+pass@200: 89.1 -> 92.6Helped
Use PlanSearch rather than repeated samplingo1-mini · LiveCodeBenchpass@200: 90.8 -> 91.3Helped
Apply public test filtering to PlanSearchClaude-Sonnet-3.5 · LiveCodeBenchpass@20: 77.1%Helped
Increase maximum observation subset size from 2 to 3 (ablation)PlanSearch · LiveCodeBenchpass@kNo clear effect
Increase the number of observation-tree layers (ablation)PlanSearch · LiveCodeBenchpass@kHelped
Remove the translation step that converts observation combinations to code (ablation)PlanSearch · LiveCodeBenchpass@kHurt
Skip pseudocode translation (ablation)PlanSearch · LiveCodeBenchpass@kMixed

Surprising findings

Limitations

Experimental setup

Datasets: LiveCodeBench HumanEval+ MBPP+

Benchmarks: LiveCodeBench HumanEval+ MBPP+

Metrics: pass@k pass@1 diversity score

Baselines: Repeated Sampling IdeaSearch Chain-of-Thought o1-mini repeated sampling

Builds on: repeated sampling chain-of-thought Tree of Thoughts best-of-n sampling

Closest papers by meaning

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.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy