arXiv:2610.30284cs.LGOct 2026

Manuscript Offprint

arXiv:2610.30284

SWE-VERIFIER: Selective Verification for Cost-Efficient Coding Agents

Kaijian Zou, Vaibhav Chennareddy, Yunxiang Zhang, Naihao Deng, Longju Bai, Jiaxin Pei, Rada Mihalcea, Lu Wang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original. This text is shared under the same licence.

Abstract

Coding agents spend substantial computation generating actions and processing long interaction histories. Poor action choices can steer agents into low-value states, wasting computation and increasing API costs. Sampling and verifying alternative actions can improve the agent's decisions, but applying this procedure at every step adds substantial overhead. We introduce SWE-VERIFIER, a lightweight generative model that selectively triggers candidate sampling and verification. It scores the coding agent's proposed action to determine when additional candidate sampling is needed, then ranks the resulting actions before execution. We train SWE-VERIFIER from Qwen3.5-4B using preference data that groups contrasting actions with their resulting environment observations and rubric-guided teacher scores. Using the mini-swe-agent harness, SWE-VERIFIER improves resolution from 75.47% to 77.20% on MiniMax-M2.7 at 1.09×1.09\times cost and generalizes to DeepSeek-V4-Flash without training on its actions, improving resolution from 72.60% to 74.27% at 1.13×1.13\times cost. Across both models, SWE-VERIFIER verifies fewer than 4% of steps and achieves comparable or higher resolution than the trajectory and all-step baselines at substantially lower cost. These results demonstrate that selective candidate sampling and lightweight verification provide complementary gains in coding-agent performance and inference efficiency. Our model, code, and data are available at https://github.com/zkjzou/SWE-Verifier.

1 Introduction

Coding agents powered by large language models (LLMs) solve software-engineering tasks through sequences of actions such as repository inspection, code edits, tool execution, and validation (Jimenez et al., 2024; Yang et al., 2024; Wang et al., 2025c;

Figure

(a) Verifier calls

No verifier

Trajectory-level

All-step

Selective (ours)

Figure

(b) Δ\Delta Resolve (pts)

(c) Total cost (×)

Figure 1: Verification strategies for coding agents on the full 500-task SWE-Bench Verified set. (a) Trajectory-level verification selects among completed rollouts, all-step verification compares candidates at every step, and selective verification compares candidates only at selected steps. (b) Resolution gains and (c) total costs on MiniMax-M2.7: SWE-VERIFIER improves resolution by 1.73 percentage points at 1.09×1.09 \times total cost. Both are relative to the no-verifier baseline.

Xia et al., 2025). While the final patch is the ultimate measure of success, the actions leading to it shape both solution quality and computational efficiency. A poor action can steer the agent into a low-value trajectory, requiring additional exploration and corrective work. These detours are expensive: later actions repeatedly process an expanding interaction history, and input and cached-context tokens can account for a substantial portion of coding-agent costs (Bai et al., 2026; Salim et al., 2026; Wang et al., 2025b; Fan et al., 2025). Improving action quality before execution is therefore an opportunity to improve both task success and inference efficiency.

Verification offers a way to allocate additional computation to better decisions. Existing test-time scaling methods apply this idea by adjusting reasoning effort or selecting among independently

∗^{*}Corresponding author: zkjzou@umich.edu sampled solutions (Snell et al., 2025; Brown et al., 2024; Lightman et al., 2024). For coding agents, outcome-level and trajectory-level verifiers similarly rank completed patches or rollouts (Pan et al., 2025; Jain et al., 2025; Han et al., 2026; Zainullina et al., 2025; Gandhi et al., 2025; Dihan and Khan, 2026; Shum et al., 2025). However, selection after completion cannot prevent an individual rollout from taking an unproductive branch, and every candidate trajectory must be generated before it can be judged. This motivates verification at intermediate decision points, before the agent commits to its next action.

Step-level verification samples alternative actions from the current agent state and uses a verifier to choose which one to execute (Figure 1). Existing coding-agent process verifiers often rely on noisy step labels propagated from final outcomes and apply verification at every step (Han et al., 2026; Zainullina et al., 2025; Gandhi et al., 2025; Dihan and Khan, 2026). Applying this procedure at every step, however, incurs candidate-generation and scoring overhead throughout the trajectory, typically using the coding agent itself as the verifier. Not every decision warrants this expense. We therefore study selective step-level verification: assess the proposed action first, then generate and compare alternatives only when additional scrutiny is useful. The central challenge is balancing task accuracy against compute budget by deciding which coding-agent actions warrant additional verification.

We formalize step-level action selection and decompose its policy and verifier costs to compare full and selective verification with trajectory-level scaling. A preliminary study with MiniMax-M2.7 (MiniMax, 2026) on SWE-Bench-Verified (Jimenez et al., 2024) shows that selective verification outperforms all-step verification, achieving similar task performance (76.6% versus 76.0%) while significantly reduce the compute cost (1.29× versus 2.32× baseline cost) by verifying only 4% of steps. These observations motivate two complementary design choices to save computing budget: concentrate candidate comparison at useful decision points and offload action evaluation to a lightweight model.

Motivated by these findings, we introduce SWE-VERIFIER, a framework for selective verification of coding-agent actions. A single generative verifier scores the policy's proposed action to determine whether to sample alternatives, then scores the resulting candidates to select the action to execute. We instantiate SWE-VERIFIER with Qwen3.5-4B (Qwen Team, 2026) and train it using an execution-aware preference-data construction recipe. We sample contrasting actions from models with different capabilities, including MiniMax-M2.7 and Qwen3.5-27B, at intermediate states drawn from successful trajectories generated by Opus 4.7 and GPT-5.5. We replay these actions to obtain environment feedback and use GPT-5.6 to produce rubric-guided preference supervision for each candidate group during training.

Our experiments show that selective verification improves the performance–cost tradeoff across two policy models. On MiniMax-M2.7, SWE-VERIFIER raises resolution from 75.47% to 77.20% while verifying only 3.43% of steps and adding 9% total cost, outperforming trajectory verification and both evaluated all-step verifiers. Importantly, SWE-VERIFIER generalizes to DeepSeek-V4-Flash, improving resolution from 72.60% to 74.27% at 1.13×1.13\times total cost. Together, these results show that selective candidate sampling and lightweight action verification can improve coding-agent performance without the overhead of uniform verification at every step.