Debug like a Human: A Large Language Model Debugger via Verifying Runtime Execution Step by Step
Open accessThe DOI matches its Crossref record; 12 of the 12 references it cites were found in a registry or an index.
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 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.
Overview
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Integrity signals
Registry
Cites
Statistics
Verification
Claims the paper makes
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Self-check
Percentages, sums and reported differences re-computed from the paper’s own numbers.
The self-check needs the paper’s full text.
Citations
Cites
Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
Wei, J., Wang, X., Schuurmans, D., Bosma, M., Ichter, B., Xia, F., Chi, E., Le, Q., & Zhou, D. (2022) · arXiv · doi:10.48550/arxiv.2201.11903 · Cited by 4,263
Least-to-Most Prompting Enables Complex Reasoning in Large Language Models
Zhou, D., Schärli, N., Hou, L., Wei, J., Scales, N., Wang, X., Schuurmans, D., Cui, C., Bousquet, O., Le, Q., et al. (2022) · arXiv · doi:10.48550/arxiv.2205.10625 · Cited by 380 · cited 1×
“Prompting methods suggest that decomposing problems aids large language models in reasoning tasks (Wei et al., 2022; Zhou et al., 2022; Lightman et al., 2023; Dhuliawala et al., 2023; Wang et al., 2024; Cheng et al., 2022).”
MethodStarCoder: may the source be with you!
Li, R., Allal, L. B., Zi, Y., Muennighoff, N., Kocetkov, D., Mou, C., Marone, M., Akiki, C., Li, J., Chim, J., et al. (2023) · arXiv · doi:10.48550/arxiv.2305.06161 · Cited by 261
Self-citationGorilla: Large Language Model Connected with Massive APIs
Patil, S., Zhang, T., Wang, X., & Gonzalez, J. (2024) · Advances in Neural Information Processing Systems 37 · doi:10.52202/079017-4020 · Cited by 226 · cited 1×
“This aligns with previous studies such as Self-Debugging (Chen et al., 2023c), Reflexion (Shinn et al., 2023), and Go-rilla (Patil et al., 2023), which also utilize Python to showcase the effectiveness of their methodologies.”
MethodInferFix: End-to-End Program Repair with LLMs
Jin, M., Shahriar, S., Tufano, M., Shi, X., Lu, S., Sundaresan, N., & Svyatkovskiy, A. (2023) · Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering · doi:10.1145/3611643.3613892 · Cited by 191 · cited 1×
“Despite their impressive capabilities, these models face challenges such as syntax correctness (Jin et al., 2023; Chen et al., 2023b), semantic alignment (Ni et al., 2023; Fan et al., 2023), code reliability (Zhong and Wang, 2023), and conflict merging (Zhang et al., 2022c).”
BackgroundExamining Zero-Shot Vulnerability Repair with Large Language Models
Pearce, H., Tan, B., Ahmad, B., Karri, R., & Dolan-Gavitt, B. (2023) · 2023 IEEE Symposium on Security and Privacy (SP) · doi:10.1109/sp46215.2023.10179324 · Cited by 131
Natural Language to Code Translation with Execution
Shi, F., Fried, D., Ghazvininejad, M., Zettlemoyer, L., & Wang, S. I. (2022) · arXiv · doi:10.48550/arxiv.2204.11454 · Cited by 49 · cited 2×
“The experiment settings on MBPP and TransCoder are the same as the prior works (Chen et al., 2023c; Shi et al., 2022; Ni et al., 2023).”
BackgroundMethodFine-Grained Human Feedback Gives Better Rewards for Language Model Training
Wu, Z., Hu, Y., Shi, W., Dziri, N., Suhr, A., Ammanabrolu, P., Smith, N. A., Ostendorf, M., & Hajishirzi, H. (2023) · arXiv · doi:10.48550/arxiv.2306.01693 · Cited by 40
Evaluating Instruction-Tuned Large Language Models on Code Comprehension and Generation
Yuan, Z., Liu, J., Zi, Q., Liu, M., Peng, X., & Lou, Y. (2023) · arXiv · doi:10.48550/arxiv.2308.01240 · Cited by 31 · cited 1×
“…Roziere et al., 2023; Achiam et al., 2023; Zhou et al., 2023a; Muennighoff et al., 2023) significantly boosts the performance of code generation and demonstrates a promising potential to be generally applied in different requirements and tasks (Shinn et al., 2023; Gu, 2023; Yuan et al., 2023).”
BackgroundCodepori: Large-Scale System for Autonomous Software Development Using Multi-Agent Technology
Rasheed, Z., Malik, S., Kemell, K.-K., Muhammad, W., Saari, M., Systä, K., & Abrahamsson, P. (2024) · doi:10.2139/ssrn.4979510 · Cited by 27
Cited by
A survey on large language models for code generation
Jiang, J., Wang, F., Shen, J., Kim, S., & Kim, S. (2024) · arXiv · doi:10.48550/arxiv.2406.00515 · Cited by 257
A Survey on Large Language Models for Code Generation
Jiang, J., Wang, F., Shen, J., Kim, S., & Kim, S. (2026) · ACM Transactions on Software Engineering and Methodology · doi:10.1145/3747588 · Cited by 251
Generative Artificial Intelligence for Software Engineering—A Research Agenda
Nguyen‐Duc, A., Cabrero‐Daniel, B., Przybylek, A., Arora, C., Khanna, D., Herda, T., Rafiq, U., Melegati, J., Guerra, E., Kemell, K., et al. (2025) · Software: Practice and Experience · doi:10.1002/spe.70005 · Cited by 60
“Performance LLMs in separate SE tasks in experimental settings have been rapidly improved; for instance, leaderboard human eval has shown developed LLMs for code generation with 98.2% accuracy with pass@1 metric [238].”
InfluentialCRUXEVAL-X: A Benchmark for Multilingual Code Reasoning, Understanding and Execution
Xu, R., Cao, J., Lu, Y., Wen, M., Lin, H., Han, X., He, B., Cheung, S.-C., & Sun, L. (2025) · Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) · doi:10.18653/v1/2025.acl-long.1158 · Cited by 35
Do Advanced Language Models Eliminate the Need for Prompt Engineering in Software Engineering?
Wang, G., Sun, Z., Ye, S., Gong, Z., Chen, Y., Zhao, Y., Liang, Q., & Hao, D. (2026) · ACM Transactions on Software Engineering and Methodology · doi:10.1145/3771933 · Cited by 26
“RQ3: How should practitioners and researchers select prompt engineering techniques and foundational LLMs, considering the monetary expenditure and time costs?”
InfluentialAgileCoder: Dynamic Collaborative Agents for Software Development based on Agile Methodology
Nguyen, M. H., Chau, T. P., Nguyen, P. X., & Bui, N. D. Q. (2024) · arXiv · doi:10.48550/arxiv.2406.11912 · Cited by 21
Islam, M. A., Ali, M. E., & Parvez, M. R. (2025) · arXiv · doi:10.48550/arxiv.2502.05664 · Cited by 17
Jiang, J., Shen, J., Kim, S., Yoo, K. M., Kim, J., & Kim, S. (2026) · arXiv · doi:10.48550/arxiv.2603.05863 · Cited by 8
AFlow: Automating Agentic Workflow Generation
Zhang, J., Xiang, J., Yu, Z., Teng, F., Chen, X., Chen, J., Zhuge, M., Cheng, X., Hong, S., Wang, J., et al. (2024) · arXiv · doi:10.48550/arxiv.2410.10762 · Cited by 359
“We implement six common operator structures, including: Generate (Contextual, Code), Format, Review & Revise, Ensemble, Test, and Programmer.”
InfluentialA Multi-Agent Framework for Accessible Web Code Generation
Aljedaani, W., Shaik, M. A., & Aljohani, A. (2026) · Proceedings of the 23rd International Web for All Conference · doi:10.1145/3800424.3800453 · Cited by 1
Execution Guided Line-by-Line Code Generation
Lavon, B., Katz, S., & Wolf, L. (2025) · arXiv · doi:10.48550/arxiv.2506.10948 · Cited by 1
“On the HumanEval benchmark (Figure 2), EG-CFG achieves highly competitive results compared to existing state-of-the-art methods and establishes a new state-of-the-art on the HumanEval-ET benchmark, reaching 87.19% accuracy and surpassing LPW’s 84.8% accuracy achieved with GPT-4o.”
InfluentialZhou, C., Zhang, X., Song, D., Chen, X., Gu, W., Ma, H., Tian, Y., Zhang, M., & Hu, L. (2025) · arXiv · doi:10.48550/arxiv.2502.09183 · Cited by 18
“In the code domain, CodeT (Chen et al., 2023), Self-Debugging (Chen et al., 2024), and LDB (Zhong et al., 2024) follow this approach.”
Ning, X., Tieu, K., Fu, D., Wei, T., Li, Z., Bei, Y., Zou, J., Ai, M., Liu, Z., Li, T.-W., et al. (2026) · arXiv · doi:10.48550/arxiv.2605.18747
Self-Improvement of Large Language Models: A Technical Overview and Future Outlook
Yang, H., Xerri, M., Park, S., Zhang, H., Feng, Y., Kogilathota, S. A., & Zhou, J. (2026) · arXiv · doi:10.48550/arxiv.2603.25681
SEMAG: Self-Evolutionary Multi-Agent Code Generation
Peng, Y., Hou, H., Zhu, X., He, Y. T., & Yu, F. R. (2026) · arXiv · doi:10.48550/arxiv.2603.15707
Hidden in Plain Text: Emergence & Mitigation of Steganographic Collusion in LLMs
Mathew, Y., Matthews, O., McCarthy, R., Velja, J., de Witt, C. S., Cope, D., & Schoots, N. (2024) · arXiv · doi:10.48550/arxiv.2410.03768
“To decouple steganographic performance from the coding ability of the sender, we also show the sender a correct implementation of the function when asking it to complete the task.”
Metadata
- Authors
- Zhong, L., Wang, Z., & Shang, J.
- Venue
- Findings of the Association for Computational Linguistics ACL 2024
- Published
- 2024
- Pages
- 851-870
- OpenAlex
- W4402670687
- Cited by
- 67
- References
- 12
- FWCI
- 18.95
- Type
- conference paper
- Language
- en
- Open access
- gold
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review
Data sources
Bibliographic data: Semantic Scholar, OpenAlex, Crossref.
Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).
Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.