Lune

ACL Findings2024

Debug like a Human: A Large Language Model Debugger via Verifying Runtime Execution Step by Step

Li Zhong, Zilong Wang, Jingbo Shang

摘要

Large language models (LLMs) are leading significant progress in code generation. Beyond one-pass code generation, recent works further integrate unit tests and program verifiers into LLMs to iteratively refine the generated programs. However, these works consider the generated program as an indivisible entity, which falls short for LLMs in debugging the programs, especially when the programs contain complex logic flows and data operations. In contrast, when human developers debug programs, they typically set breakpoints and selectively examine runtime execution information. The execution flow and the intermediate variables play a crucial role in the debugging process, yet they are underutilized in the existing literature on code generation. In this study, we introduce Large Language Model Debugger (LDB), a novel debugging framework that enables LLMs to refine their generated programs with the runtime execution information. Specifically, LDB segments programs into basic blocks and tracks the values of intermediate variables after each block throughout runtime execution. This allows LLMs to concentrate on simpler code units within the overall execution flow, verify their correctness against the task description block by block, and effectively pinpoint any potential errors. Experiments demonstrate that LDB consistently enhances the baseline performance by up to 9.8% across the HumanEval, MBPP, and TransCoder benchmarks, archiving new state-of-the-art performance in code debugging for various LLM selections.

问 Lune

尽管问,回答会引用原文。

Lune 会读完全文和相关的 Paper,每个回答都附上所依据的原文段落。

可以从这些问题问起

Lune 的依据

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

获取答案

免费开始,无需绑卡

引用它的顶会 Paper37

  1. The Limits of Inference Scaling Through ResamplingBenedikt Stroebl, Sayash Kapoor, Arvind NarayananICLR 2026 · 38 次引用
  2. Assemble Your Crew: Automatic Multi-agent Communication Topology Design via Autoregressive Graph GenerationShiyuan Li, Yixin Liu, Qingsong Wen, Chengqi Zhang 等AAAI 2026 · 29 次引用
  3. Toward Effective Tool-Integrated Reasoning via Self-Evolved Preference LearningYifei Chen, Guanting Dong, Zhicheng DouICLR 2026 · 18 次引用
  4. Afterburner: Reinforcement Learning Facilitates Self-Improving Code Efficiency OptimizationMingzhe Du, Anh Tuan Luu, Yue Liu, Yuhao Qing 等NeurIPS 2025 · 18 次引用
  5. AutoIOT: LLM-Driven Automated Natural Language Programming for AIoT ApplicationsLeming Shen, Qiang Yang, Yuanqing Zheng, Mo LiMobiCom 2025 · 14 次引用

它引用的 Paper37

  1. Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma 等NeurIPS 2022 · 22,562 次引用
  2. Reflexion: language agents with verbal reinforcement learningNoah Shinn, Federico Cassano, Ashwin Gopinath, Karthik Narasimhan 等NeurIPS 2023 · 5,828 次引用
  3. Self-Refine: Iterative Refinement with Self-FeedbackAman Madaan, Niket Tandon, Prakhar Gupta, Skyler Hallinan 等NeurIPS 2023 · 4,972 次引用
  4. Let's Verify Step by StepHunter Lightman, Vineet Kosaraju, Yuri Burda, Harrison Edwards 等ICLR 2024 · 3,045 次引用
  5. Gorilla: Large Language Model Connected with Massive APIsShishir G. Patil, Tianjun Zhang, Xin Wang, Joseph E. GonzalezNeurIPS 2024 · 1,715 次引用

相关 Paper

  1. From Code to Correctness: Closing the Last Mile of Code Generation with Hierarchical DebuggingYuling Shi, Songsong Wang, Chengcheng Wan, Min Wang 等ICSE 2026 · 4 次引用
  2. Revisit Self-Debugging with Self-Generated Tests for Code GenerationXiancai Chen, Zhengwei Tao, Kechi Zhang, Changzhi Zhou 等ACL 2025
  3. Teaching Large Language Models to Self-DebugXinyun Chen, Maxwell Lin, Nathanael Schärli, Denny ZhouICLR 2024 · 1,085 次引用
  4. NL-Debugging: Exploiting Natural Language as an Intermediate Representation for Code DebuggingWeiming Zhang, Qingyao Li, Xinyi Dai, Jizheng Chen 等EMNLP 2025 · 1 次引用
  5. Planning-Driven Programming: A Large Language Model Programming WorkflowChao Lei, Yanchuan Chang, Nir Lipovetzky, Krista A. EhingerACL 2025
黄昏的海面,两侧是细线勾勒的悬崖