Lune

NeurIPS2024顶会

Code Repair with LLMs gives an Exploration-Exploitation Tradeoff

Hao Tang, Keya Hu, Jin Zhou, Sicheng Zhong, Wei-Long Zheng, Xujie Si, Kevin Ellis

摘要

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.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 20 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Is Programming by Example Solved by LLMs? 引用了 CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learning
  • Is Programming by Example Solved by LLMs? 引用了 Self-Refine: Iterative Refinement with Self-Feedback
  • Is Programming by Example Solved by LLMs? 引用了 Teaching Large Language Models to Self-Debug
  • Teaching Large Language Models to Self-Debug 引用了 CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learning
  • Teaching Large Language Models to Self-Debug 引用了 Self-Refine: Iterative Refinement with Self-Feedback
  • Wider or Deeper? Scaling LLM Inference-Time Compute with Adaptive Branching Tree Search 引用了 Self-Refine: Iterative Refinement with Self-Feedback
  • CodeJudgeBench: Benchmarking LLM-as-a-Judge for Coding Tasks 引用了 Teaching Large Language Models to Self-Debug
  • Generating Code World Models with Large Language Models Guided by Monte Carlo Tree Search 引用了 CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learning
  • Generating Code World Models with Large Language Models Guided by Monte Carlo Tree Search 引用了 Self-Refine: Iterative Refinement with Self-Feedback
  • Generating Code World Models with Large Language Models Guided by Monte Carlo Tree Search 引用了 WorldCoder, a Model-Based LLM Agent: Building World Models by Writing Code and Interacting with the Environment
  • WorldCoder, a Model-Based LLM Agent: Building World Models by Writing Code and Interacting with the Environment 引用了 Teaching Large Language Models to Self-Debug
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper20

  1. WorldCoder, a Model-Based LLM Agent: Building World Models by Writing Code and Interacting with the EnvironmentHao Tang, Darren Key, Kevin EllisNeurIPS 2024 · 123 次引用
  2. Wider or Deeper? Scaling LLM Inference-Time Compute with Adaptive Branching Tree SearchYuichi Inoue, Kou Misaki, Yuki Imajuku, So Kuroki 等NeurIPS 2025 · 67 次引用
  3. Generating Code World Models with Large Language Models Guided by Monte Carlo Tree SearchNicola Dainese, Matteo Merler, Minttu Alakuijala, Pekka MarttinenNeurIPS 2024 · 49 次引用
  4. Is Programming by Example Solved by LLMs?Wen-Ding Li, Kevin EllisNeurIPS 2024 · 45 次引用
  5. CodeJudgeBench: Benchmarking LLM-as-a-Judge for Coding TasksHongchao Jiang, Yiming Chen, Yushi Cao, Hung-Yi Lee 等ACL 2026 · 33 次引用

它引用的 Paper16

  1. Self-Refine: Iterative Refinement with Self-FeedbackAman Madaan, Niket Tandon, Prakhar Gupta, Skyler Hallinan 等NeurIPS 2023 · 4,972 次引用
  2. Teaching Large Language Models to Self-DebugXinyun Chen, Maxwell Lin, Nathanael Schärli, Denny ZhouICLR 2024 · 1,085 次引用
  3. CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement LearningHung Le, Yue Wang, Akhilesh Deepak Gotmare, Silvio Savarese 等NeurIPS 2022 · 571 次引用
  4. Automated Program Repair in the Era of Large Pre-trained Language ModelsChunqiu Steven Xia, Yuxiang Wei, Lingming ZhangICSE 2023 · 321 次引用
  5. Automated Repair of Programs from Large Language ModelsZhiyu Fan, Xiang Gao, Martin Mirchev, Abhik Roychoudhury 等ICSE 2023 · 213 次引用

相关 Paper

  1. RLEF: Grounding Code LLMs in Execution Feedback with Reinforcement LearningJonas Gehring, Kunhao Zheng, Jade Copet, Vegard Mella 等ICML 2025
  2. Online Prompt Selection for Program SynthesisYixuan Li, Lewis Frampton, Federico Mora, Elizabeth PolgreenAAAI 2025 · 2 次引用
  3. Ranking LLM-Generated Loop Invariants for Program VerificationSaikat Chakraborty, Shuvendu K. Lahiri, Sarah Fakhoury, Akash Lal 等EMNLP Findings 2023 · 36 次引用
  4. Steering Tree-of-Thought Reasoning via Deductive VerificationHaoliang Cheng, Enyi Tang, Shuoxiao Zhang, Jiahe Mao 等ISSTA 2026
  5. Once Upon an Input: Reasoning via Per-Instance Program SynthesisAdam Stein, Neelay Velingker, Mayur Naik, Eric WongNeurIPS 2025
黄昏的海面,两侧是细线勾勒的悬崖