arXiv:2610.12598cs.AIOct 2026

Manuscript Offprint

arXiv:2610.12598

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

Yiran Wu, Andrew Zhao, Yurui Chang, Qingyun Wu, Xuan Feng

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Yiran Wu ∗^{*}

Pennsylvania State University

yiran.wu@psu.edu

Yurui Chang

Pennsylvania State University

yuruic@psu.edu

Andrew Zhao

andrewzhao112@gmail.com

Qingyun Wu

AG2AI

qingyun@ag2.ai

Xuan Feng

Microsoft Research

xuafeng@microsoft.com

ABSTRACT

Reinforcement learning with verifiable rewards (RLVR) provides reliable supervision for software engineering agents through executable tests, but binary rewards fail to distinguish trajectories with substantially different debugging quality. We investigate whether the current policy can judge its own trajectories and use these judgments to improve task performance without a separately trained reward model. To this end, we introduce Behavioral Self-Rewarding (BSR), a reward-refinement method that reuses the policy to compare observable debugging behavior among trajectories from the same task with the same verifier outcome. BSR aggregates pairwise preferences into task-local scores and converts them into bounded auxiliary rewards, introducing reward contrast while preserving the verifier-defined pass/fail ordering. This provides additional supervision from already-collected trajectories without requiring new environment interactions. Experiments on SWE-bench Verified and SWE-bench-Live show consistent improvements across the evaluated Qwen3-14B and Qwen3-32B configurations, supporting using the policy's own comparative judgments as a complementary learning signal for training software engineering agents.

Figure

Code

Figure

Project Page

Figure

Logs

Figure

Models

1 INTRODUCTION

Large language models are increasingly being deployed as software engineering (SWE) agents: systems that operate inside real repositories and produce patches for concrete issues through interaction with developer tools. Such repository-level software engineering requires an agent to reason under partial information while interacting with a changing repository and deciding how to proceed from the observations it gathers (Yang et al., 2024). This makes software engineering both practically important and technically demanding for language agents, while producing rich multi-step trajectories that capture how an agent approaches a problem. Recent benchmarks and systems have made this setting concrete by evaluating agents on real issue-resolution tasks with executable feedback (Jimenez et al., 2024; Xia et al., 2024; Wang et al., 2025a).

This setting is also a natural fit for reinforcement learning with verifiable rewards (RLVR), where rewards come from automatic checkers rather than learned preference models (Shao et al., 2024; Guo et al., 2025). Recent work extends RLVR from single-turn reasoning to multi-step agentic RL, where models learn from trajectories of actions and observations.

∗^{*}Work partially done during an internship at Microsoft Research.

rather than isolated final answers (Chen et al., 2025a; Wang et al., 2025b; Luo et al., 2025). Software engineering is a compelling instance because interactions are long-horizon and behaviorally complex, while final patches can often be validated through repository test suites (Pan et al., 2024; Wei et al., 2026; Jain et al., 2025; Golubev et al., 2025).

However, binary test outcomes compress rich interaction trajectories into a single success or failure signal. Failed trajectories can vary substantially in debugging quality: some locate relevant code, gather useful evidence, or make progress toward a fix, while others achieve little, yet both receive reward zero. Under group-relative objectives such as GRPO or leave-one-out PPO, rollout groups with identical verifier outcomes have zero reward variance and therefore zero outcome-derived relative advantages (Shao et al., 2024; Chen et al., 2025a). Useful distinctions among already-collected trajectories consequently remain unavailable to the reward signal. This is particularly costly for SWE agents, whose rollouts require repeated model inference and tool execution. Several recent approaches enrich verifier supervision with dense reward-model scores and learned trajectory evaluations (Tao et al., 2026; Han et al., 2026; Shum et al., 2026). These approaches demonstrate the value of supervision beyond binary outcomes, but obtain the additional signal from a separate reward model. Rather than developing another trajectory scorer, we investigate a complementary question: can the current policy itself judge its own SWE trajectories, and how can those judgments be used to improve its task performance?

Self-rewarding and LLM-as-a-judge methods motivate this question by showing that language models can provide evaluative signals for generated responses and individual reasoning steps (Yuan et al., 2024; Zheng et al., 2023; Liu et al., 2023; Zhang et al., 2025). For interactive SWE agents, the object of judgment is instead a long-horizon trajectory of search, inspection, editing, and verification. These trajectories record not only the final patch but also the evidence gathered, the actions taken in response, and the checks performed along the way. The challenge is to turn judgments about this interaction experience into useful training signals while retaining the distinction between passing and failing attempts. We therefore study a restricted judging role: the executable verifier determines the outcome of each attempt, while the current policy compares attempts at the same task that share that outcome. This asks the policy for local preferences, rather than an independent correctness decision or a globally calibrated trajectory-quality score.

To investigate this question, we introduce Behavioral Self-Rewarding (BSR), a reward-refinement method for multi-step agentic RLVR. For each software-engineering task, the policy samples multiple trajectories and receives the ordinary test-based reward. BSR partitions these trajectories into task-local verifier-outcome buckets and reuses the current policy to perform pairwise comparisons within each bucket. The comparisons follow a rubric focused on observable debugging actions and their outcomes rather than writing style or confidence. Each judgment identifies a preferred trajectory and a coarse preference-strength label, which are aggregated into task-local ranking scores. These scores are normalized and transformed into centered, bounded auxiliary rewards that supplement the verifier reward. The reward bounds ensure that every verifier-passing trajectory retains a higher reward than every verifier-failing trajectory. BSR thus combines current-policy trajectory comparison with verifier-conditioned reward refinement, using the policy's preferences directly in on-policy RL without fitting a separate trajectory reward model.

BSR integrates with group-relative RL by introducing reward contrast where binary verification provides none. In all-fail rollout groups, nonconstant auxiliary rewards can restore group-relative learning signal; in mixed-outcome groups, they provide finer distinctions among trajectories sharing an outcome. Reward refinement requires additional model inference but no new environment interactions. We evaluate BSR against verifier-only RL to test whether this self-judgment procedure improves the acting policy. Experiments cover Qwen3-14B and Qwen3-32B on SWE-bench Verified, SWE-bench-Live Lite, and Terminal-Bench 2.1. BSR improves average accuracy across the evaluated configurations on all three benchmarks, with consistent gains in Pass@3 on the two SWE benchmarks. Ablations examine the reward mapping and the choice of refined outcome buckets; failure-only refinement achieves the highest average accuracy and Pass@3 among the tested bucket configurations. In the random-reward control, using the same auxiliary reward amplitude range without trajectory rankings does not reproduce these gains. Together, these results support using the

Figure

Figure 1: Overview of Behavioral Self-Rewarding (BSR). Binary rewards provide no contrast when trajectories share the same verifier outcome, while BSR ranks them within the outcome group to recover a bounded learning signal.

current policy’s comparative judgments as an additional source of supervision for learning from repository-level interaction experience.