Debug like a Human: A Large Language Model Debugger via Verifying Runtime Execution Step-by-step
Li Zhong, Zilong Wang, Jingbo Shang

TL;DR
This paper introduces LDB, a framework that enables large language models to debug code by analyzing runtime execution step-by-step, improving their ability to identify and fix errors in generated programs.
Contribution
LDB uniquely segments programs into basic blocks and tracks intermediate variables, allowing LLMs to verify and debug code more effectively using runtime information.
Findings
LDB improves debugging performance by up to 9.8%.
Achieves state-of-the-art results on multiple benchmarks.
Enhances LLMs' ability to identify errors in complex code flows.
Abstract
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 programs 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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsModel-Driven Software Engineering Techniques · Distributed and Parallel Computing Systems · Service-Oriented Architecture and Web Services
MethodsSparse Evolutionary Training
