Code Repair with LLMs gives an Exploration-Exploitation Tradeoff
Not on the map. Why?
Abstract (arXiv)
Iteratively improving and repairing source code with large language models (LLMs), known as refinement, has emerged as a popular way of generating programs that would be too complex to construct in one shot. Given a bank of test cases, together with a candidate program, an LLM can improve that program by being prompted with failed test cases. But it remains an open question how to best iteratively refine code, with prior work employing simple greedy or breadth-first strategies. We show here that refinement exposes an explore-exploit tradeoff: exploit by refining the program that passes the most test cases, or explore by refining a lesser considered program. We frame this as an arm-acquiring bandit problem, which we solve with Thompson Sampling. The resulting LLM-based program synthesis algorithm is broadly applicable: Across loop invariant synthesis, visual reasoning puzzles, and competition programming problems, we find that our new method can solve more problems using fewer language model calls.
Key facts. Cited by 51 papers in the map (data through 14 Oct 2026). Builds on 22 of its 41 references that are in the map. First posted on arXiv 26 May 2024.
Builds on
22 of 41 references.
References · 22
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2021Program Synthesis with Large Language Modelscited by 3,637
- 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,442
- 2022Competition-Level Code Generation with AlphaCodecited by 1,462
- 2023Teaching Large Language Models to Self-Debugcited by 988
- 2021Measuring Coding Challenge Competence With APPScited by 902
- 2017A Tutorial on Thompson Samplingcited by 433
- 2022CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learningcited by 358
- 2022Generating Sequences by Learning to Self-Correctcited by 277
- 2023Is Self-Repair a Silver Bullet for Code Generation?cited by 197
- 2022Practical Program Repair in the Era of Large Pre-trained Language Modelscited by 133
- 2023Hypothesis Search: Inductive Reasoning with Language Modelscited by 120
10 more
- 2024WorldCoder, a Model-Based LLM Agent: Building World Models by Writing Code and Interacting with the Environmentcited by 107
- 2023Phenomenal Yet Puzzling: Testing Inductive Reasoning Capabilities of Language Models with Hypothesis Refinementcited by 89
- 2022Automated Repair of Programs from Large Language Modelscited by 71
- 2022Parsel: Algorithmic Reasoning with Language Models by Composing Decompositionscited by 64
- 2024CYCLE: Learning to Self-Refine the Code Generationcited by 42
- 2023WhiteFox: White-Box Compiler Fuzzing Empowered by Large Language Modelscited by 37
- 2023Finding Inductive Loop Invariants using Large Language Modelscited by 36
- 2021Fast and flexible: Human program induction in abstract reasoning taskscited by 33
- 2020Learning Nonlinear Loop Invariants with Gated Continuous Logic Networks (Extended Version)cited by 17
- 2020Global Guidance for Local Generalization in Model Checkingcited by 5
Built on by
Citing papers per year: 2024: 9; 2025: 18; 2026: 24.
51 papers.
Sort:
By area:
- 2026AutoHarness: improving LLM agents by automatically synthesizing a code harnesscited by 76
- 2025ReasonFlux: Hierarchical LLM Reasoning via Scaling Thought Templatescited by 63
- 2024Combining Induction and Transduction for Abstract Reasoningcited by 53
- 2025Wider or Deeper? Scaling LLM Inference-Time Compute with Adaptive Branching Tree Searchcited by 51
- 2025Self-Improving Language Models for Evolutionary Program Synthesis: A Case Study on ARC-AGIcited by 36
- 2025CodeJudgeBench: Benchmarking LLM-as-a-Judge for Coding Taskscited by 33
- 2024What Makes Large Language Models Reason in (Multi-Turn) Code Generation?cited by 29
- 2024Is Programming by Example solved by LLMs?cited by 27
- 2025PoE-World: Compositional World Modeling with Products of Programmatic Expertscited by 26
- 2024SELA: Tree-Search Enhanced LLM Agents for Automated Machine Learningcited by 24
- 2024Reasoning Through Execution: Unifying Process and Outcome Rewards for Code Generationcited by 21
- 2026Calibrate-Then-Act: Cost-Aware Exploration in LLM Agentscited by 17
38 more
- 2026LoopViT: Scaling Visual ARC with Looped Transformerscited by 15
- 2026M2F: Automated Formalization of Mathematical Literature at Scalecited by 15
- 2025LLM-Guided Probabilistic Program Induction for POMDP Model Estimationcited by 12
- 2024Scattered Forest Search: Smarter Code Space Exploration with LLMscited by 10
- 2025Token Hidden Reward: Steering Exploration-Exploitation in Group Relative Deep Reinforcement Learningcited by 10
- 2025ARC-GEN: A Mimetic Procedural Benchmark Generator for the Abstraction and Reasoning Corpuscited by 10
- 2025Improved Generalized Planning with LLMs through Strategy Refinement and Reflectioncited by 7
- 2025InfCode: Adversarial Iterative Refinement of Tests and Patches for Reliable Software Issue Resolutioncited by 7
- 2024Relational decomposition for program synthesiscited by 6
- 2024Generating Diverse Hypotheses for Inductive Reasoningcited by 6
- 2025Multi-Agent Code-Orchestrated Generation for Reliable Infrastructure-as-Codecited by 5
- 2026How Many Tries Does It Take? Iterative Self-Repair in LLM Code Generation Across Model Scales and Benchmarkscited by 5
- 2026Distilling Game Code World Model Generation into Lightweight Large Language Modelscited by 5
- 2025Program Synthesis via Test-Time Transductioncited by 4
- 2026Automating Computational Reproducibility in Social Science: Comparing Prompt-Based and Agent-Based Approachescited by 4
- 2026Compute Allocation for Self-Evolving LLMs: From Depth-Breadth to Multi-Armed Banditscited by 4
- 2026Twin: Playing an Unknown Game with a Test-Time Digital Twincited by 4
- 2025Cog-Rethinker: Hierarchical Metacognitive Reinforcement Learning for LLM Reasoningcited by 3
- 2026Exploration and Exploitation Errors Are Measurable for Language Model Agentscited by 3
- 2025Sample-Efficient Behavior Cloning Using General Domain Knowledgecited by 2
- 2026More Bang for the Buck: Improving the Inference of Large Language Models at a Fixed Budget using Reset and Discard (ReD)cited by 2
- 2026TriVAL: A Tri-Validation Framework for Faithful Automatic Optimization Modelingcited by 2
- 2025Collaborative Agents for Automated Program Repair in Rubycited by 1
- 2026A Component-Based Survey of Interactions between Large Language Models and Multi-Armed Banditscited by 1
- 2026Auto Researching, not hyperparameter tuning: Convergence Analysis of 10,000 Experimentscited by 1
- 2026Obey, Diverge, Collapse: Blind Obedience to Incorrect Instructions Drives Code LLMs to Irrecoverable Code Semantic Collapsecited by 1
- 2026SkillHEX: Improving Agent Skills via Hypothesis-Driven Autonomous Exploration and Exploitationcited by 1
- 2026Two-Stage Reinforcement Learning for Sound and Adversarial Test Generation in Code LLMscited by 1
- 2024System 2 Reasoning for Human-AI Alignment: Generality and Adaptivity via ARC-AGIcited by 0
- 2025RN-F: A Novel Approach for Mitigating Contaminated Data in Large Language Modelscited by 0
- 2025TGPR: Tree-Guided Policy Refinement for Robust Self-Debugging of LLMscited by 0
- 2025What a diff makes: automating code migration with large language modelscited by 0
- 2026The Critical Horizon: Inspection Design Principles for Multi-Stage Operations and Deep Reasoningcited by 0
- 2026SemRep: Generative Code Representation Learning with Code Transformationscited by 0
- 2026Progressive Content Refinement with Decaying Reward Joint LinUCBcited by 0
- 2026Discovering Adaptive Transmission Programs for Collective Innovationcited by 0
- 2026Test-Driven Approaches to Software Engineering with Large Language Models: A Survey of Phases, Tasks, and Agent Skillscited by 0
- 2026Generate to Explore, Select to Exploit: Aligning LLM-based Headline Generation with Personalized Recommendationcited by 0
50 most cited of 51 All 51 (JSON)
- 2026Make Every Expansion Count: Learning to Search Efficiently in LLM Code Repair11 Oct 2026
- 2026Generate to Explore, Select to Exploit: Aligning LLM-based Headline Generation with Personalized Recommendation14 Sep 2026
- 2026Test-Driven Approaches to Software Engineering with Large Language Models: A Survey of Phases, Tasks, and Agent Skills10 Sep 2026
- 2026Two-Stage Reinforcement Learning for Sound and Adversarial Test Generation in Code LLMs3 Sep 2026
- 2026Discovering Adaptive Transmission Programs for Collective Innovation25 Aug 2026
- 2026Twin: Playing an Unknown Game with a Test-Time Digital Twin14 Aug 2026
- 2026Progressive Content Refinement with Decaying Reward Joint LinUCB7 Aug 2026
- 2026SkillHEX: Improving Agent Skills via Hypothesis-Driven Autonomous Exploration and Exploitation6 Aug 2026
- 2026Obey, Diverge, Collapse: Blind Obedience to Incorrect Instructions Drives Code LLMs to Irrecoverable Code Semantic Collapse5 Jul 2026
- 2026Compute Allocation for Self-Evolving LLMs: From Depth-Breadth to Multi-Armed Bandits28 May 2026
- 2026Distilling Game Code World Model Generation into Lightweight Large Language Models23 May 2026
- 2026TriVAL: A Tri-Validation Framework for Faithful Automatic Optimization Modeling12 May 2026
38 more
- 2026Exploration and Exploitation Errors Are Measurable for Language Model Agents14 Apr 2026
- 2026How Many Tries Does It Take? Iterative Self-Repair in LLM Code Generation Across Model Scales and Benchmarks12 Apr 2026
- 2026Auto Researching, not hyperparameter tuning: Convergence Analysis of 10,000 Experiments16 Mar 2026
- 2026SemRep: Generative Code Representation Learning with Code Transformations13 Mar 2026
- 2026M2F: Automated Formalization of Mathematical Literature at Scale19 Feb 2026
- 2026Calibrate-Then-Act: Cost-Aware Exploration in LLM Agents18 Feb 2026
- 2026AutoHarness: improving LLM agents by automatically synthesizing a code harness10 Feb 2026
- 2026The Critical Horizon: Inspection Design Principles for Multi-Stage Operations and Deep Reasoning10 Feb 2026
- 2026Automating Computational Reproducibility in Social Science: Comparing Prompt-Based and Agent-Based Approaches9 Feb 2026
- 2026LoopViT: Scaling Visual ARC with Looped Transformers2 Feb 2026
- 2026More Bang for the Buck: Improving the Inference of Large Language Models at a Fixed Budget using Reset and Discard (ReD)29 Jan 2026
- 2026A Component-Based Survey of Interactions between Large Language Models and Multi-Armed Bandits19 Jan 2026
- 2025InfCode: Adversarial Iterative Refinement of Tests and Patches for Reliable Software Issue Resolution20 Nov 2025
- 2025Collaborative Agents for Automated Program Repair in Ruby6 Nov 2025
- 2025ARC-GEN: A Mimetic Procedural Benchmark Generator for the Abstraction and Reasoning Corpus31 Oct 2025
- 2025What a diff makes: automating code migration with large language models31 Oct 2025
- 2025Cog-Rethinker: Hierarchical Metacognitive Reinforcement Learning for LLM Reasoning13 Oct 2025
- 2025TGPR: Tree-Guided Policy Refinement for Robust Self-Debugging of LLMs8 Oct 2025
- 2025Multi-Agent Code-Orchestrated Generation for Reliable Infrastructure-as-Code4 Oct 2025
- 2025Token Hidden Reward: Steering Exploration-Exploitation in Group Relative Deep Reinforcement Learning4 Oct 2025
- 2025Program Synthesis via Test-Time Transduction22 Sep 2025
- 2025Improved Generalized Planning with LLMs through Strategy Refinement and Reflection19 Aug 2025
- 2025CodeJudgeBench: Benchmarking LLM-as-a-Judge for Coding Tasks14 Jul 2025
- 2025Self-Improving Language Models for Evolutionary Program Synthesis: A Case Study on ARC-AGI10 Jul 2025
- 2025RN-F: A Novel Approach for Mitigating Contaminated Data in Large Language Models19 May 2025
- 2025PoE-World: Compositional World Modeling with Products of Programmatic Experts16 May 2025
- 2025LLM-Guided Probabilistic Program Induction for POMDP Model Estimation4 May 2025
- 2025Wider or Deeper? Scaling LLM Inference-Time Compute with Adaptive Branching Tree Search6 Mar 2025
- 2025ReasonFlux: Hierarchical LLM Reasoning via Scaling Thought Templates10 Feb 2025
- 2025Sample-Efficient Behavior Cloning Using General Domain Knowledge27 Jan 2025
- 2024Reasoning Through Execution: Unifying Process and Outcome Rewards for Code Generation19 Dec 2024
- 2024Generating Diverse Hypotheses for Inductive Reasoning18 Dec 2024
- 2024Combining Induction and Transduction for Abstract Reasoning4 Nov 2024
- 2024Scattered Forest Search: Smarter Code Space Exploration with LLMs22 Oct 2024
- 2024SELA: Tree-Search Enhanced LLM Agents for Automated Machine Learning22 Oct 2024
- 2024What Makes Large Language Models Reason in (Multi-Turn) Code Generation?10 Oct 2024
- 2024System 2 Reasoning for Human-AI Alignment: Generality and Adaptivity via ARC-AGI10 Oct 2024
- 2024Relational decomposition for program synthesis22 Aug 2024
50 newest of 51 All 51 (JSON)
- 2025ReasonFlux: Hierarchical LLM Reasoning via Scaling Thought Templatescited by 63
- 2024Combining Induction and Transduction for Abstract Reasoningcited by 53
- 2025Wider or Deeper? Scaling LLM Inference-Time Compute with Adaptive Branching Tree Searchcited by 51
- 2024What Makes Large Language Models Reason in (Multi-Turn) Code Generation?cited by 29
- 2024Reasoning Through Execution: Unifying Process and Outcome Rewards for Code Generationcited by 21
- 2026LoopViT: Scaling Visual ARC with Looped Transformerscited by 15
- 2024Scattered Forest Search: Smarter Code Space Exploration with LLMscited by 10
- 2025Token Hidden Reward: Steering Exploration-Exploitation in Group Relative Deep Reinforcement Learningcited by 10
- 2024Generating Diverse Hypotheses for Inductive Reasoningcited by 6
- 2025Cog-Rethinker: Hierarchical Metacognitive Reinforcement Learning for LLM Reasoningcited by 3
- 2025TGPR: Tree-Guided Policy Refinement for Robust Self-Debugging of LLMscited by 0
- 2026The Critical Horizon: Inspection Design Principles for Multi-Stage Operations and Deep Reasoningcited by 0
- 2026The Critical Horizon: Inspection Design Principles for Multi-Stage Operations and Deep Reasoning10 Feb 2026
- 2026LoopViT: Scaling Visual ARC with Looped Transformers2 Feb 2026
- 2025Cog-Rethinker: Hierarchical Metacognitive Reinforcement Learning for LLM Reasoning13 Oct 2025
- 2025TGPR: Tree-Guided Policy Refinement for Robust Self-Debugging of LLMs8 Oct 2025
- 2025Token Hidden Reward: Steering Exploration-Exploitation in Group Relative Deep Reinforcement Learning4 Oct 2025
- 2025Wider or Deeper? Scaling LLM Inference-Time Compute with Adaptive Branching Tree Search6 Mar 2025
- 2025ReasonFlux: Hierarchical LLM Reasoning via Scaling Thought Templates10 Feb 2025
- 2024Reasoning Through Execution: Unifying Process and Outcome Rewards for Code Generation19 Dec 2024
- 2024Generating Diverse Hypotheses for Inductive Reasoning18 Dec 2024
- 2024Combining Induction and Transduction for Abstract Reasoning4 Nov 2024
- 2024Scattered Forest Search: Smarter Code Space Exploration with LLMs22 Oct 2024
- 2024What Makes Large Language Models Reason in (Multi-Turn) Code Generation?10 Oct 2024
- 2026AutoHarness: improving LLM agents by automatically synthesizing a code harnesscited by 76
- 2024SELA: Tree-Search Enhanced LLM Agents for Automated Machine Learningcited by 24
- 2026Calibrate-Then-Act: Cost-Aware Exploration in LLM Agentscited by 17
- 2025Multi-Agent Code-Orchestrated Generation for Reliable Infrastructure-as-Codecited by 5
- 2026Automating Computational Reproducibility in Social Science: Comparing Prompt-Based and Agent-Based Approachescited by 4
- 2026Exploration and Exploitation Errors Are Measurable for Language Model Agentscited by 3
- 2025Collaborative Agents for Automated Program Repair in Rubycited by 1
- 2026Auto Researching, not hyperparameter tuning: Convergence Analysis of 10,000 Experimentscited by 1
- 2026SkillHEX: Improving Agent Skills via Hypothesis-Driven Autonomous Exploration and Exploitationcited by 1
- 2026Test-Driven Approaches to Software Engineering with Large Language Models: A Survey of Phases, Tasks, and Agent Skillscited by 0
- 2026Test-Driven Approaches to Software Engineering with Large Language Models: A Survey of Phases, Tasks, and Agent Skills10 Sep 2026
- 2026SkillHEX: Improving Agent Skills via Hypothesis-Driven Autonomous Exploration and Exploitation6 Aug 2026
- 2026Exploration and Exploitation Errors Are Measurable for Language Model Agents14 Apr 2026
- 2026Auto Researching, not hyperparameter tuning: Convergence Analysis of 10,000 Experiments16 Mar 2026
- 2026Calibrate-Then-Act: Cost-Aware Exploration in LLM Agents18 Feb 2026
- 2026AutoHarness: improving LLM agents by automatically synthesizing a code harness10 Feb 2026
- 2026Automating Computational Reproducibility in Social Science: Comparing Prompt-Based and Agent-Based Approaches9 Feb 2026
- 2025Collaborative Agents for Automated Program Repair in Ruby6 Nov 2025
- 2025Multi-Agent Code-Orchestrated Generation for Reliable Infrastructure-as-Code4 Oct 2025
- 2024SELA: Tree-Search Enhanced LLM Agents for Automated Machine Learning22 Oct 2024
- 2025CodeJudgeBench: Benchmarking LLM-as-a-Judge for Coding Taskscited by 33
- 2024Is Programming by Example solved by LLMs?cited by 27
- 2026M2F: Automated Formalization of Mathematical Literature at Scalecited by 15
- 2025LLM-Guided Probabilistic Program Induction for POMDP Model Estimationcited by 12
- 2025ARC-GEN: A Mimetic Procedural Benchmark Generator for the Abstraction and Reasoning Corpuscited by 10
- 2025Improved Generalized Planning with LLMs through Strategy Refinement and Reflectioncited by 7
- 2025InfCode: Adversarial Iterative Refinement of Tests and Patches for Reliable Software Issue Resolutioncited by 7
- 2024Relational decomposition for program synthesiscited by 6
- 2026How Many Tries Does It Take? Iterative Self-Repair in LLM Code Generation Across Model Scales and Benchmarkscited by 5
- 2025Program Synthesis via Test-Time Transductioncited by 4
- 2026More Bang for the Buck: Improving the Inference of Large Language Models at a Fixed Budget using Reset and Discard (ReD)cited by 2
- 2026TriVAL: A Tri-Validation Framework for Faithful Automatic Optimization Modelingcited by 2
12 most cited of 23 All 23 (JSON)
- 2026Make Every Expansion Count: Learning to Search Efficiently in LLM Code Repair11 Oct 2026
- 2026Generate to Explore, Select to Exploit: Aligning LLM-based Headline Generation with Personalized Recommendation14 Sep 2026
- 2026Two-Stage Reinforcement Learning for Sound and Adversarial Test Generation in Code LLMs3 Sep 2026
- 2026Discovering Adaptive Transmission Programs for Collective Innovation25 Aug 2026
- 2026Progressive Content Refinement with Decaying Reward Joint LinUCB7 Aug 2026
- 2026Obey, Diverge, Collapse: Blind Obedience to Incorrect Instructions Drives Code LLMs to Irrecoverable Code Semantic Collapse5 Jul 2026
- 2026TriVAL: A Tri-Validation Framework for Faithful Automatic Optimization Modeling12 May 2026
- 2026How Many Tries Does It Take? Iterative Self-Repair in LLM Code Generation Across Model Scales and Benchmarks12 Apr 2026
- 2026SemRep: Generative Code Representation Learning with Code Transformations13 Mar 2026
- 2026M2F: Automated Formalization of Mathematical Literature at Scale19 Feb 2026
- 2026More Bang for the Buck: Improving the Inference of Large Language Models at a Fixed Budget using Reset and Discard (ReD)29 Jan 2026
- 2026A Component-Based Survey of Interactions between Large Language Models and Multi-Armed Bandits19 Jan 2026
12 newest of 23 All 23 (JSON)
Similar, not cited
Close in wording, no citation either way
- 2025Unlocking LLM Repair Capabilities Through Cross-Language Translation and Multi-Agent Refinement
- 2026Unlocking LLM Code Correction with Iterative Feedback Loops
- 2025Fully Autonomous Programming using Iterative Multi-Agent Debugging with Large Language Models
- 2025Let's Revise Step-by-Step: A Unified Local Search Framework for Code Generation with LLMs
- 2026If It's Not Buggy, Don't Fix It: On the Dynamics of Iterative Bug-fixing with LLMs
- 2024Rethinking Code Refinement: Learning to Judge Code Efficiency
- 2025The Art of Repair: Optimizing Iterative Program Repair with Instruction-Tuned Models
- 2026Refine After Generation: Toward Correct and Concise Patches in LLM-based Program Repair