Beyond Binary Verifiable Rewards: Behavioral Self-Rewarding for SWE Agents

Learn from how an agent debugs, even when the tests fail.
A richer training signal, anchored in executable verification.

Research preprint · 2026

Yiran Wu1,*Andrew ZhaoYurui Chang1Qingyun Wu2Xuan Feng3

1 Pennsylvania State University2 AG2AI3 Microsoft Research

* Work partially done during an internship at Microsoft Research.

14B + 32B model scales+2.6 pp 14B average accuracy · 400 steps+2.34 pp 14B Live Lite Pass@3 · 400 steps

The intuition

Not all failures are equal.

Three attempts. The same test outcome. Different debugging quality.

One issue · Three trajectoriesWith BSR: rewards distinguish behavior
AMeaningful progress
InspectEditTestFail
BPartial progress
InspectEdit…Fail
CUnproductive exploration
SearchRepeatRepeatFail
Compare & rank

Same task.
Same verifier outcome.

A > B > C

Training reward

A
+0.15
B
0.00
C
−0.15

Different rewards provide a learning signal.

Illustrative rewards for a three-failure group, using the main setting’s ±0.15 bound. Switch modes to see the learning signal that BSR adds.

Reinforcement learning with verifiable rewards (RLVR) provides reliable supervision for software engineering agents through executable tests, but binary rewards cannot distinguish attempts with different debugging quality. Behavioral Self-Rewarding (BSR) reuses the current policy to compare observable behavior among trajectories from the same task with the same verifier outcome. It aggregates pairwise preferences into task-local scores and maps them to bounded auxiliary rewards that preserve the verifier-defined pass/fail ordering. This adds supervision from already-collected trajectories without new environment interactions or a separately trained reward model. Experiments on SWE-bench Verified and SWE-bench-Live Lite show consistent gains across the evaluated Qwen3-14B and Qwen3-32B configurations, with additional improvements on Terminal-Bench 2.1.

How BSR works

From verified outcomes to behavioral rewards

A reward-refinement layer for group-relative reinforcement learning.

BSR framework: sample trajectories, verify outcomes, then reuse the policy to compare failed attempts using the task, traces, reference patch, and behavioral rubric. Pairwise preferences yield bounded rewards; the passing attempt retains reward 1.
BSR compares behavior within a verifier-outcome group and adds bounded rewards. The values shown are illustrative; the main setting uses a failure-reward bound of ±0.15.
01

Roll out & verify

Sample multiple agent trajectories for one repository issue. Execute tests, then group attempts by their pass or fail outcome.

02

Compare behavior

The same policy model judges pairs within an outcome group using the task, reference patch, and a rubric focused on observable debugging behavior.

03

Rank & refine

Fit task-local Bradley–Terry scores. A soft deadzone suppresses small differences; centering and bounding control the auxiliary reward.

04

Update the agent

Add the behavioral signal to the verifier reward and train. The main BSR setting refines only failures, keeping success at reward 1.

Preserving correctness

R = Rverifier + rbehavior

Behavior adds nuance; executable verification defines success. Choosing amplitudes with a₀ + a₁ < 1 preserves the pass/fail reward ordering.

Core method details Explore the comparisons, ranking, and reward mapping

Core method details

How BSR keeps self-judgment grounded

The judge adds contrast only where the executable verifier cannot.

01

Compare locally

Trajectories are compared only within the same task and verifier-outcome bucket. A good failure and a good success remain separate concepts.

02

Judge observable behavior

The post-rollout judge sees compact action traces, the task, verifier outcome, and reference patch. The acting policy never sees the reference patch.

03

Weight clear preferences

Pairwise judgments use slight, clear, or strong preference weights. Pair order is randomized to reduce positional artifacts.

04

Denoise and bound

Task-local Bradley–Terry scores are normalized, passed through a soft deadzone, centered, and bounded before they become rewards.

Pairwise judgmentspreferred trajectory + strength
Task-local rankingweighted Bradley–Terry scores
Noise controlnormalize + soft deadzone
Bounded rewardrᵢ = aᵧqᵢ, qᵢ ∈ [−1, 1]

Experimental results

Results across SWE benchmarks

Trained on 4,578 filtered R2E-Gym tasks. Evaluated on SWE-bench Verified and SWE-bench-Live Lite.

Qwen3-14B · 400 steps · Verified

+2.6pp

Average accuracy

32.1% 34.7%

Qwen3-14B · 400 steps · Live Lite

+2.34pp

Pass@3

11.33% 13.67%

Both model scales · Both SWE benchmarks

Consistent gains

BSR improves average accuracy and Pass@3 in every reported model and training-budget setting.

Main results Paper Table 1; all metrics in percent, higher is better.
ModelStepsMethodSWE-bench VerifiedSWE-bench-Live Lite
Avg. accuracy ± std.Pass@3Avg. accuracy ± std.Pass@3
Qwen3-14B270Verifier-only RL31.0 ± 0.545.07.11 ± 0.1913.33
BSR ours33.2 ± 1.446.68.67 ± 0.8815.33
Qwen3-14B400Verifier-only RL32.1 ± 1.146.66.33 ± 0.3411.33
BSR ours34.7 ± 1.048.08.11 ± 1.0213.67
Qwen3-32B270Verifier-only RL34.4 ± 1.748.87.67 ± 0.8812.33
BSR ours35.5 ± 0.850.68.56 ± 0.5113.67

SWE-bench Verified contains 500 tasks; SWE-bench-Live Lite contains 300. Evaluation uses temperature 1, a maximum of 50 agent steps, and three runs. Standard deviations are across runs; Pass@3 is the fraction of tasks solved by at least one of the three attempts. Values are from the reported checkpoints, rather than independently maximizing each metric. “pp” denotes percentage points.

Additional evaluation · Terminal-Bench 2.1

Paper Table 8: 89 tasks with three independent evaluation trials. BSR improves both reported metrics in all three settings.

Terminal-Bench 2.1 All metrics in percent; higher is better.
ModelStepsMethodAvg. accuracyPass@3
Qwen3-14B270Verifier-only RL7.1214.61
BSR7.8715.73
Qwen3-14B400Verifier-only RL6.7414.61
BSR8.2415.73
Qwen3-32B270Verifier-only RL4.878.99
BSR5.6213.48

Learning curves

Training signal and SWE-bench Verified average accuracy throughout 270 training steps.

Mean critic score during training for Qwen3-14B. The BSR curve remains above the verifier-only baseline through most of training.
Training signalMean critic score · EMA smoothed
Qwen3-14B average accuracy across 270 training steps. BSR peaks at 33.2 percent, compared with 31.0 percent for the verifier-only baseline.
EvaluationAverage accuracy · SWE-bench Verified
Mean critic score during training for Qwen3-32B. BSR and the verifier-only baseline both rise over training, with BSR generally higher.
Training signalMean critic score · EMA smoothed
Qwen3-32B average accuracy across 270 training steps. BSR peaks at 35.5 percent, compared with 34.4 percent for the verifier-only baseline.
EvaluationAverage accuracy · SWE-bench Verified

Behavior analysis

How does BSR change the agent’s behavior?

Across 1,500 Qwen3-14B evaluation trajectories per method on SWE-bench Verified, the aggregate pattern is consistent with stronger investigation, follow-through, and verification.

InvestigateRead evidenceEditTest
Reference file viewed before first edit

73.3%74.8%

Search-to-edit conversion

46.5%49.4%

Post-edit test rate

30.1%31.1%

Average searches

4.744.06

Average errors

13.3812.76

Average runtime

1,132 s1,069 s

Ablations

Three checks on where the gains come from

Qwen3-14B on SWE-bench Verified. Select any study. The view advances every 3 seconds and pauses while you hover or interact with it.

Citation

@article{wu2026beyond,
  title = {Beyond Binary Verifiable Rewards: Behavioral Self-Rewarding for SWE Agents},
  author = {Wu, Yiran and Zhao, Andrew and Chang, Yurui and Wu, Qingyun and Feng, Xuan},
  journal = {arXiv preprint arXiv:2610.12598},
  year = {2026}
}