NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

DebugBench: Evaluating Debugging Capability of Large Language Models

Runchu Tian, Yining Ye, Yujia Qin, Xin Cong, Yankai Lin, Yinxu Pan, Yesai Wu, Haotian Hui, Weichuan Liu, Zhiyuan Liu, Maosong Sun

Introduction

In the modern software development lifecycle, debugging is often more resource-intensive than initial code generation, accounting for up to 50% of a developer's time and 75% of total project budgets. While Large Language Models (LLMs) have demonstrated impressive capabilities in generating code from natural language prompts, their ability to act as autonomous debuggers—identifying and fixing errors in existing code—remains a critical frontier.

Researchers have introduced DebugBench, a massive benchmark designed to rigorously evaluate the debugging proficiency of LLMs. By providing a large-scale, diverse, and leakage-resistant environment, DebugBench reveals a significant "logic gap" in current AI capabilities, where models excel at fixing syntax but struggle with the underlying intent of the code.

The Limitations of Existing Benchmarks

Prior to DebugBench, evaluating LLM debugging was hampered by three primary issues:

  1. Data Leakage: Many benchmarks consisted of code snippets that were likely included in the models' training data, leading to inflated performance metrics.
  2. Small Scale: Datasets often contained only 40 to 150 examples, which is insufficient for statistically significant evaluation.
  3. Lack of Diversity: Evaluations frequently focused on simple syntax errors rather than the complex logical bugs that characterize real-world software challenges.

Methodology: The Bug Implantation Pipeline

To overcome these hurdles, the authors developed a novel data construction method called Bug Implantation. This process involved four key stages:

  1. Source Collection: The team scraped 3,206 clean code solutions from LeetCode problems released after July 2022. This cutoff date ensures that the solutions were not part of the training sets for models like GPT-4 or Llama-3.
  2. GPT-4 as an "Infector": Instead of manually writing bugs, the researchers used GPT-4 to systematically inject 18 different types of bugs—including syntax, reference, and logic errors—into the clean solutions.
  3. Quality Control: An automated pipeline verified that every "buggy" instance actually failed its original test cases. Furthermore, professional programmers were hired to manually audit hundreds of instances to ensure the synthetic bugs were realistic and solvable.
  4. Zero-Shot Evaluation: The benchmark was used to test a variety of models, including commercial leaders (GPT-4, GPT-3.5) and prominent open-source models (Llama-3, DeepSeek-Coder), in a zero-shot setting.

Dataset Characteristics

DebugBench contains 4,253 instances across three major languages: C++, Java, and Python3. The bugs are categorized into:

  • Syntax & Reference: Missing punctuation, unclosed brackets, or undefined variables.
  • Logic: Errors in conditional statements, mathematical operations, or algorithmic flow.
  • Multiples: Complex snippets containing 2, 3, or 4 simultaneous bugs to test the model's stability under pressure.

To validate the realism of these synthetic bugs, the authors compared DebugBench against QuixBugs, a standard dataset of real-world bugs, finding that the synthetic errors closely mirrored the difficulty and characteristics of naturally occurring ones.

Key Insights and Results

The "Logic Gap"

The most striking finding is the disparity between a model's ability to fix syntax versus logic. LLMs are highly proficient at correcting grammatical errors (e.g., a missing semicolon). However, when the error involves a flaw in the execution flow or logic, performance drops sharply. This suggests that while models understand the syntax of programming languages, they still struggle to grasp the intent behind the code.

The Feedback Paradox

Providing models with runtime error messages (tracebacks) is a common strategy to improve performance. DebugBench revealed that while this feedback helps significantly with syntax and reference bugs, it can actually hinder performance on logic bugs. The models often become distracted by low-level execution details, losing sight of the high-level logical flaw.

Complexity and Scaling

As the number of bugs in a single snippet increases, LLM performance degrades exponentially. While humans maintain relatively stable performance when moving from single to multiple bugs, GPT-4’s pass rate dropped to 55.9% on "quadruple bug" instances. Overall, GPT-4 achieved a 75% pass rate across the benchmark, significantly trailing the human baseline of roughly 90%.

Open-Source Performance

Open-source models generally lagged behind their commercial counterparts. While DeepSeek-Coder-33B showed competitive results in syntax categories, most open-source models struggled with the more complex logical and multi-bug scenarios.

Conclusion and Future Directions

DebugBench establishes that debugging is a fundamentally harder task for LLMs than code generation. While there is a strong correlation between a model's writing and editing abilities, the "logic gap" remains a significant hurdle for autonomous AI developers.

Future work will focus on expanding this benchmark to repository-level debugging, where bugs may span multiple files, and exploring human-in-the-loop debugging, where LLMs act as assistants rather than standalone fixers. Additionally, evaluating the ability of LLMs to generate their own test cases will be a vital step toward truly autonomous software maintenance.

Summary updated

BibTeX
@inproceedings{tian2024debugbench,
  author = {Runchu Tian and Yining Ye and Yujia Qin and Xin Cong and Yankai Lin and Yinxu Pan and Yesai Wu and Haotian Hui and Weichuan Liu and Zhiyuan Liu and Maosong Sun},
  title = {{DebugBench: Evaluating Debugging Capability of Large Language Models}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.findings-acl.247},
}
Figure