Fudan University  ·  Shanghai Innovation Institute  ·  arXiv:2608.22191

Disagree to explore. Agree to commit.

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

RISA·one routing trace, three decision-matched comparisons

The same similarity means stagnation, support, or convergence — it depends on whom you compare against.

Kang Chen  ·  Junjie Nian  ·  Yixin Cao  ·  Yu-Gang Jiang

The one idea

A patch has no canonical form to vote over. The router trace gives it a coordinate anyway.

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.

Three panels. (a) A two-dimensional projection of patch-writing routing fingerprints from resolving and non-resolving branches: the two outcome clouds overlap broadly, so absolute position does not separate them. (b) The same projection colored by behavioral role — inspect or execute, run tests, and write — separates into clean clusters. (c) Across 658 final-step generations, the least-probable quarter of tokens carries a median 72 percent of total token surprisal, far above the 25 percent expected under equal contribution; the dotted line marks equal contribution.
Fig. 1What the trace supports. (a) Outcome does not separate in absolute routing position — the signal must be relational. (b) Behavioral role separates cleanly. (c) A quarter of the tokens carries 72% of the surprisal — the positions where the model actually decided.
01

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.

02

Routing is already there

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.

03

The reference set is the semantics

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

Fingerprint the action. Gate by role. Match the comparison to the decision.

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.

Pipeline diagram of RISA. One MoE routing representation feeds three decision-matched comparisons: exploratory actions are compared against recent executed history and the most novel is chosen; a role-gated cohort of patch-writing candidates is scored by guarded peer convergence; and after four attempts, accumulated final patches are re-encoded, their decision tokens fingerprinted, and the patch with highest cross-attempt agreement is submitted.
Fig. 2One routing representation, three decision-matched comparisons. Exploratory actions are compared with recent executed history; patch-writing actions with their role-gated peers; accumulated final patches with separately sampled attempts, read at decision tokens.
  1. h(s)

    One fingerprint for any span

    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.

    WJ(u, v) = i min(ui, vi)i max(ui, vi)
  2. gate

    Explore: disagree with your own history

    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.

    Sexplore(c) = 1mtu∈𝒩(c) WJ(h(c), u)
  3. commit

    Commit: guarded convergence, then the medoid

    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.

    = arg maxk 1|𝒜|−1j≠k WJ(hdec(pk), hdec(pj))

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

Four measurements, one operating principle.

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.

Role is written in the routing

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.

Repetition predicts stagnation

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.

Decisions live in the improbable quarter

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.

Whose agreement counts

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.

Three panels. Left: layer-expert occupancy, the fraction of cells receiving nonzero mass, grows from about 0.75 for spans under 64 tokens to 0.96 beyond a thousand. Middle: splitting each generation into ten deciles by next-token probability, routing agreement between separately sampled attempts is highest in the lowest-probability decile and falls as probability rises across 1,004 attempt pairs, with a rebound in the final decile. Right: the context-identity AUC decays with span length; whole-span routing retains coarse context while opening and decision-token windows preserve finer separation.
Fig. 3Where to read a long candidate. Left: whole-span fingerprints saturate as spans grow. Middle: cross-attempt agreement is highest exactly at the least-probable tokens (0.65 vs 0.56 elsewhere). Right: decision-token windows preserve fine-grained context that whole spans blur (AUC 0.93 vs 0.88).
Three panels. Left: decision tokens yield higher cross-attempt routing agreement than other position sets. Middle: outcome-conditioned agreement distributions for same-prefix siblings overlap almost entirely, so sibling agreement carries little outcome signal. Right: across separately sampled attempts, resolving patches receive visibly higher mean decision-token agreement with their attempt group than non-resolving ones.
Fig. 4Why the reference set matters. Left: decision tokens agree most across attempts. Middle: sibling agreement overlaps across outcomes — the wrong place to count votes. Right: across independent attempts, resolving patches sit at higher agreement — the right place.

On SWE-bench Verified

Matches text consensus — without reading a line of diff.

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.

44.9 → 48.2%macro-average resolved rate over uniform selection, six gpt-oss conditions
+5.7points in the strongest condition (gpt-oss-20b, high effort) — gains in every condition
+3.5points over uniform on Qwen3.6-35B-A3B (p < 0.001), refitting only role centroids

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.

Routing arbitration is a working selector

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.

It transfers across MoE families

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.

Steering earns its keep separately

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.

Decision tokens are the strongest terminal readout

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.

A coordination signal, not a verifier

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

Four patches, one slot — and a receipt the run already paid for

A silent vector essay, drawn live in your browser — no video file. Four attempts end in four different patches; checking them again would cost another full run. But the router's receipt — recorded anyway while the model generated — names each step's role, flags an attempt circling itself, and lets the attempts agree on one patch for free.

Cite

Reference

Kang Chen1,∗, Junjie Nian1,∗, Yixin Cao1,2,†, Yu-Gang Jiang1

1 Fudan University    2 Shanghai Innovation Institute    Equal contribution   † Corresponding author

Correspondence: kchen24@m.fudan.edu.cn  ·  yxcao@fudan.edu.cn

@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.