PreciseCoder: Faithful and Generalizable Debugging Beyond Unit-Test Rewards
Abstract
PreciseCoder improves code repair by rewarding precise, localized edits rather than only unit-test passage, reducing unnecessary changes and improving generalization across model sizes.
Reinforcement learning (RL) from unit tests is the common recipe for post-training code models, but a unit test only asks whether the final program passes. We analyze what this unit-test-only reward teaches a model during debugging and find that, while it raises pass rates, it also teaches the model to edit more and to hallucinate bugs in code that is already correct. We introduce PreciseCoder, a training algorithm that augments the unit-test reward with a signal for semantically verified, localized edits, which correlates with smaller edits and higher pass rates. On 4B, 9B, and 27B models, PreciseCoder reduces the average number of edit lines from 7-15to 3 at a pass rate on par with unit-test-only training. Trained only on single-line bugs, PreciseCoder can generalize to repository-level program repair, where it resolves more issues with smaller patches. Its precision also transfers from weaker to stronger models: given the reasoning trace of a 9B PreciseCoder model, frontier models such as GPT-5.6 Sol and Qwen3.8-Max gain 4.6-12.4 points in edit precision with no additional training. Linguistic analysis of the thinking traces shows that our reward encourages the model to reason about individual lines, name the buggy ones, and form consistent bug hypotheses.
Community
PreciseCoder: Faithful and Generalizable Debugging Beyond Unit-Test Rewards
This is an automated message from the Librarian Bot. I found the following papers similar to this paper.
The following papers were recommended by the Semantic Scholar API
- When Models Edit Too Much: On the Fidelity of Minimal Code Edits (2026)
- Teaching Agents to Code Reliably (2026)
- ExecCritic: Learn to Test, Test to Improve for Coding Agents (2026)
- CROCODIL: Cross-Model Code Editing with LLMs (2026)
- CodeLift: Your Test Suite Is Secretly a Dense SWE Curriculum (2026)
- Cross-Benchmark Transfer from RL on Agentic Coding Tasks (2026)
- ExecuCritic: Calibrated Critic Shaping for Code Generation with Verifiable Rewards (2026)
Please give a thumbs up to this comment if you found it helpful!
If you want recommendations for any Paper on Hugging Face checkout this Space
You can directly ask Librarian Bot for paper recommendations by tagging it in a comment: @librarian-bot recommend
Get this paper in your agent:
hf papers read 2610.18755 Don't have the latest CLI?
curl -LsSf https://hf.co/cli/install.sh | bash Models citing this paper 3
PreciseCoder/PreciseCoder-4B
Datasets citing this paper 1
PreciseCoder/pdb-test
Spaces citing this paper 0
No Space linking this paper
Collections including this paper 0
No Collection including this paper