Precise Debugging Benchmark: Is Your LLM Debugging or Regenerating Code?

Miaosen Chai, Wang Bill Zhu, Shangshang Wang, Yejia Liu, Song Bian, Honghua Dong, Willie Neiswanger, Robin JiaNeurIPS 2026 Evaluations and Datasets Track Poster 2026

TL;DR

When asked to debug broken code, frontier LLMs often cheat: instead of finding the bug and fixing it, they rewrite the entire program from scratch. This paper introduces Precise Debugging Benchmarking (PDB), a framework and two new benchmarks that measure edit-level precision and bug-level recall alongside unit-test pass rates. The results reveal that models with >76% unit-test pass rates often have <45% edit precision—meaning they are regenerating code, not debugging it.

What Problem Does This Paper Address?

Real-world software engineering is dominated by debugging and maintenance, not writing code from scratch. In a production codebase, rewriting an entire file to fix a one-line bug is costly, risky, and a nightmare to review.

Yet existing debugging benchmarks only check whether the final code passes unit tests. Under that rule, a model that surgically fixes a single broken condition gets the exact same score as a model that nukes the whole function and regenerates it. Unit-test-only evaluation also hides partial progress: fixing two out of three bugs in a program scores zero, just like fixing none.

Figure 1: Real example from GPT-5.2 debug- ging a binary search program, where the model rewrites the entire solution. Green lines mark pre- cise edits; gray lines highlight over-edits.

Methods

PDB is a dataset-agnostic pipeline that turns any existing coding benchmark into a precision-aware debugging testbed in two stages:

  1. Bug Generation & Composition: Starting from a ground-truth solution, LLMs inject single-line or contiguous multi-line bugs across five defect categories (such as Algorithm, Assignment, and Checking). Each bug is verified to fail unit tests. To build harder multi-bug programs without creating tangles, PDB composes independent bugs using a minimum line-spacing ("stride") constraint and filters out non-atomic multi-line edits.
  2. Precision-Aware Evaluation: Beyond standard Pass@1 unit-test accuracy, PDB introduces two metrics:
  3. Edit-level precision: Measures what fraction of the model's edited lines were actually necessary to fix the bugs, using a small tolerance ($\epsilon$) and a unit-test-based redundancy check to strip out harmless over-edits.
  4. Bug-level recall: Measures what fraction of the independent bugs in the program were successfully resolved.
Figure 2: PDB pipeline. Generation: LLMs first synthesize and verify single-line bugs from existing coding datasets, which are then composed into multi-bug programs. Evaluation: Automated debugging systems are evaluated on these programs using both unit-test accuracy and edit-level precision and bug-level recall.

Datasets

Using the PDB pipeline, the authors release two benchmarks:

  • PDB-SINGLE: 5,751 challenging examples containing 1 to 4 independent single-line bugs, sourced from BigCodeBench and LiveCodeBench.
  • PDB-WILD: 484 examples of contiguous multi-line and repository-level bugs, sourced from BigCodeBench, LiveCodeBench, and 6 repositories (32 files) from SWE-smith.

Key Insights and Ideas

  • High pass rates mask massive over-editing: Models like GPT-5.1-Codex and DeepSeek-V3.2-Thinking pass over 76% of unit tests on PDB-SINGLE, yet their edit precision is below 45%. They are relying on brute-force regeneration rather than fault localization.
  • Model rankings flip under precision: When evaluated on edit precision, models that look weaker on unit tests—like Qwen3-Coder-480B (70.3% unit score, 65.8% precision)—substantially outperform pass-oriented models.
  • Iterative and agentic loops don't fix it: Giving models multiple revision attempts or direct unit-test error feedback improves unit-test pass rates and recall, but edit precision stays flat or even drops. Even Claude-Code with execution feedback only achieves ~50% precision.
  • Prompting helps, but isn't enough: When the authors remove the "make minimal edits" instruction, precision craters across the board (Gemini-2.5-Pro drops by 40 percentage points). Current models rely on instruction-following to limit edits rather than having intrinsic edit awareness.

Key Results

  • PDB-SINGLE: Claude-Sonnet-4.5 (71.8% precision, 81.4% recall, 75.7% unit) and Gemini-2.5-Pro (71.4% precision, 83.5% recall, 78.1% unit) lead the pack, though no model exceeds 72% precision. DeepSeek-V3.2-Thinking (45.0% precision, 79.0% unit) and GPT-5.1-Codex (39.7% precision, 76.1% unit) show the sharpest gap between functional correctness and precision.
  • PDB-WILD: The same pattern holds on multi-line and repo-level bugs. Claude-Opus-4.7 and Gemini-3.1-Pro-Preview both reach 77.8% precision, while GPT-5.5 achieves an 84.3% unit score but only 60.9% precision.
  • Human alignment: On a manual inspection of 240 cases, PDB's edit-level precision strongly correlates with expert Python developers' judgments (Spearman $\rho = 0.72$).
Figure 3: (a) Data distribution of PDB-SINGLE. (b). Precision, recall, and unit score on the PDB- SINGLE set. Blue indicates better performance, while red indicates worse.

Limitations and Future Work

  • Test-suite adequacy: PDB relies on upstream unit tests to verify bugs and fixes, which the authors estimate yields a 1.85% false-positive rate (patches that pass tests despite being functionally incorrect).
  • Multi-line atomicity: For large repository-level blocks (up to 30 lines in SWE-smith), checking every possible subset of partial repairs is computationally infeasible, so only single-line partial repairs are checked.
  • Closing the training loop: Because even frontier models struggle to precisely fix bugs they themselves generated, the authors suggest using PDB's precision-aware metrics as reward signals in post-training pipelines to teach models genuine fault localization and minimal editing.

Summary updated

BibTeX
@inproceedings{chai2026precise,
  author = {Miaosen Chai and Wang Bill Zhu and Shangshang Wang and Yejia Liu and Song Bian and Honghua Dong and Willie Neiswanger and Robin Jia},
  title = {{Precise Debugging Benchmark: Is Your LLM Debugging or Regenerating Code?}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=qBuOrD12Mv},
}
Figure