arXiv:2608.22191cs.AIAug 2026

Manuscript Offprint

arXiv:2608.22191

Disagree to Explore, Agree to Commit: Routing-Guided Test-Time Scaling for Software Agents

Kang Chen, Junjie Nian, Yixin Cao, Yugang Jiang

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

Abstract

Software-engineering agents solve repository-level tasks through long, stochastic tool-use trajectories, and repeated attempts often find fixes missed by one run. Test-time scaling is difficult because patches lack canonical answer forms, while sibling actions from a shared prefix are correlated. We study whether native MoE router traces can guide steering and selection without an external judge or selection-time test execution. Our analysis shows that routing provides a robust behavioral-role signal; token-granular readouts and decision-matched comparison sets turn it into effective control. We therefore introduce Risa (Routing-Informed Steering and Arbitration): within trajectories, routing encourages diverse exploration and controlled convergence during patch commitment; across separately sampled trajectories, agreement at informative patch positions selects a final candidate. We evaluate on SWE-bench Verified using open-weight sparse MoE agents across scales and reasoning-effort settings. Risa’s routing arbitration raises the macro-average resolved rate from 44.9% under uniform sampling to 48.2% on the gpt-oss family, matching text consensus without answer-string matching, and it transfers to Qwen3.6, where it improves on uniform choice and matches text consensus on the full 500-task benchmark.

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

Web: https://CckFdu.com/RISA

1 Introduction

Repository-level repair unfolds as a sequence of decisions. During one attempt, an agent may inspect a failing test, search for a symbol, execute a diagnostic command, revise a file, and repeat this cycle before producing a diff. Giving the agent more inference compute therefore creates two nested coordination problems. At each tool step, many actions sampled from the same prefix compete for execution; after several complete runs, multiple non-canonical patches compete for submission. Although both resemble best-of-N selection, their candidates have very different dependence: siblings inherit the same trajectory state, whereas complete attempts may reach a patch through different repository paths.

Existing systems coordinate these choices with execution feedback, surface comparison, trained verifiers, or judge models [1, 2, 25]. Sparse mixture-of-experts (MoE) models expose a complementary signal already produced during inference: for every token and layer, the router records the selected experts and their weights. Because expert identities are shared across tokens and actions, this sparse trace can place textually different

  • Contributed equally.

†^{\dagger} Corresponding author.

Figure

patch-writing candidates, t-SNE

Figure

all actions, same fingerprint and metric

Figure

fraction of tokens, least confident first

Figure 1 Routing supports decision-matched control. (a) Patch-writing fingerprints overlap across outcomes, motivating relational use. (b) Behavioral roles separate cleanly. (c) Across 658 final-step generations, the least-probable quarter carries 72% of total token surprisal (median and interquartile range; dotted line: equal contribution).

candidates in a common coordinate system. It records where the model allocated internal computation, not only what text it produced. Prior work studies lexical and semantic specialization in these traces [13, 15, 22], but not how their meaning changes across the nested choices of a long tool-use trajectory.

Routing similarity becomes informative relative to the candidates being compared. Same-prefix siblings share nearly all preceding evidence, making their agreement partly shaped by a common continuation. Separately sampled attempts can inspect different files and run different diagnostics, making convergence at the patch stage a stronger signal. We therefore follow the trace outward through four questions. Action fingerprints first reveal what computation an agent is performing. Similarity to its executed history then marks computational revisitation. Within long patches, fine-grained variation concentrates at low-probability decision tokens. Finally, we test how agreement changes as the reference set moves from correlated siblings to independently developed fixes. Figure 1 previews the role geometry and decision-token concentration behind this progression.

These findings yield a simple principle: match the routing comparison set to the decision. We instantiate it as RISA (Routing-Informed Steering and Arbitration), a two-level controller. Within an attempt, a routing-derived role gate separates exploration from patch writing; exploration favors actions unlike recent executed history, while a cohort of write candidates uses guarded peer convergence. Across K attempts, each accumulated patch is re-encoded once, and the final patch with the highest decision-token agreement across attempts is selected. Step-level fingerprints come from the original generation pass, and terminal selection requires no external judge or executing candidate patches solely to select among them.

Across the six gpt-oss model-effort conditions, RISA improves over Uniform by 2.3–5.7 points, lifting the macro-average from 44.9% to 48.2%; Text reaches 48.0% and RISA-H 48.3%. On the cross-family full 500-task Qwen3.6-35B-A3B condition, RISA improves over Uniform by 3.5 points (p < 0.001) and matches Text (exact McNemar p=1.000), after refitting only the architecture-dependent role centroids.

Our contributions are as follows:

  • A multiscale map of MoE routing as a behavioral coordinate system, spanning action roles, trajectory repetition, decision-token detail, and cross-attempt convergence.

  • RISA, a two-level routing-guided controller that turns these findings into role-conditioned exploration, commitment, and final-patch selection.

• An evaluation over two model scales, three reasoning-effort settings, and a second MoE family, in which RISA raises resolved rate over Uniform in every condition while operating directly on routing traces.

References (24)