Disagree to Explore, Agree to Commit: Routing-Guided Test-Time Scaling for Software Agents
Organizations: Fudan University · Shanghai Innovation Institute
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.
Figures & tables
| candidate length | ||
|---|---|---|
| fingerprint read at | shorter half | longer half |
| whole span | .59 | .52 |
| opening 64 tokens | .49 | .51 |
| trailing 64 tokens | .51 | .52 |
| decision tokens | .69 | .52 |
| Attempt pool | Terminal arbitration | Upper bound | |||||||
| Model | Effort | Eligible | Yield | Steps | Uniform | Text | Risa | Risa-H | Oracle |
| gpt-oss-20b | low | 496 | 79.1 | 9.5 | 31.8 | 34.5 (+ 2.7) | 34.1 (+ 2.3) | 34.7 (+ 2.9) | 48.4 |
| medium | 498 | 94.8 | 26.5 | 45.7 | 47.8 (+ 2.1) | 48.2 (+ 2.5) | 47.6 (+ 1.9) | 63.3 | |
| high | 498 | 80.0 | 43.1 | 45.3 | 49.2 (+ 3.9) | 51.0 (+ 5.7) | 50.0 (+ 4.7) | 62.2 | |
| gpt-oss-120b | low | 497 | 93.0 | 14.8 | 38.7 | 40.0 (+ 1.3) | 41.2 (+ 2.5) | 40.4 (+ 1.7) | 53.3 |
| medium | 497 | 99.5 | 28.8 | 50.6 | 54.5 (+ 3.9) | 53.5 (+ 2.9) | 54.9 (+ 4.3) | 66.6 | |
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
| Terminal selector | Macro (%) | vs. Risa |
|---|---|---|
| Uniform | 44.9 | — |
| patch-length prior | 46.7 | |
| file-set Jaccard | 46.9 | |
| changed-line multiset | 46.9 | |
| TF–IDF cosine centrality | 47.5 | |
| character -gram Jaccard | 47.5 |
| Score | AUC (95% CI) |
|---|---|
| peer similarity alone | .558 |
| mode fraction alone | .523 |
| entropy alone | .512 |
| concentration alone | .486 |
| deployed | .520 |
| equal weights | .522 |
| Model | Pool | Unif. | Text | Rout. | Hyb. | Oracle |
|---|---|---|---|---|---|---|
| 20b med | steered | 45.5 | 49.5 | 50.5 | 50.0 | 63.5 |
| uncontrolled | 45.4 | 50.0 | 48.0 | 51.0 | 63.0 | |
| 120b med | steered | 49.9 | 54.3 | 53.3 | 55.3 | 65.3 |
| uncontrolled | 53.5 | 56.3 | 54.8 | 55.3 | 71.9 |
| Selector | Resolved (%) | Gain vs. Uniform |
|---|---|---|
| Uniform | 41.7 | — |
| Text | 45.0 | |
| Risa | 45.2 | |
| Risa-H | 45.6 | |
| Oracle | 50.6 |
| parameter | value |
|---|---|
| attempts per task | 4 |
| candidates per step | 16 |
| sampling temperature | 1.0, top- 1.0 ( gpt-oss ); 0.6, top- 0.95, top- 20 ( Qwen3.6 ) |
| decision-token fraction | lowest 25% of patch tokens by teacher-forced probability |
| step fingerprint span | tool-call segment of the candidate (fallback: trailing 64 generated tokens) |
| gpt-oss reasoning efforts | native low / medium / high setting |
| decision-token fraction | 5% | 10% | 25% | 50% | 100% |
|---|---|---|---|---|---|
| offline AUC (cross-attempt) | .644 | .648 | .657 | .657 | .639 |
| realized macro-avg (%) | — | 48.0 | 48.2 | 48.2 | — |
| per-condition realized spread across fractions: at most points; the selected 25% setting attains the top macro-average. | |||||
| write-rule threshold : pairwise AUC .548/.572/.536/.580 | |||||
| step-level fraction : peer-similarity AUC .554/.545/.544 | |||||
| exploration , pool : .546/.545/.548/.551; pool : .533/.537/.547/.551 | |||||
Software Engineering Agents
Software Engineering Agents are AI systems that use code, tools, and feedback to perform software development tasks.
See all 349 papers