Precise Debugging Benchmark (PDB)
- The paper demonstrates that PDB distinguishes precise, localized edits from broad regenerations by enforcing edit-level and bug-level metrics.
- PDB transforms coding datasets into debugging benchmarks with verified buggy programs, ground-truth edit scripts, and precision-aware evaluations.
- The framework emphasizes fault localization and targeted repairs, underscoring the need for diff-aware decoding and edit-aware training in automated debugging.
Searching arXiv for the benchmark paper and a few related benchmarks mentioned in the provided data. Precise Debugging Benchmark (PDB) is a framework for evaluating whether an automated debugging system performs localized, minimal repair or instead regenerates broad portions of a program while still passing unit tests (Zhu et al., 19 Apr 2026). Unlike code completion, debugging requires a model to localize faults in an existing program and apply targeted edits that preserve the program’s broader structure and intent. PDB was introduced to make that distinction measurable: it automatically converts a coding dataset with ground-truth solutions and tests into a debugging benchmark with verified buggy programs, edit-level ground truth, and precision-aware metrics. The framework releases two evaluation benchmarks, PDB-Single-Hard and PDB-Multi, and reports that frontier models can attain unit-test pass rates above while still exhibiting edit-level precision below , even under explicit minimal-debugging instructions (Zhu et al., 19 Apr 2026).
1. Motivation and problem definition
PDB is motivated by the claim that debugging is not the same problem as code completion. Code completion asks a model to synthesize a working program from a prompt; debugging requires fault localization and targeted correction within an existing artifact. The benchmark paper argues that frontier LLMs often default to regeneration during debugging: they rewrite large portions, or even the entirety, of a program to pass unit tests. In real-world software maintenance, such broad rewrites are costly to review, risk new regressions, and obscure intent (Zhu et al., 19 Apr 2026).
A central criticism of pass-rate–only evaluation is that it conflates three distinct behaviors: a minimal, localized fix; a whole-program rewrite; and hard-coded outputs that merely satisfy the tests. It also suppresses partial progress. Under a binary pass/fail regime, fixing one of three bugs is scored identically to fixing none if the final program still fails. PDB therefore reframes evaluation from final program correctness alone to edit granularity and bug granularity. This suggests a shift from asking whether a model can produce a passing program to asking whether it can repair the injected faults and only those faults (Zhu et al., 19 Apr 2026).
The framework’s scope is automated debugging systems that receive a buggy program and problem description , optionally with tests and execution feedback, and return a revision . A binary test function , defined over a test suite , determines whether the revised program passes all tests (Zhu et al., 19 Apr 2026).
2. Formalization and precision-aware metrics
PDB defines minimal corrections as the smallest set of line edits that makes a buggy program pass the test suite:
A line edit on line is denoted , and a bug is atomic when a minimal correction consists of edits on a contiguous sequence of lines. For single-line bugs, atomicity is trivial because 0. For composed multi-bug programs, PDB further uses an independence definition: two bugs are independent if fixing one neither introduces nor removes edits required to fix the other (Zhu et al., 19 Apr 2026).
For evaluation, the ground-truth edit set is decomposed as
1
where each 2 is contiguous and non-overlapping. A mapping function 3 pairs each ground-truth edit block with the closest predicted edits in 4. For each bug 5, PDB constructs a pseudo-revision 6 by combining all other ground-truth fixes with the model’s mapped edits for bug 7; if 8, the candidate is treated as semantically correct for that bug (Zhu et al., 19 Apr 2026).
The two central metrics are edit-level precision and bug-level recall:
9
The intuition is explicit in the benchmark design. Precision weights each semantically correct bug by its ground-truth minimal edit size 0, normalized by the model’s total edits 1. Recall measures the fraction of injected bugs that are actually resolved. PDB then introduces an 2-relaxed essential-edit variant to avoid rewarding wholesale regeneration while not enforcing exact minimality. It allows up to 3 edited lines per bug and trims the predicted edits to an essential subset via unit tests:
4
5
In the reported experiments, 6 for single-line bugs and 7 for multi-line blocks. The paper denotes 8 as edit-level precision 9 and recall as bug-level recall 0. Unit-test pass rate, reported as Pass@1, is retained but is not part of the composite edit-aware metrics (Zhu et al., 19 Apr 2026).
A worked contrast in the benchmark paper illustrates the difference. For a single off-by-one bug in binary search, a one-line exact fix yields 1, 2, and Pass@13. A regeneration-heavy solution that rewrites ten lines and still passes tests can have 4 but 5. Both pass the tests, but only the former is counted as a precise debug (Zhu et al., 19 Apr 2026).
3. Benchmark construction pipeline
PDB starts from a coding benchmark that provides a task description 6, a ground-truth program 7, and tests 8. It first retains only verified programs that pass all unit tests. From those seeds, it synthesizes atomic bugs and then composes them into multi-bug programs (Zhu et al., 19 Apr 2026).
Single-line atomic bug synthesis uses one of three line-level operations: insertion, deletion, and substitution. The pipeline applies a rule-based filter to avoid unsafe deletions, such as indentation errors, and non-editable lines, such as function headers. It then randomly selects one operation type, one defect category from an ODC-aligned taxonomy, and one compatible editable line. An LLM from a generator pool consisting of GPT-5.1-Codex, Claude-4.5-Sonnet, and Gemini-2.5-Pro is prompted to modify exactly one line. Only programs that fail unit tests are retained, which enforces bug validity and reproducibility (Zhu et al., 19 Apr 2026).
For multi-line atomic bugs, the framework selects a contiguous block size 9, one primary and two auxiliary defect categories, and a valid contiguous block of lines. Because atomicity is not guaranteed by multi-line editing, PDB enforces it by enumerating all partial fixes that revert strict subsets of the modified lines back to the ground truth and keeping the bug only if all such partial fixes still fail unit tests. The full block is therefore treated as an atomic unit of correction (Zhu et al., 19 Apr 2026).
Bug composition produces more difficult multi-bug programs. For each task and target bug count 0, PDB samples 1 distinct block edits from the generated bug pool and imposes a stride constraint 2, defined as a minimum line distance between blocks, to encourage independence and avoid degenerate interactions. For each 3, it repeats the composition 4 times and records only composed programs that satisfy independence constraints. It then subsamples at most 5 buggy programs per bug count per task to prevent over-representation of easy or prolific tasks (Zhu et al., 19 Apr 2026).
The injected bugs are organized with an ODC-style taxonomy spanning Assignment, Checking, Algorithm, Build/Package/Merge, and Timing/Serialization. Subcategories listed in the benchmark description include Off-by-One Error, Negation Error, Missing/Incomplete Checks, Wrong Math Expression, Modifying While Iterating, Invalid API Call, and Serialization Issue. These categories guide bug injection prompts and are intended to ensure diversity. Manual analysis reports that interaction violations are rare, at approximately 6 (Zhu et al., 19 Apr 2026).
4. Released benchmarks and benchmark parameters
PDB releases two benchmarks that share the same precision-aware evaluation logic but differ in bug granularity and composition constraints (Zhu et al., 19 Apr 2026).
| Benchmark | Key configuration | Dataset details |
|---|---|---|
| PDB-Single-Hard | Single-line bugs; up to 7; 8; 9, 0, 1; stride 2 | Initial size 7,591; final size 5,751 after filtering “easy” instances; sources: BigCodeBench and LiveCodeBench; Python |
| PDB-Multi | Contiguous multi-line bug blocks; up to 3; 4; 5; same 6, 7, 8; stride 9 | 256 examples; programs exceeding 35 lines; Python |
PDB-Single-Hard is designed as the main challenging benchmark for single-line bugs. Its final version is obtained after model-based filtering of “easy” instances defined as cases with perfect precision, recall, and unit score for at least 7 of 9 evaluated models under 0. PDB-Multi is substantially smaller and restricted to programs exceeding 35 lines so that block independence can be maintained more reliably (Zhu et al., 19 Apr 2026).
The evaluation protocol supports both single-pass LLMs and agentic systems. Systems receive the task description and buggy program, optionally the tests and execution feedback, and produce a patch 1 and revised program 2. PDB aligns predicted edits with ground-truth blocks via 3, constructs bug-specific pseudo-revisions, evaluates semantic correctness via 4, computes 5 and 6, and reports Pass@1. The metrics are micro-averaged across bug counts (Zhu et al., 19 Apr 2026).
5. Empirical findings, reranking, and failure modes
On PDB-Single-Hard with 7, edit-level precision and bug-level recall rerank frontier models relative to unit-test pass rates. Claude-4.5-Sonnet reports Precision 8, Recall 9, Unit 0; Gemini-2.5-Pro reports Precision 1, Recall 2, Unit 3; Qwen3-Coder-480B reports Precision 4, Recall 5, Unit 6. By contrast, DeepSeek-V3.2-Thinking reaches Unit 7 with Precision 8, and GPT-5.1-Codex reaches Unit 9 with Precision 0. The paper interprets this as regeneration-heavy behavior: high unit scores can coexist with low edit-level precision, whereas Qwen3-Coder-480B exhibits lower unit score but more targeted editing. Precision also generally shows a negative correlation with unit-test score as bug count increases (Zhu et al., 19 Apr 2026).
The same pattern persists on PDB-Multi with 1. Claude-4.5-Sonnet reports Precision 2, Recall 3, Unit 4; Gemini-2.5-Pro reports Precision 5, Recall 6, Unit 7; GPT-5.1-Codex reports Precision 8, Recall 9, Unit 0. Multi-line contexts are harder overall, but the misalignment between unit-test ranking and edit precision remains: GPT-5.1-Codex has the highest unit score among the three reported models yet less than half the precision of Claude-4.5-Sonnet (Zhu et al., 19 Apr 2026).
The paper also evaluates iterative and agentic debugging on 500 BigCodeBench-derived instances. Iterative debugging allows up to three revision attempts per problem with access to previous failed outputs; agentic debugging allows up to three attempts with unit tests and execution feedback each step. Both settings improve unit-test pass rates and 1 relative to single-shot, but edit-level precision does not improve and sometimes degrades. Even a stronger agentic system, exemplified by Claude-Code in the figure, achieves only approximately 2 precision with feedback, which the paper interprets as evidence that feedback is often treated as a coarse success signal that triggers broader rewrites rather than localized edits (Zhu et al., 19 Apr 2026).
Error analysis is central to the benchmark’s interpretation. Among passing cases, 3 have recall 4; when precision is imperfect, the reported causes are 5 redundant guard checks, 6 modifications to correct code blocks, 7 correct but non-minimal edits, 8 complete rewrites, and 9 fixes to bugs missing in ground-truth references. Among failing cases with partially correct edits, 00 are under-repair 01, 02 are imprecise repair 03, and 04 are regressive repair 05, meaning new bugs cause failures. Freeform debugging prompts, without a minimal-edit constraint, substantially reduce precision and recall across all models; Gemini-2.5-Pro shows an approximately 06 absolute drop in precision, and GPT-5.1-Codex fails to reach 07 precision (Zhu et al., 19 Apr 2026).
6. Position within debugging evaluation, implications, and limitations
PDB is positioned against prior debugging and program-repair benchmarks such as Defects4J, DebugBench, MDEval, LiveCodeBench, and CodeEditorBench, which are described as relying primarily on unit-test pass/fail or coarse metrics. The stated point of departure is not bug realism alone, but verified edit structure: PDB synthesizes atomic bugs with edit scripts, composes multi-bug programs under independence constraints, and evaluates patches with 08 and 09. The reported effect is that model rankings can invert relative to unit tests, exposing regeneration and over-editing that would otherwise remain hidden (Zhu et al., 19 Apr 2026).
The implications for training and inference are explicit. The benchmark paper recommends incorporating edit-aware training signals, optimizing for fault localization and minimizing effective edit sets, and using diff-level supervision rather than only whole-program correctness. It also recommends diff-aware and AST-guided decoding to constrain proposals to targeted hunks, and integrating essential-edit discovery at inference to prune superfluous edits while preserving semantic correctness. A plausible implication is that PDB is less a replacement for Pass@1 than a correction to it: unit tests remain necessary, but they are insufficient as a sole measure of debugging capability (Zhu et al., 19 Apr 2026).
The framework also has stated limitations. The independence assumption can be violated in broader software systems, although observed violations are approximately 10 with the reported stride constraints and filtering. The current pipeline targets Python; adapting it to other languages is said to require modifications to in-context prompts and language-specific subcategories rather than to the core design. Edit-aware metrics can also miss semantically equivalent fixes, and the benchmark identifies robust semantic edit evaluation as an open problem. About 11 of recall 12 cases arise because a single bug admits multiple minimal correct fixes, which the paper’s 13 and 14 procedures mitigate but do not eliminate (Zhu et al., 19 Apr 2026).
A terminological ambiguity is worth noting. The acronym “PDB” also appears in a distinct benchmark specification for compiler-generated debugging information, where the primary score is program-level variable value coverage 15 over source lines rather than edit-aware code-repair quality. That separate usage is grounded in source-line coverage metrics for DWARF debugging information and addresses optimized binaries, not LLM debugging behavior (Stinnett et al., 2024).