Nothing canonical to count
Two correct patches can differ in every line, and same-prefix siblings inherit the same evidence. Self-consistency's trick — count identical answers — has no purchase on either choice a software agent faces.
Fudan University · Shanghai Innovation Institute · arXiv:2608.22191
RISA — the model's own expert routing steers a software agent's exploration, gates its patch writing, and picks its final patch, with no judge and no test run at selection
The same similarity means stagnation, support, or convergence — it depends on whom you compare against.
The one idea
A repository-level repair unfolds as a sequence of decisions — inspect a failing test, search for a symbol, run a diagnostic, revise a file — and repeated attempts often find fixes a single run misses. But test-time scaling has nothing to count: patches are free-form, and sibling actions sampled from a shared prefix are correlated, so neither answer-string voting nor naive agreement applies. A sparse-MoE model, however, already writes down where it allocated computation for every token it generates. RISA reads that native routing trace as a shared coordinate system for textually different candidates — and lets the comparison set, not the score, decide what similarity means.
Two correct patches can differ in every line, and same-prefix siblings inherit the same evidence. Self-consistency's trick — count identical answers — has no purchase on either choice a software agent faces.
For every token and layer, the router records which experts fired and how hard. Step-level fingerprints are read from the generation pass the agent already ran — no judge model, no extra execution, no labels.
High similarity to recent history is stagnation. High similarity to role-matched peers is support. High similarity across independent attempts is convergence. One score, three meanings — matched to three decisions.
How RISA works
Inside each attempt the agent samples n = 16 sibling generations per step; across a task it runs K = 4 independent attempts. RISA repeats one loop — fingerprint the candidates, classify their role from routing, apply the rule that role calls for — and spends its one extra inference only at the very end, re-encoding each accumulated diff once to select the submission.
Integrate router gate mass over a span — an action's serialized tool call, or a patch's decision tokens — and normalize into a layer-by-expert histogram. Span length divides out; what remains is where computation went. Fingerprints are compared by weighted Jaccard: 1 for identical routing mass, 0 for disjoint.
Three routing centroids — inspect/execute, test, write — classify every candidate (0.940 holdout accuracy; write-vs-rest recall 0.93 at precision 1.00). While exploring, each candidate is scored by its similarity to the three closest of the last W = 64 executed actions, and the least similar wins — differently phrased commands still count as a revisit when they allocate computation alike.
Once ≥2 candidates propose writes, the rule flips: local peer support within a fixed threshold (τ = 0.65) and cohort centrality are rewarded, while entropy and peak-mass guards veto a concentrated routing spike. After K attempts, each accumulated diff is re-encoded in one teacher-forced pass; its least-probable quarter — the decision tokens — is fingerprinted, and the patch with highest mean agreement across attempts is submitted.
Everything is frozen before evaluation: role centroids are fit per architecture from task-disjoint action labels, and the write-score coefficients were fixed once on a separate pilot. Terminal selection adds one teacher-forced prefill per candidate patch — no judge model, no trajectory summary, and no test execution just to choose among patches.
What the trace supports
Before any control, the paper maps what routing actually preserves at each scale of an agent run — an action, a trajectory, a long patch, a pool of attempts. Each measurement becomes one component of the controller.
On task-disjoint splits of 78,535 actions, routing centroids classify inspect/execute vs test vs write at 0.940 three-way accuracy against a 0.746 majority baseline. The gate agrees with exact parsed tool calls on 96.8% of actions — without needing a scaffold-specific command taxonomy.
Score each executed action by routing similarity to its own recent history: attempts in the most-different quintile resolve 33.8% of tasks; the most-similar quintile resolves 5.4% (n = 1,021). Revisiting the same computation — however differently phrased — is how attempts die.
Long patches saturate a whole-span fingerprint (occupancy 0.75 → 0.96 as spans grow). But the least-probable quarter of tokens carries 72% of total surprisal — and reading routing only there separates resolving from non-resolving siblings at AUC .69 on compact candidates, beating whole-span, opening, and trailing windows.
Same-prefix siblings share their evidence, and their outcome-conditioned agreement distributions overlap — agreement among them is nearly meaningless. Across independently sampled attempts, decision-token agreement ranks resolving patches above non-resolving at AUC 0.66. Hence the title: disagree with your history; agree across trajectories.
On SWE-bench Verified
Every selector receives the same RISA-steered pool of K = 4 attempts, so the comparison isolates arbitration. Uniform is the expected random pick; Text is surface consensus over changed lines — the strong classical baseline. RISA operates on routing traces alone.
Official SWE-bench Verified grading over the full 500-task benchmark; 496–498 eligible tasks per condition. Text consensus reaches 48.0% and the hybrid RISA-H (text-first, routing tie-break) 48.3%; the 60.9% Oracle union confirms the four-attempt pools hold substantial unclaimed coverage.
RISA beats Uniform in every reported condition — by 2.3 to 5.7 points across gpt-oss-20b and 120b at low, medium, and high effort — and the gains persist as attempt yield ranges from 79% to 99.5%. It is the best deployable selector in three of six conditions; the hybrid takes the other three. The largest gains arrive at high reasoning effort, where trajectories are longest and surface comparison is weakest.
Moving to Qwen3.6-35B-A3B refits only the architecture-dependent role centroids; every rule and coefficient is unchanged. On the full benchmark RISA resolves 45.2% vs 41.7% for Uniform (p < 0.001) and 45.0% for Text — 10 routing-only wins against 9 text-only wins (McNemar p = 1.000). Routing-only arbitration holds text-consensus performance while reading no diff text at all.
On the empirically hard 80-instance set, role-gated steering raises submittable-patch yield from 79% to 94%; on a fixed 200-task gpt-oss-20b subset the full pipeline reaches 50.5% against 45.4% for unguided generation with uniform choice. Steering widens what the pool contains; arbitration chooses better from it — the two contributions compose.
Ranking attempts by mean agreement with their peers, the least-probable-quarter window reaches AUC .657 in mixed-outcome groups — above the whole span (.639) and above random, uniformly spaced, router-entropy, and highest-probability controls (.616–.634). Fixed answer delimiters localize routing for canonical answers; token improbability is the corresponding anchor for free-form patches.
RISA never judges a patch in isolation — it coordinates choices among candidates, using a signal the model emits anyway. The instantiation assumes accessible sparse-MoE routing and repeated trajectories; dense or closed models need alternative readouts, and rare-but-right outlier repairs remain the natural complement for execution- or semantics-based evidence.
Evaluated over 2 MoE families · 7 model–effort conditions · 500 tasks each SWE-bench Verified · gpt-oss-20b & 120b at low·medium·high effort + Qwen3.6-35B-A3B · n = 16 sibling generations per step · K = 4 attempts per task · official grading
Watch
Cite
@misc{chen2026risa,
title = {Disagree to Explore, Agree to Commit: Routing-Guided
Test-Time Scaling for Software Agents},
author = {Chen, Kang and Nian, Junjie and Cao, Yixin and Jiang, Yu-Gang},
year = {2026},
eprint = {2608.22191},
archivePrefix = {arXiv},
primaryClass = {cs.AI},
note = {RISA --- Routing-Informed Steering and Arbitration},
url = {https://arxiv.org/abs/2608.22191},
} Disagree with your history. Agree across your attempts.