From Code to Correctness: Closing the Last Mile of Code Generation with Hierarchical Debugging
Not on the map. Why?
Cited by 21 in LLM agents and tool use, but placed by its own abstract, which didn’t fit.
Abstract (arXiv)
While large language models have made significant strides in code generation, the pass rate of the generated code is bottlenecked on subtle errors, often requiring human intervention to pass tests, especially for complex problems. Existing LLM-based debugging systems treat generated programs as monolithic units, failing to address bugs at multiple levels of granularity, from low-level syntax errors to high-level algorithmic flaws. In this paper, we introduce Multi-Granularity Debugger (MGDebugger), a hierarchical code debugger by isolating, identifying, and resolving bugs at various levels of granularity. MGDebugger decomposes problematic code into a hierarchical tree structure of subfunctions, with each level representing a particular granularity of error. During debugging, it analyzes each subfunction and iteratively resolves bugs in a bottom-up manner. To effectively test each subfunction, we propose an LLM-simulated Python executor, which traces code execution and tracks important variable states to pinpoint errors accurately. Extensive experiments demonstrate that MGDebugger outperforms existing debugging systems, achieving an 18.9% improvement in accuracy over seed generations in HumanEval and a 97.6% repair success rate in HumanEvalFix. Furthermore, MGDebugger effectively fixes bugs across different categories and difficulty levels, demonstrating its robustness and effectiveness.
Key facts. Cited by 46 papers in the map (data through 13 Oct 2026). Builds on 60 of its 91 references that are in the map. First posted on arXiv 2 Oct 2024.
Builds on
60 of 91 references.
References · 60
- 2023GPT-4 Technical Reportcited by 18,278
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,072
- 2021Evaluating Large Language Models Trained on Codecited by 8,205
- 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 7,986
- 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,156
- 2021Program Synthesis with Large Language Modelscited by 3,573
- 2023Tree of Thoughts: Deliberate Problem Solving with Large Language Modelscited by 3,181
- 2022Self-Instruct: Aligning Language Models with Self-Generated Instructionscited by 2,693
- 2019Fine-Tuning Language Models from Human Preferencescited by 2,139
- 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Codecited by 1,951
- 2022Competition-Level Code Generation with AlphaCodecited by 1,445
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,362
38 more
- 2023Teaching Large Language Models to Self-Debugcited by 972
- 2021Measuring Coding Challenge Competence With APPScited by 891
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 743
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 651
- 2023Language Agent Tree Search Unifies Reasoning Acting and Planning in Language Modelscited by 560
- 2023Reinforced Self-Training (ReST) for Language Modelingcited by 492
- 2023Weak-to-Strong Generalization: Eliciting Strong Capabilities With Weak Supervisioncited by 454
- 2024Training Language Models to Self-Correct via Reinforcement Learningcited by 413
- 2022CodeT: Code Generation with Generated Testscited by 377
- 2024DeepSeek-Coder-V2: Breaking the Barrier of Closed-Source Models in Code Intelligencecited by 328
- 2024CodeAgent: Enhancing Code Generation with Tool-Integrated Agent Systems for Real-World Repo-level Coding Challengescited by 280
- 2023Self-collaboration Code Generation via ChatGPTcited by 257
- 2024OpenCodeInterpreter: Integrating Code Generation with Execution and Refinementcited by 243
- 2023LEVER: Learning to Verify Language-to-Code Generation with Executioncited by 235
- 2024RepairAgent: An Autonomous, LLM-Based Agent for Program Repaircited by 229
- 2023Universal Self-Consistency for Large Language Model Generationcited by 200
- 2023An Empirical Evaluation of Using Large Language Models for Automated Unit Test Generationcited by 194
- 2023Is Self-Repair a Silver Bullet for Code Generation?cited by 194
- 2023OctoPack: Instruction Tuning Code Large Language Modelscited by 184
- 2023Planning with Large Language Models for Code Generationcited by 182
- 2022Practical Program Repair in the Era of Large Pre-trained Language Modelscited by 133
- 2023Keep the Conversation Going: Fixing 162 out of 337 bugs for 0.42 each using ChatGPTcited by 125
- 2024Debug like a Human: A Large Language Model Debugger via Verifying Runtime Execution Step-by-stepcited by 123
- 2023Chain of Code: Reasoning with a Language Model-Augmented Code Emulatorcited by 122
- 2023RLTF: Reinforcement Learning from Unit Test Feedbackcited by 112
- 2023Self-Edit: Fault-Aware Code Editor for Code Generationcited by 111
- 2024DebugBench: Evaluating Debugging Capability of Large Language Modelscited by 75
- 2021Break-It-Fix-It: Unsupervised Learning for Program Repaircited by 71
- 2022Parsel: Algorithmic Reasoning with Language Models by Composing Decompositionscited by 63
- 2024NExT: Teaching Large Language Models to Reason about Code Executioncited by 61
- 2024What's Wrong with Your Code Generated by Large Language Models? An Extensive Studycited by 52
- 2023SelfEvolve: A Code Evolution Framework via Large Language Modelscited by 43
- 2024CYCLE: Learning to Self-Refine the Code Generationcited by 42
- 2023Conversational Automated Program Repaircited by 41
- 2024LeDex: Training LLMs to Better Self-Debug and Explain Codecited by 40
- 2020Synthesize, Execute and Debug: Learning to Repair for Neural Program Synthesiscited by 39
- 2024A Deep Dive into Large Language Models for Automated Bug Localization and Repaircited by 39
- 2023Outline, Then Details: Syntactically Guided Coarse-To-Fine Code Generationcited by 27
50 most cited of 60 All 60 (JSON)
Built on by
Citing papers per year: 2024: 2; 2025: 21; 2026: 23.
46 papers.
Sort:
By area:
- 2025SWE-Exp: Experience-Driven Software Issue Resolutioncited by 65
- 2024Lingma SWE-GPT: An Open Development-Process-Centric Language Model for Automated Software Improvementcited by 59
- 2025FEA-Bench: A Benchmark for Evaluating Repository-Level Code Generation for Feature Implementationcited by 58
- 2025SWE-Debate: Competitive Multi-Agent Debate for Software Issue Resolutioncited by 53
- 2026SWE-Pruner: Self-Adaptive Context Pruning for Coding Agentscited by 43
- 2025LongCodeZip: Compress Long Context for Code Language Modelscited by 39
- 2025SWE-QA: Can Language Models Answer Repository-level Code Questions?cited by 38
- 2025Pruning the Unsurprising: Efficient LLM Reasoning via First-Token Surprisalcited by 32
- 2025CODESIM: Multi-Agent Code Generation and Problem Solving through Simulation-Driven Planning and Debuggingcited by 31
- 2026SWE-Explore: Benchmarking How Coding Agents Explore Repositoriescited by 21
- 2025debug-gym: A Text-Based Environment for Interactive Debuggingcited by 19
- 2025EvoC2Rust: A Skeleton-guided Framework for Project-Level C-to-Rust Translationcited by 18
34 more
- 2026In Line with Context: Repository-Level Code Generation via Context Inliningcited by 18
- 2026Reasoning in Trees: Improving Retrieval-Augmented Generation for Multi-Hop Question Answeringcited by 13
- 2026SWE-MeM: Learning Adaptive Memory Management for Long-Horizon Coding Agentscited by 13
- 2024LLMs as Continuous Learners: Improving the Reproduction of Defective Code in Software Issuescited by 10
- 2025Execution Guided Line-by-Line Code Generationcited by 10
- 2026EffiSkill: Agent Skill Based Automated Code Efficiency Optimizationcited by 9
- 2025TestForge: Feedback-Driven, Agentic Test Suite Generationcited by 8
- 2025Enhancing LLM Code Generation: A Systematic Evaluation of Multi-Agent Collaboration and Runtime Debugging for Improved Accuracy, Reliability, and Latencycited by 8
- 2026Dockerless: Environment-Free Program Verifier for Coding Agentscited by 8
- 2026Test vs Mutant: Adversarial LLM Agents for Robust Unit Test Generationcited by 7
- 2025ReCode: Improving LLM-based Code Repair with Fine-Grained Retrieval-Augmented Generationcited by 6
- 2025RepoDebug: Repository-Level Multi-Task and Multi-Language Debugging Evaluation of Large Language Modelscited by 5
- 2026VimRAG: Navigating Massive Visual Context in Retrieval-Augmented Generation via Multimodal Memory Graphcited by 5
- 2026SWE-Bench ProMax: Benchmarking Agents on Large-Scale Multilingual Code Refactoringcited by 5
- 2025NL-Debugging: Exploiting Natural Language as an Intermediate Representation for Code Debuggingcited by 4
- 2026Code Is More Than Text: Uncertainty Estimation for Code Generationcited by 4
- 2025MLDebugging: Towards Benchmarking Code Debugging Across Multi-Library Scenarioscited by 3
- 2025Fed-SE: Federated Self-Evolution for Privacy-Constrained Multi-Environment LLM Agentscited by 3
- 2026LLM Agents Can See Code Repositoriescited by 3
- 2026Repo0: Design-Driven Zero-to-All Code Generationcited by 3
- 2025Effective LLM Code Refinement via Property-Oriented and Structurally Minimal Feedbackcited by 2
- 2025HyperAgent: Leveraging Hypergraphs for Topology Optimization in Multi-Agent Communicationcited by 2
- 2025SLMFix: Leveraging Small Language Models for Domain Specific Language Error Fixing with Reinforcement Learningcited by 2
- 2025Analyzing Code Injection Attacks on LLM-based Multi-Agent Systems in Software Developmentcited by 2
- 2026ClassEval-Pro: A Cross-Domain Benchmark for Class-Level Code Generationcited by 2
- 2026SWE-Pruner Pro: The Coder LLM Already Knows What to Prunecited by 2
- 2026The Architecture of Errors: From Universal Impossibility to Patch-Local LLM Reliabilitycited by 1
- 2026ParaTempo: Efficient Parallel Reasoning via Temporal Confidencecited by 1
- 2026Deep Learning-based Method for Expressing Knowledge Boundary of Black-Box LLMcited by 0
- 2026SolidCoder: Bridging the Mental-Reality Gap in LLM Code Generation through Concrete Executioncited by 0
- 2026ShredBench: Evaluating the Semantic Reasoning Capabilities of Multimodal LLMs in Document Reconstructioncited by 0
- 2026DecompRL: Solving Harder Problems by Learning Modular Code Generationcited by 0
- 2026DeepRepoQA: Code Repository Question Answering with Deep Agent Explorationcited by 0
- 2026GraphAHA: Graph-Based Adaptive Search with Heterogeneous Actions for Test-Time Code Generationcited by 0
- 2026GraphAHA: Graph-Based Adaptive Search with Heterogeneous Actions for Test-Time Code Generation11 Sep 2026
- 2026DeepRepoQA: Code Repository Question Answering with Deep Agent Exploration25 Aug 2026
- 2026Repo0: Design-Driven Zero-to-All Code Generation20 Aug 2026
- 2026ParaTempo: Efficient Parallel Reasoning via Temporal Confidence17 Aug 2026
- 2026SWE-Bench ProMax: Benchmarking Agents on Large-Scale Multilingual Code Refactoring10 Aug 2026
- 2026SWE-Pruner Pro: The Coder LLM Already Knows What to Prune20 Jul 2026
- 2026DecompRL: Solving Harder Problems by Learning Modular Code Generation2 Jul 2026
- 2026Dockerless: Environment-Free Program Verifier for Coding Agents26 Jun 2026
- 2026SWE-MeM: Learning Adaptive Memory Management for Long-Horizon Coding Agents26 Jun 2026
- 2026LLM Agents Can See Code Repositories12 Jun 2026
- 2026Code Is More Than Text: Uncertainty Estimation for Code Generation8 Jun 2026
- 2026SWE-Explore: Benchmarking How Coding Agents Explore Repositories5 Jun 2026
34 more
- 2026The Architecture of Errors: From Universal Impossibility to Patch-Local LLM Reliability28 May 2026
- 2026ClassEval-Pro: A Cross-Domain Benchmark for Class-Level Code Generation29 Apr 2026
- 2026ShredBench: Evaluating the Semantic Reasoning Capabilities of Multimodal LLMs in Document Reconstruction26 Apr 2026
- 2026SolidCoder: Bridging the Mental-Reality Gap in LLM Code Generation through Concrete Execution20 Apr 2026
- 2026EffiSkill: Agent Skill Based Automated Code Efficiency Optimization29 Mar 2026
- 2026VimRAG: Navigating Massive Visual Context in Retrieval-Augmented Generation via Multimodal Memory Graph13 Feb 2026
- 2026Deep Learning-based Method for Expressing Knowledge Boundary of Black-Box LLM11 Feb 2026
- 2026Test vs Mutant: Adversarial LLM Agents for Robust Unit Test Generation8 Feb 2026
- 2026SWE-Pruner: Self-Adaptive Context Pruning for Coding Agents23 Jan 2026
- 2026Reasoning in Trees: Improving Retrieval-Augmented Generation for Multi-Hop Question Answering16 Jan 2026
- 2026In Line with Context: Repository-Level Code Generation via Context Inlining1 Jan 2026
- 2025Analyzing Code Injection Attacks on LLM-based Multi-Agent Systems in Software Development26 Dec 2025
- 2025Fed-SE: Federated Self-Evolution for Privacy-Constrained Multi-Environment LLM Agents9 Dec 2025
- 2025SLMFix: Leveraging Small Language Models for Domain Specific Language Error Fixing with Reinforcement Learning24 Nov 2025
- 2025HyperAgent: Leveraging Hypergraphs for Topology Optimization in Multi-Agent Communication12 Oct 2025
- 2025LongCodeZip: Compress Long Context for Code Language Models1 Oct 2025
- 2025SWE-QA: Can Language Models Answer Repository-level Code Questions?18 Sep 2025
- 2025RepoDebug: Repository-Level Multi-Task and Multi-Language Debugging Evaluation of Large Language Models4 Sep 2025
- 2025ReCode: Improving LLM-based Code Repair with Fine-Grained Retrieval-Augmented Generation2 Sep 2025
- 2025Pruning the Unsurprising: Efficient LLM Reasoning via First-Token Surprisal8 Aug 2025
- 2025EvoC2Rust: A Skeleton-guided Framework for Project-Level C-to-Rust Translation6 Aug 2025
- 2025SWE-Exp: Experience-Driven Software Issue Resolution31 Jul 2025
- 2025SWE-Debate: Competitive Multi-Agent Debate for Software Issue Resolution31 Jul 2025
- 2025Effective LLM Code Refinement via Property-Oriented and Structurally Minimal Feedback23 Jun 2025
- 2025MLDebugging: Towards Benchmarking Code Debugging Across Multi-Library Scenarios15 Jun 2025
- 2025Execution Guided Line-by-Line Code Generation12 Jun 2025
- 2025NL-Debugging: Exploiting Natural Language as an Intermediate Representation for Code Debugging21 May 2025
- 2025Enhancing LLM Code Generation: A Systematic Evaluation of Multi-Agent Collaboration and Runtime Debugging for Improved Accuracy, Reliability, and Latency4 May 2025
- 2025debug-gym: A Text-Based Environment for Interactive Debugging27 Mar 2025
- 2025TestForge: Feedback-Driven, Agentic Test Suite Generation18 Mar 2025
- 2025FEA-Bench: A Benchmark for Evaluating Repository-Level Code Generation for Feature Implementation9 Mar 2025
- 2025CODESIM: Multi-Agent Code Generation and Problem Solving through Simulation-Driven Planning and Debugging8 Feb 2025
- 2024LLMs as Continuous Learners: Improving the Reproduction of Defective Code in Software Issues21 Nov 2024
- 2024Lingma SWE-GPT: An Open Development-Process-Centric Language Model for Automated Software Improvement1 Nov 2024
- 2024Lingma SWE-GPT: An Open Development-Process-Centric Language Model for Automated Software Improvementcited by 59
- 2026SWE-Pruner: Self-Adaptive Context Pruning for Coding Agentscited by 43
- 2025CODESIM: Multi-Agent Code Generation and Problem Solving through Simulation-Driven Planning and Debuggingcited by 31
- 2026SWE-Explore: Benchmarking How Coding Agents Explore Repositoriescited by 21
- 2025debug-gym: A Text-Based Environment for Interactive Debuggingcited by 19
- 2026SWE-MeM: Learning Adaptive Memory Management for Long-Horizon Coding Agentscited by 13
- 2026EffiSkill: Agent Skill Based Automated Code Efficiency Optimizationcited by 9
- 2025TestForge: Feedback-Driven, Agentic Test Suite Generationcited by 8
- 2025Enhancing LLM Code Generation: A Systematic Evaluation of Multi-Agent Collaboration and Runtime Debugging for Improved Accuracy, Reliability, and Latencycited by 8
- 2026Dockerless: Environment-Free Program Verifier for Coding Agentscited by 8
- 2026Test vs Mutant: Adversarial LLM Agents for Robust Unit Test Generationcited by 7
- 2026SWE-Bench ProMax: Benchmarking Agents on Large-Scale Multilingual Code Refactoringcited by 5
12 most cited of 19 All 19 (JSON)
- 2026DeepRepoQA: Code Repository Question Answering with Deep Agent Exploration25 Aug 2026
- 2026Repo0: Design-Driven Zero-to-All Code Generation20 Aug 2026
- 2026SWE-Bench ProMax: Benchmarking Agents on Large-Scale Multilingual Code Refactoring10 Aug 2026
- 2026SWE-Pruner Pro: The Coder LLM Already Knows What to Prune20 Jul 2026
- 2026Dockerless: Environment-Free Program Verifier for Coding Agents26 Jun 2026
- 2026SWE-MeM: Learning Adaptive Memory Management for Long-Horizon Coding Agents26 Jun 2026
- 2026LLM Agents Can See Code Repositories12 Jun 2026
- 2026SWE-Explore: Benchmarking How Coding Agents Explore Repositories5 Jun 2026
- 2026EffiSkill: Agent Skill Based Automated Code Efficiency Optimization29 Mar 2026
- 2026Test vs Mutant: Adversarial LLM Agents for Robust Unit Test Generation8 Feb 2026
- 2026SWE-Pruner: Self-Adaptive Context Pruning for Coding Agents23 Jan 2026
- 2025Analyzing Code Injection Attacks on LLM-based Multi-Agent Systems in Software Development26 Dec 2025
12 newest of 19 All 19 (JSON)
- 2025SWE-Debate: Competitive Multi-Agent Debate for Software Issue Resolutioncited by 53
- 2025Pruning the Unsurprising: Efficient LLM Reasoning via First-Token Surprisalcited by 32
- 2026Reasoning in Trees: Improving Retrieval-Augmented Generation for Multi-Hop Question Answeringcited by 13
- 2026ParaTempo: Efficient Parallel Reasoning via Temporal Confidencecited by 1
- 2026ShredBench: Evaluating the Semantic Reasoning Capabilities of Multimodal LLMs in Document Reconstructioncited by 0
- 2026GraphAHA: Graph-Based Adaptive Search with Heterogeneous Actions for Test-Time Code Generationcited by 0
- 2026GraphAHA: Graph-Based Adaptive Search with Heterogeneous Actions for Test-Time Code Generation11 Sep 2026
- 2026ParaTempo: Efficient Parallel Reasoning via Temporal Confidence17 Aug 2026
- 2026ShredBench: Evaluating the Semantic Reasoning Capabilities of Multimodal LLMs in Document Reconstruction26 Apr 2026
- 2026Reasoning in Trees: Improving Retrieval-Augmented Generation for Multi-Hop Question Answering16 Jan 2026
- 2025Pruning the Unsurprising: Efficient LLM Reasoning via First-Token Surprisal8 Aug 2025
- 2025SWE-Debate: Competitive Multi-Agent Debate for Software Issue Resolution31 Jul 2025
- 2025SWE-Exp: Experience-Driven Software Issue Resolutioncited by 65
- 2025FEA-Bench: A Benchmark for Evaluating Repository-Level Code Generation for Feature Implementationcited by 58
- 2025LongCodeZip: Compress Long Context for Code Language Modelscited by 39
- 2025SWE-QA: Can Language Models Answer Repository-level Code Questions?cited by 38
- 2025EvoC2Rust: A Skeleton-guided Framework for Project-Level C-to-Rust Translationcited by 18
- 2026In Line with Context: Repository-Level Code Generation via Context Inliningcited by 18
- 2024LLMs as Continuous Learners: Improving the Reproduction of Defective Code in Software Issuescited by 10
- 2025Execution Guided Line-by-Line Code Generationcited by 10
- 2025RepoDebug: Repository-Level Multi-Task and Multi-Language Debugging Evaluation of Large Language Modelscited by 5
- 2025NL-Debugging: Exploiting Natural Language as an Intermediate Representation for Code Debuggingcited by 4
- 2026Code Is More Than Text: Uncertainty Estimation for Code Generationcited by 4
- 2025MLDebugging: Towards Benchmarking Code Debugging Across Multi-Library Scenarioscited by 3
12 most cited of 19 All 19 (JSON)
- 2026DecompRL: Solving Harder Problems by Learning Modular Code Generation2 Jul 2026
- 2026Code Is More Than Text: Uncertainty Estimation for Code Generation8 Jun 2026
- 2026The Architecture of Errors: From Universal Impossibility to Patch-Local LLM Reliability28 May 2026
- 2026ClassEval-Pro: A Cross-Domain Benchmark for Class-Level Code Generation29 Apr 2026
- 2026SolidCoder: Bridging the Mental-Reality Gap in LLM Code Generation through Concrete Execution20 Apr 2026
- 2026Deep Learning-based Method for Expressing Knowledge Boundary of Black-Box LLM11 Feb 2026
- 2026In Line with Context: Repository-Level Code Generation via Context Inlining1 Jan 2026
- 2025SLMFix: Leveraging Small Language Models for Domain Specific Language Error Fixing with Reinforcement Learning24 Nov 2025
- 2025LongCodeZip: Compress Long Context for Code Language Models1 Oct 2025
- 2025SWE-QA: Can Language Models Answer Repository-level Code Questions?18 Sep 2025
- 2025RepoDebug: Repository-Level Multi-Task and Multi-Language Debugging Evaluation of Large Language Models4 Sep 2025
- 2025EvoC2Rust: A Skeleton-guided Framework for Project-Level C-to-Rust Translation6 Aug 2025
12 newest of 19 All 19 (JSON)