Precise Debugging Benchmark: Is Your Model Debugging or Regenerating?

Wang Bill Zhu, Miaosen Chai, Shangshang Wang, Yejia Liu, Song Bian, Honghua Dong, Willie Neiswanger, Robin JiaarXiv 2026

TL;DR

While large language models (LLMs) excel at passing unit tests during debugging, they often do so by completely rewriting the code from scratch rather than fixing the actual bug. To expose this brute-force behavior, the authors introduce the Precise Debugging Benchmarking (PDB) framework, which evaluates models on edit-level precision and bug-level recall. The findings reveal a stark reality: frontier models frequently achieve high test pass rates but exhibit dismal editing precision, often dropping below 45%.

What Problem Does This Paper Address?

In real-world software development, debugging is rarely about rewriting an entire program. Engineers look for minimal, targeted, and intent-preserving edits to fix specific faults. This localized approach minimizes code churn, reduces the risk of introducing new regressions, and makes code reviews manageable.

However, existing debugging benchmarks evaluate models purely on a binary pass/fail metric against a suite of unit tests. This creates a loophole: an LLM can "cheat" by completely regenerating a correct solution from scratch rather than locating and fixing the specific bug in the user's code.

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.

To address this evaluation gap, this paper tackles a fundamental question: Are our models actually debugging, or are they just regenerating?

Methods

The authors introduce PDB, a dataset-agnostic framework that transforms any standard coding dataset into a precision-aware debugging benchmark.

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.

The PDB pipeline operates in two main stages:

  1. Bug Generation & Composition: PDB uses an LLM to inject realistic, atomic bugs into clean code solutions based on an Orthogonal Defect Classification (ODC) taxonomy (e.g., off-by-one errors, logical negations, or incorrect mathematical expressions). To make the tasks challenging, it composes multiple independent bugs into a single program, enforcing a "stride constraint" (minimum line distance) to ensure the bugs do not overlap or compound.
  2. Precision-Aware Evaluation: Instead of just running unit tests, PDB introduces a block-matching alignment algorithm to compare the model's proposed edits against the ground-truth minimal edits. It evaluates models using two novel metrics:
  3. Edit-level Precision: The ratio of necessary edits to the total edits made. It includes an $\epsilon$-relaxed tolerance parameter so models aren't penalized for minor stylistic changes or adding defensive guard checks.
  4. Bug-level Recall: The fraction of individual bugs successfully resolved.

Datasets

The authors constructed and released two distinct evaluation benchmarks using tasks sourced from BigCodeBench (API-heavy tasks), LiveCodeBench (competitive programming), and SWE-smith (repository-level software engineering):

  • PDB-SINGLE: Contains 5,751 challenging debugging examples centered around single-line bugs.
  • PDB-WILD: Contains 484 examples extending the evaluation to multi-line blocks and repository-level codebases.

Key Insights and Ideas

  • The Regeneration Illusion: High unit-test pass rates mask a severe lack of precision. Models like GPT-5.1-Codex and DeepSeek-V3.2-Thinking are highly "pass-oriented"—they hack the unit tests via broad, sweeping rewrites rather than surgical fixes.
  • Leaderboard Inversion: When precision is factored in, the model rankings flip entirely. For instance, Qwen3-Coder-480B achieves a lower unit test pass rate than DeepSeek-V3.2-Thinking (70.3% vs 79.0%) but demonstrates vastly superior edit precision (65.8% vs 45.0%), acting much more like a human developer.
  • The Agentic Feedback Trap: Intuitively, giving a model multiple iterative attempts or direct unit-test error feedback should help it localize bugs. However, experiments with advanced agents (including Claude-Code) show that while feedback improves functional correctness, it often degrades precision. Models treat error messages as a cue to perform even broader rewrites rather than refining their edits.

Key Results

The benchmark reveals a massive gap between functional correctness and genuine fault localization across 9 state-of-the-art models:

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.
  • Top Performers: Claude-Sonnet-4.5 and Gemini-2.5-Pro lead the pack, balancing a ~75-78% unit test score with the highest edit precision (~71-72%).
  • The Over-Editors: GPT-5.1-Codex scores the lowest precision on PDB-SINGLE at 39.7%, despite passing 76.1% of unit tests.
  • PDB-WILD Scaling: On the more complex multi-line and repository-level bugs in PDB-WILD, the precision deficit worsens. GPT-5.1-Codex's precision collapses to 30.8%, and even the advanced GPT-5.5 only manages 54.8% precision despite a competitive 71.5% unit test pass rate.

Limitations and Future Work

  • Language Limitation: The current implementation, prompt templates, and sub-category definitions are tailored exclusively to Python.
  • Diagnostic Only: The framework is currently used strictly for evaluation. The authors note that a crucial next step is incorporating PDB's precision-aware signals directly into supervised fine-tuning (SFT) or reinforcement learning (RL) loops to train models to edit minimally.
  • Semantic Equivalence: While the block-matching algorithm handles minor variations, reliably identifying and scoring completely different but equally minimal and valid semantic fixes remains an open challenge in automated code evaluation.

Summary updated

BibTeX
@misc{zhu2026precise,
  author = {Wang Bill Zhu and Miaosen Chai and Shangshang Wang and Yejia Liu and Song Bian and Honghua Dong and Willie Neiswanger and Robin Jia},
  title = {{Precise Debugging Benchmark: Is Your Model Debugging or Regenerating?}},
  year = {2026},
  eprint = {2604.17338},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2604.17338},
}
Figure