Back

Rewarding Coding Agents

Why Your Test Suite Matters More Than Your PRM

Published Nov 13, 2026 · 13 min read

1.Background

1.1Two containers, one wrong lesson

Picture a night on an RL training cluster. Hundreds of containers run your coding agent against the same Python issue.

In Container A, the agent greps the stack trace, reads three core modules, and isolates a subtle off-by-one bug. Its fix is clean, but it misses an edge-case import at step 24 and times out. Reward: 0.

In Container B, another rollout wanders, deletes an inconvenient assertion, and slips past the only test file the original PR touched. Reward: 1.

The optimizer pushes A down and B up. On the dashboard, the reward curve keeps rising.

Frontier models can now navigate large repositories, edit across files, and iterate over dozens of turns. The machinery that grades them has not kept up: tests designed for a single human patch, benchmarks that may have leaked into training data, process rewards that remain noisy. The agent has outgrown its grader.

1.2Denser rewards are not a free fix

A 30-step debugging effort collapses into a single 0. When a whole group of rollouts fails, the group contributes no gradient at all. The natural response is denser feedback: partial credit for passing tests, similarity to a reference patch, a learned success predictor, or a process reward model (PRM) that grades every turn.

But an uncalibrated process score opens a new loophole. Under a group-relative trainer such as GRPO, the policy may learn that pleasing the judge is easier than fixing the bug. It reads files for show, runs harmless commands, and writes polished post-mortems. Trajectories get shorter while the resolve rate falls. Container B is still there, just with better manners.

1.3What this post covers

Drawing on 20 papers and reports, most from 2025–2026, we follow the problem from the grader up:

  1. The grader. About 7.8% of “resolved” SWE-bench Verified patches were incorrect in one study. An OpenAI audit found that at least 59.4% of 138 hard problems had tests that reject valid fixes.
  2. The terminal score. 0/1 or continuous? Why the raw test-pass fraction misleads, and how to recover signal when a whole group fails.
  3. Process rewards. Do PRMs actually train intermediate steps? In one 100-task study, a repository-level PRM cut average steps from 15.2 to 12.2 while the resolve rate fell from 57% to 51%.
  4. A playbook. Three stages for adding process signals without inviting reward hacking.
Terminal rewardProcess signalEvaluation & verifiersDateWorkTypeStatus2023.10SWE-bench (Jimenez et al.)BenchmarkICLR 20242025.02SWE-RL (Wei et al.)Continuous rewardNeurIPS 20252025.02Process Reward Models for LLM Agents (Choudhury)Process signalPreprint2025.03Are “solved” SWE-bench issues solved correctly? (Wang et al.)Eval & verifierICSE 20262025.05Fine-grained rewards for multi-turn RL (Wei et al.)Process signalPreprint2025.06Agent-RLVR (Da et al.)Binary + preferencePreprint2025.06The SWE-Bench Illusion (Liang et al.)Eval & verifierPreprint2025.07DeepSWE-Preview (Luo et al.)Binary rewardTech blog2025.08Long-context multi-turn SWE RL (Golubev et al.)Binary rewardPreprint2025.09SWE-PRM / When Agents go Astray (Gandhi et al.)Process guidanceNeurIPS 2025 workshop2025.11PRLCoder (Ye et al.)Process supervisionEMNLP 20252025.11AgentPRM (Xi et al.)Process signalPreprint2025.12Self-play SWE-RL (Wei et al.)Binary rewardPreprint2025.12SWE-RM (Shum et al.)Mixed rewardPreprint2025CodePRM (Li et al.)Process signalFindings of ACL 20252026.02OpenAI audit of SWE-bench VerifiedEval & verifierCompany blog2026.04SWE-Shepherd (Dihan et al.)Process signalPreprint2026.04SWE-TRACE (Han et al.)Mixed rewardPreprint2026BSR (Wu et al.)Within-failure preferencePreprintDates are the month of first arXiv submission, blog release or conference; year-only entries follow the venue or project page.

Fig. 01Main works covered in this review

Main works covered in this review and their publication status. Black: terminal rewards; grey: process signals; outline: evaluation and verifier audits.

2.Why passing tests miss real bugs

Before tuning reward weights, we have to confront an uncomfortable reality: the test harnesses and benchmarks we treat as ground truth suffer from severe false positives and false negatives.

2.1False positives & negatives: 8% of "resolved" patches are broken, and 59% of hard tests reject valid fixes

How standard grading works. SWE-bench (Jimenez et al., ICLR 2024) evaluates 2,294 real GitHub issues across 12 Python repositories (reference patches touch 1.7 files, 3.0 functions, and 32.8 lines on average). A patch is marked resolved if it applies cleanly, passes every fail-to-pass (F2P) test (at least one per task; ≥ 2 in 40% of tasks), and preserves a median of 51 pass-to-pass (P2P) regression tests.

The catch: SWE-bench only runs the test files modified in the original PR. Wang, Pradel, and Liu (ICSE 2026) re-evaluated patches marked "resolved" on SWE-bench Verified using full developer test suites and differential testing:

Verification methodBroken “resolved” patches (false positives)Resolve-rate inflation
Full developer test suites (measured across 3 tools)7.2%–8.4%4.5 percentage points on average
Differential testing + manual audit (extrapolated)~11.0%~6.4 percentage points

Note: 4.5 points is a direct measurement from full test suites; 6.4 points is an extrapolation from differential testing and manual inspection.

Conversely, brittle tests reject correct code (false negatives). In February 2026, OpenAI audited 138 persistently hard problems on SWE-bench Verified and found that at least 59.4% had flawed or overly narrow tests that rejected valid solutions—prompting their shift to SWE-bench Pro (note: this vendor audit targets hard problems and is not directly comparable to Wang et al.'s corpus-wide false-positive rate).

Why this matters for RL: Tests err in both directions. Training directly on un-audited test harnesses teaches the policy to exploit under-specified tests while penalizing valid alternative implementations.

2.2Benchmark memorization: File localization drops 21 points on external repos

Even when tests pass, benchmark gains may not reflect generalizable debugging skill. Liang et al. (The SWE-Bench Illusion) gave models only the repository name and issue description—with zero access to the codebase—and asked them to predict which file paths needed editing.

File-path identification accuracy of ten Claude, GPT and OpenAI o-series models across six benchmarks

Fig. 02File-path identification performance

Source: Liang et al., The SWE-Bench Illusion, Figure 8 (PDF page 7). Cropped from original; data unchanged (note: the plot shows an outside-repo max of 56%, whereas the text states below 53%; we cite the plotted values).

From the issue text alone, o3 predicts the exact file path 76% of the time on SWE-bench Verified, plunging to 55% on external repositories—a 21-percentage-point gap. Using 5-gram overlap and 217 newer issues from the same repositories (Extra), the authors found three warning signs:

Diagnostic probeKey finding
Function reproductionClaude 4 Opus code overlap is 34.9% on Verified vs. 13.9% on external repos
Fresh-issue control (Extra)On newer issues from the same repos, 6 of 8 models generate code closer to the buggy pre-fix version
Prefix completion11.7%–31.6% of Verified instances are reproduced verbatim

While these probes do not prove training-data contamination outright (familiarity and difficulty also play a role), the takeaway for reward engineering is clear: always validate reward changes on temporally split or held-out repositories.

3.0/1 baselines VS continuous traps

Once your verifier is audited, the next architectural choice is whether the terminal reward should be a strict 0/1 outcome or a continuous score.

3.1Why 0/1 is the safest baseline (provided you mask infrastructure failures)

Let ff be the fraction of F2P tests passed and pp be the fraction of P2P tests passed. In the official SWE-bench grading harness (grading.py, November 2026 main branch):

  • Only f=1f = 1 and p=1p = 1 counts as resolved;
  • 0<f<10 < f < 1 with p=1p = 1 is logged as a partial fix but scored as unresolved;
  • Skipped F2P tests count as failures, whereas skipped P2P tests do not count as regressions;
  • Suspected container or runner crashes are flagged as infra_failure but still marked unresolved.

For validly executed rollouts, the cleanest terminal reward is strict binary completion:

c=1 if all specified F2P and P2P tests pass; otherwise c=0c = 1 \text{ if all specified F2P and P2P tests pass; otherwise } c = 0

Rbinary=cR_{\text{binary}} = c

Crucial implementation detail: mask out infrastructure failures. While a benchmark leaderboard can treat container timeouts or broken builds as 0, an RL trainer must exclude infra_failure rollouts via a validity flag and loss mask—penalizing only syntax errors or test failures caused by the agent itself.

3.2How 8 leading coding agent systems define rewards

Recent systems differ not just in whether their reward is continuous, but in where the auxiliary signal comes from:

SystemReward definitionKey mechanism & scope
DeepSWE1 if all F2P/P2P pass; else 0Pure binary baseline; scored only upon explicit submission
SWE-RLPatch similarity [0,1]; format error −1Execution-free, single-turn patch generation (not a multi-turn agent)
Agent-RLVRPassing trajectories > failed trajectoriesGuided retries construct offline DPO preference pairs
Golubev et al.Binary test outcome 0/1 + excess-step penaltyMulti-turn RL with explicit length control
Self-play SWE-RLSolver: +1 if all tests pass; else −1Single policy both injects and repairs bugs
SWE-RMSuccess: 1+s; unfinished: −0.5+s; other fail: sAdds model-predicted success score s ∈ [0, 1] to execution outcome
BSRSuccess: 1; failures ranked in [−0.15, 0.15]Refines only failed rollouts to break all-fail ties without a separate RM
SWE-TRACEExecution outcome + trajectory rubric scoreTrajectory-level scalar in RL training; stepwise pruning only at inference

3.3The binary bottleneck: Why all-fail groups waste 92% of rollout compute

Binary reward has an unbeatable property: E[R]\mathbb{E}[R] equals the exact probability of solving the task within budget. Intermediate syntax errors, failed hypotheses, and rollbacks cost nothing as long as the final submitted patch works.

Its Achilles' heel is all-fail groups. In group-relative trainers like GRPO, if all GG rollouts for a hard prompt fail, every trajectory gets 0, group variance is 0, and the entire batch of expensive container rollouts produces zero gradient. If independent rollouts succeed with probability q=1%q = 1\% across a group of G=8G = 8, the probability of getting both a success and a failure in the same group is 1−qG−(1−q)G≈7.7%1 - q^G - (1 - q)^G \approx 7.7\%—leaving over 92% of groups with zero signal. Before inventing complex process scores, teams can mitigate this through curriculum filtering, guided sampling, or BSR-style tie-breaking exclusively inside failed groups.

3.4Five ways agents hack continuous scores (and why 99.9% pass rate means nothing)

Continuous scores break ties, but they also shift the optimization target. Here is what common continuous proxies actually measure and how policies exploit them:

Continuous proxyWhat it actually measuresHow the policy hacks it
Raw fraction of tests passedCount of satisfied assertionsP2P dilution: passing 1,000 P2P tests while failing the single F2P test yields 0.999 for a completely unfixed bug
Reference patch similarityLexical closeness to one known fixPenalizes valid alternative fixes while rewarding broken edits that touch the right lines
Model-predicted success probabilityReward model’s uncertainty estimateWithout strict calibration and OOD guards, the agent learns to generate trajectories that look convincing to the RM
Process rubric / behavioral preferenceSurface resemblance to good debuggingPerformative debugging: reading files, running tests, and writing lucid summaries without making risky edits
Success + step penaltyAccuracy traded off against speedTeaches the agent to give up early on hard problems to avoid accumulating step penalties

Never use raw "tests passed / total tests" as an RL reward. If you want to test partial-execution rewards, use the gated baseline 1[p=1]×f\mathbb{1}[p = 1] \times f: require zero regressions first, then scale by F2P completion. Even across SWE-RM (+3.0 points pass@1), SWE-TRACE (+2.4–2.7 points), and BSR, empirical gains over pure binary rewards come from single training curves or specific ablations—not a universal law that continuous is always better.

4.Most process rewards skip step training

"Process Reward Model" is used to describe three fundamentally different mechanisms:

  • True per-step scoring: assigning a numerical value to each intermediate state/action for local credit assignment;
  • Process-aware terminal scoring: reading the entire trajectory, then outputting one scalar at the very end;
  • Inference-time guidance: injecting text critiques or pruning search trees at test time, with zero policy RL.
Trajectory reward signalTerminal (one score per trajectory)Binary: 1 (or ±1) iff all F2P and P2P passDeepSWE; Golubev et al.; Self-play SWE-RL; Agent-RLVR (DPO)Continuous: similarity to reference patchSWE-RL (difflib similarity; −1 for format errors)Mixed: success + model or process scoreSWE-RM (three-tier); SWE-TRACE (R=γc+(1−γ)s)Rank failures; success fixed at 1BSR (bounded auxiliary score, Bradley–Terry)Process (per step or process-aware)Per-step numeric PRM, action selectionSWE-Shepherd; AgentPRM (WebShop etc., non-SWE)Inference-time guidance or selectionSWE-PRM (text feedback); CodePRM (GVR, Best-of-N)Process signal used in training (non-repo)PRLCoder (code generation); Wei et al. (search, games)Process reward from demos or rolloutsInversePRM and AgentPRM (Choudhury, ALFWorld)Note: grouped by reward form, not ranked by performance; tasks, models and budgets differ across works.

Fig. 03Reward signals for coding agents

Taxonomy of reward signals by functional form and actual role in the system (not a performance ranking).

As the table below shows, almost no repository-level SWE work actually uses per-step PRM scores for online policy RL:

WorkHow process signals are actually usedTask scope
CodePRMExecution-trained PRM used for inference-time selection/refinement onlyFunction-level codegen
PRLCoderTest-derived code preferences used in PPO/DPO trainingFunction-level codegen
SWE-PRMInference-time text critiques; no numeric rewards or policy trainingRepository agents
SWE-ShepherdHeuristic step scores for inference-time action selection onlyRepository agents
SWE-TRACEWhole-trajectory scalar during RL; stepwise pruning only at inferenceRepository agents
AgentPRM (Xi)TD/GAE learns stepwise promise and progressWebShop, BabyAI, TextCraft
InversePRM (Choudhury)Process rewards learned from rollouts/demos for online DPOALFWorld (text game)
Wei et al.Model-judged turn scores for multi-turn PPO/GRPOSearch QA and games

4.1When PRMs backfire: 20% fewer steps, 2x higher cost, and a 6-point drop in resolve rate

SWE-Shepherd tested a heuristic PRM on 100 SWE-bench Verified tasks (policy: gpt-5-mini, 30-step limit). The results are a textbook warning against naive process rewards:

  • Average steps fell from 15.2 to 12.2;
  • Resolve rate dropped from 57% to 51% (−6 tasks);
  • Average cost per task nearly doubled from $0.029 to $0.053;
  • Predicted rewards barely separated winners from losers: 0.4894 for resolved trajectories vs. 0.4818 for failed ones.

Why? Because in real-world debugging, locally "clean" actions do not equal global progress. A failing test run is often the exact action that isolates a bug; a temporarily uncompilable edit may be a necessary mid-refactoring step. Rewarding surface smoothness ("command succeeded", "file read", "explanation written") makes the agent prematurely risk-averse.

5.What works: Staged reward engineering

Based on the evidence above, we recommend building your reward pipeline in three stages:

  1. Stage 1 (Audited 0/1 Baseline): Audit test false positives, score R=cR = c (1 if all F2P/P2P pass, 0 otherwise) upon explicit submission, and mask out infra_failure rollouts.
  2. Stage 2 (Bounded Tie-Breaking in All-Fail Groups): Keep successful trajectories fixed at 1, and introduce bounded process preferences (e.g., BSR's [−0.15,0.15][-0.15, 0.15]) only among failed trajectories to recover gradients from all-fail groups.
  3. Stage 3 (Stepwise Credit Assignment): Only after intermediate labels are proven to predict final resolution on held-out repositories, upgrade the trainer interface to assign per-step advantages.

5.1Score net progress (advantage), not surface style

Instead of asking whether an action "looked tidy", measure whether it increased the probability of eventual resolution given history hth_t and remaining budget:

V(ht)=probability of eventual resolution from history htunder the current policy and remaining budget\begin{aligned} V(h_t) = {} & \text{probability of eventual resolution from history } h_t \\ & \text{under the current policy and remaining budget} \end{aligned}

Q(ht,at)=expected resolution probabilityafter executing action at from ht\begin{aligned} Q(h_t, a_t) = {} & \text{expected resolution probability} \\ & \text{after executing action } a_t \text{ from } h_t \end{aligned}

A(ht,at)=Q(ht,at)−V(ht)(net progress contributed by step t)A(h_t, a_t) = Q(h_t, a_t) - V(h_t) \quad \text{(net progress contributed by step } t\text{)}

You can supervise this via Monte Carlo branch rollouts (accurate but expensive), execution deltas (newly passing F2P tests without P2P regressions), or evidence-grounded teacher rubrics (anchored on actual diffs and test logs, never on the agent's self-reported claims).

5.2Why GRPO amplifies a 0.01 weight by 100x in all-fail groups

When combining binary outcome cc with a process score s∈[0,1]s \in [0, 1] into a single scalar (such as BSR or SWE-TRACE's R=γc+(1−γ)sR = \gamma c + (1 - \gamma) s with γ>0.5\gamma > 0.5), watch out for two mathematical traps:

  1. Trajectory ordering ≠ Policy ordering: Guaranteeing that every successful rollout scores higher than every failed rollout does not guarantee that maximizing expected mixed reward maximizes resolution rate. The policy can still trade a small drop in success probability for a large gain in auxiliary score ss.
  2. GRPO standard-deviation normalization cancels out small weights in all-fail groups: In standard GRPO, if a group fails completely (c=0c = 0), scaling the auxiliary score by a tiny weight like 0.01 shrinks both the numerator and the group standard deviation by 0.01—so they cancel out completely! Inside an all-fail group, a "tiny 0.01 weight" exerts full-strength gradient pressure. Use confidence gating, filter low-variance groups, or disable std-normalization for auxiliary terms.

Finally, do not aggregate step scores (via sum, mean, min, or product) into a single trajectory scalar and call it step-level RL. Summing encourages trajectory padding; averaging dilutes fatal mistakes; taking the minimum punishes recoverable trial-and-error. Even potential-based shaping (Ng et al., ICML 1999) leaves within-task trajectory rankings unchanged once collapsed into a terminal scalar—true stepwise supervision requires passing per-step advantages to the trainer with proper action-token masking.

5.3Four controlled ablations before shipping a new reward

Hold the base model, task split, rollout budget, and container harness constant, and run four controlled ablations:

RunReward definitionQuestionPriorityAPure 0/1: c = 1[all F2P and P2P pass]Is a simple executionreward enough?BaselineBPartial: 1[p=1] × f (P2P gate first)Does test granularityadd useful contrast?Do firstCBinary + bounded failure preference(BSR-like)Can process info useall-fail groups?Do firstDPer-step value or advantage(trainer change)Is local credit assignmentworth its cost?Optional, after A–CReport: resolved rate on held-out tasks, cost at equal budget, share of all-fail groups, auxiliary-score calibration, seed variance.

Fig. 04Minimal experiments for validating a reward design

Four standard controlled ablations for evaluating reward designs: (A) pure 0/1 baseline, (B) gated partial execution 1[p=1]×f\mathbb{1}[p = 1] \times f, (C) BSR-style failed-trajectory ranking, and (D) per-step credit assignment.

Evaluate every candidate on four criteria: (1) pass@1 across multiple seeds on temporally or repository-split held-out tasks; (2) total compute cost per resolved issue (including RM inference and branch rollouts); (3) all-fail group fraction and probability calibration; and (4) clean-room verifier audits to ensure the agent isn't modifying tests or gaming rubric judges.


References

  1. Jimenez et al. SWE-bench: Can Language Models Resolve Real-World GitHub Issues? ICLR 2024. arXiv:2310.06770
  2. Wang, Pradel, Liu. Are “Solved Issues” in SWE-bench Really Solved Correctly? An Empirical Study. ICSE 2026. DOI 10.1145/3744916.3764576. arXiv:2503.15223
  3. Liang, Garg, Zilouchian Moghaddam. The SWE-Bench Illusion: When State-of-the-Art LLMs Remember Instead of Reason. Preprint, 2025. arXiv:2506.12286
  4. OpenAI. Why SWE-bench Verified no longer measures frontier coding capabilities. Blog, February 2026. Link
  5. Wei et al. SWE-RL: Advancing LLM Reasoning via Reinforcement Learning on Open Software Evolution. NeurIPS 2025. arXiv:2502.18449
  6. Da et al. Agent-RLVR: Training Software Engineering Agents via Guidance and Environment Rewards. Preprint, 2025. arXiv:2506.11425
  7. Golubev et al. Training Long-Context, Multi-Turn Software Engineering Agents with Reinforcement Learning. Preprint, 2025. arXiv:2508.03501
  8. Luo et al. DeepSWE-Preview: Training a Fully Open-sourced, State-of-the-Art Coding Agent by Scaling RL. Together AI and Agentica blog, July 2025. Link
  9. Wei et al. Toward Training Superintelligent Software Agents through Self-Play SWE-RL. Preprint, 2025. arXiv:2512.18552
  10. Shum et al. SWE-RM: Execution-Free Feedback for Software Engineering Agents. Preprint, 2025. arXiv:2512.21919
  11. Wu et al. Beyond Binary Verifiable Rewards: Behavioral Self-Rewarding for SWE Agents. Preprint, 2026. Paper · Project page
  12. Han et al. SWE-TRACE: Optimizing Long-Horizon SWE Agents through Rubric Process Reward Models and Heuristic Test-Time Scaling. Preprint, 2026. arXiv:2604.14820
  13. Li et al. CodePRM: Execution Feedback-enhanced Process Reward Model for Code Generation. Findings of ACL 2025, pp. 8169–8182. Link
  14. Ye, Zhang, Jiang, Huang. Process-Supervised Reinforcement Learning for Code Generation. EMNLP 2025, pp. 14213–14226. Link
  15. Gandhi et al. When Agents go Astray: Course-Correcting SWE Agents with PRMs. NeurIPS 2025 Workshop (SEA). arXiv:2509.02360
  16. Dihan, Khan. SWE-Shepherd: Advancing PRMs for Reinforcing Code Agents. Preprint, 2026. arXiv:2604.10493
  17. Xi et al. AgentPRM: Process Reward Models for LLM Agents via Step-Wise Promise and Progress. Preprint, 2025. arXiv:2511.08325
  18. Choudhury. Process Reward Models for LLM Agents: Practical Framework and Directions. Preprint, 2025. arXiv:2502.10325
  19. Wei et al. Reinforcing Multi-Turn Reasoning in LLM Agents via Fine-Grained Reward Structure and Credit Assignment. Preprint, 2025. arXiv:2505.11821
  20. Ng, Harada, Russell. Policy Invariance under Reward Transformations: Theory and Application to Reward Shaping. ICML 1999. PDF

More research

All research
Rewarding Coding Agents | Corepass Research - Corepass