atlas

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

Code Repair with LLMs gives an Exploration-Exploitation Tradeoff

NeurIPS 2024 · Large language models › Agents, code and math · approach: Code generation benchmarks · 4 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 REx, a Thompson-sampling bandit policy for LLM code refinement that trades off exploiting high-pass-rate programs against exploring less-refined ones, reducing LLM calls on loop invariant, ARC, and APPS tasks.

Problem

Iterative LLM code refinement needs a search policy over the infinite tree of refined programs; prior work uses greedy or breadth-first expansion, which yields marginal gains over i.i.d. sampling.

Approach

Frame refinement as an arm-acquiring bandit where each program is an arm, and apply Thompson Sampling with Beta priors biased by the pass-rate heuristic and penalized by the number of prior refinements (REx), avoiding MCTS rollouts and tree traversal.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use REx instead of G-CLNNLA loop invariant synthesis · NLA loop invariant benchmarktotal correct: 24 -> 28Helped
Use REx instead of Loopy-GPT4NLA loop invariant synthesis · NLA loop invariant benchmarktotal correct: 11 -> 28Helped
Use REx instead of GSpacerNLA loop invariant synthesis · NLA loop invariant benchmarktotal correct: 5 -> 28Helped
Use REx instead of the specialized solverNonlinear loop invariant synthesis · Nonlinear loop invariantssuccess rate: 60.5% -> 73.7%Helped
Use REx rather than the alternativesCode refinement across APPS-Competition · APPS-CompetitionLLM calls: 2×Helped
Use REx rather than the alternativesCode refinement for loop invariants · Loop invariantsLLM calls: 2-5×Helped
Use REx rather than the alternativesVisual reasoning code refinement · ARCLLM calls: 1.1-1.6×Helped
Use REx rather than the alternativesCode refinement · APPS-IntroductoryLLM callsNo clear effect
Use REx instead of Fixed-WidthCode refinement · APPS-Competition and ARCproblems solvedNo clear effect

Surprising findings

Limitations

Experimental setup

Datasets: APPS ARC NLA loop invariant benchmark

Benchmarks: APPS Competition APPS Interview APPS Introductory ARC (40-problem subset) NLA loop invariant benchmark

Metrics: problems solved vs. LLM calls AUC final success rate LLM calls speedup

Baselines: Greedy refinement Breadth-First Search Fixed-Width Hypothesis Search Parsel AlphaCode G-CLN GSpacer Loopy-GPT4

Builds on: Thompson Sampling Monte Carlo Tree Search Hypothesis Search Fixed-Width refinement

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