[Paper Review] UniDebugger: Hierarchical Multi-Agent Framework for Unified Software Debugging
This paper proposes FixAgent, a unified, LLM-based multi-agent framework that leverages hierarchical agent synergy inspired by rubber duck debugging to perform end-to-end software debugging. By specializing agents for fault localization, repair generation, and post-analysis—each explaining their reasoning in detail—it achieves 97.26% correctness on QuixBugs and fixes 79 out of 80 bugs, including 9 previously unfixed ones, outperforming existing tools by 1.9X in plausible patches with minimal sampling.
Software debugging is a time-consuming endeavor involving a series of steps, such as fault localization and patch generation, each requiring thorough analysis and a deep understanding of the underlying logic. While large language models (LLMs) demonstrate promising potential in coding tasks, their performance in debugging remains limited. Current LLM-based methods often focus on isolated steps and struggle with complex bugs. In this paper, we propose the first end-to-end framework, FixAgent, for unified debugging through multi-agent synergy. It mimics the entire cognitive processes of developers, with each agent specialized as a particular component of this process rather than mirroring the actions of an independent expert as in previous multi-agent systems. Agents are coordinated through a three-level design, following a cognitive model of debugging, allowing adaptive handling of bugs with varying complexities. Experiments on extensive benchmarks demonstrate that FixAgent significantly outperforms state-of-the-art repair methods, fixing 1.25$ imes$ to 2.56$ imes$ bugs on the repo-level benchmark, Defects4J. This performance is achieved without requiring ground-truth root-cause code statements, unlike the baselines. Our source code is available on https://github.com/AcceptePapier/UniDebugger.
Motivation & Objective
- Address the limitations of traditional and LLM-based debugging tools, particularly imperfect fault localization, struggles with complex logic bugs, and context ignorance.
- Overcome the dependency on pre-identified bug locations and improve repair quality by integrating reasoning and context comprehension into the debugging pipeline.
- Enable end-to-end, unified debugging through synergistic LLM agents that simulate human debugging practices like rubber ducking.
- Enhance LLMs' ability to reason about program logic and context without fine-tuning or access to historical bug-fix data.
Proposed method
- Design a hierarchical multi-agent system with three specialized LLM agents: a fault localizer, a program repairer, and an analyzer, each simulating rubber duck debugging by providing detailed, step-by-step explanations.
- Implement key variable tracking to focus agents on critical logic elements and improve reasoning accuracy on complex bugs.
- Introduce program context comprehension by incorporating function definitions, variable scopes, and external library information into the prompt engineering to reduce context ignorance.
- Enable agent synergy where the repairer can correct the localizer’s mistakes by patching code beyond the initially identified suspicious lines.
- Use a universal prompt design based on rubber ducking principles to guide LLMs toward deeper reasoning without retraining or fine-tuning.
- Apply a cloze-style infilling paradigm for repair generation, where the model predicts missing code segments with full context, improving semantic coherence.
Experimental results
Research questions
- RQ1Can a unified, multi-agent LLM framework outperform existing state-of-the-art APR tools in both correctness and coverage without relying on pre-identified bug locations?
- RQ2To what extent can rubber ducking-inspired reasoning improve LLMs’ ability to detect and fix complex logic bugs compared to standard prompting?
- RQ3How effective is the synergy between specialized agents in mitigating the impact of imperfect fault localization on downstream repair quality?
- RQ4Can program context comprehension significantly reduce context ignorance and improve repair accuracy in LLM-based debugging?
- RQ5Does the proposed framework generalize to unseen or previously unfixed bugs, especially when trained on minimal data and without fine-tuning?
Key findings
- FixAgent fixes 79 out of 80 bugs on the QuixBugs dataset, achieving a correctness rate of 97.26%, with 9 previously unfixed bugs now successfully repaired.
- On the Codeflaws dataset, FixAgent generates 1.9 times more plausible patches than the best-performing repair tool, even without any bug location information.
- FixAgent increases the number of correct and plausible fixes by approximately 20% on average compared to its base LLM across multiple models, demonstrating the effectiveness of the agent synergy and reasoning design.
- The framework significantly reduces overfitting issues common in existing APR tools, as evidenced by high generalization performance on newly collected, unseen data.
- The method achieves strong performance with less than 0.6% sampling time, indicating high efficiency and low computational overhead.
- The use of rubber ducking-inspired prompting improves reasoning depth and logic understanding, enabling LLMs to handle complex logic errors more effectively than standard prompting.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.