{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/arxiv-2605-18859","title":"TwinRouterBench: Fast Static and Live Dynamic Evaluation for Realistic Agentic LLM Routing","arxiv_id":"2605.18859","date":"2026-05-14","proceeding":null,"authors":["Pei Yang","Wanyi Chen","Tongyun Yang","Pengbin Feng","Jiarong Xing","Wentao Guo","Yuhang Yao","Yuhang Han","Hanchen Li","Xu Wang","Zeyu Wang","Jie Xiao","Anjie Yang","Liang Tian","Lynn Ai","Eric Yang","Tianyu Shi"],"abstract":"LLM routing matters most in long-horizon applications such as coding agents, deep research systems, and computer-use agents, where a single user request triggers many model calls. Routing each call to the cheapest sufficient model can cut costs without sacrificing quality, yet existing router benchmarks evaluate routers only on one-shot prompts. They never expose the router-visible prefix at an intermediate agent step, never test whether a cheaper replacement preserves downstream task success, and often rely on online LLM judges at evaluation time. We introduce TwinRouterBench, a step-level routing benchmark with two tracks. The static track provides 970 router-visible prefixes from 520 instances across SWE-bench, BFCL, mtRAG, QMSum, and PinchBench, each paired with an execution-verified target tier estimated under a released downgrade-and-cascade protocol; scoring is deterministic arithmetic over tier labels, trajectory membership, and token costs, with no online evaluator-side LLM judge. The dynamic track supplies a harness that runs routers on the full 500-case SWE-bench Verified suite; in this paper we report a 100-case held-out evaluation disjoint from the static SWE supervision split. At each LLM call the router selects a concrete model from a locked pool, and success is measured by official task resolution and realized API spend. The two tracks support fast offline iteration followed by end-to-end validation under live agent execution. Code and data are available at https://github.com/CommonstackAI/TwinRouterBench.","url_abs":"https://arxiv.org/abs/2605.18859","url_pdf":"https://arxiv.org/pdf/2605.18859","source":{"archive":null,"snapshot":"2025-07-28","note":"not in the Papers with Code archive (frozen at the snapshot)","row_kind":"graph","title_abstract_authors_date":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)"},"code_links":[],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2605.18859","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2605.18859"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/CommonstackAI/TwinRouterBench","reach":null}],"summary":{"ran":5,"ran_draft_wrong":3,"unverified":2},"by_repo_kind":{"found_in_text":{"samples":10,"ran":8,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"0c27d7070606059b","entry":"CacheStateSnapshot","repo":"CommonstackAI/TwinRouterBench","repo_kind":"found_in_text","path":"swerouter/routers/sr_knn_adapter.py","file_url":"https://github.com/CommonstackAI/TwinRouterBench/blob/HEAD/swerouter/routers/sr_knn_adapter.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0c27d7070606059b"}},{"code_sha256_prefix":"180591fcd8ed4ea4","entry":"ModelCacheView","repo":"CommonstackAI/TwinRouterBench","repo_kind":"found_in_text","path":"swerouter/routers/sr_knn_adapter.py","file_url":"https://github.com/CommonstackAI/TwinRouterBench/blob/HEAD/swerouter/routers/sr_knn_adapter.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"180591fcd8ed4ea4"}},{"code_sha256_prefix":"a98da566a221c886","entry":"RouterContext","repo":"CommonstackAI/TwinRouterBench","repo_kind":"found_in_text","path":"swerouter/routers/sr_knn_adapter.py","file_url":"https://github.com/CommonstackAI/TwinRouterBench/blob/HEAD/swerouter/routers/sr_knn_adapter.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a98da566a221c886"}},{"code_sha256_prefix":"845f69a59f6bf0e2","entry":"RouterDecision","repo":"CommonstackAI/TwinRouterBench","repo_kind":"found_in_text","path":"swerouter/routers/sr_knn_adapter.py","file_url":"https://github.com/CommonstackAI/TwinRouterBench/blob/HEAD/swerouter/routers/sr_knn_adapter.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"845f69a59f6bf0e2"}},{"code_sha256_prefix":"20dc193d24ff14c2","entry":"RunConfig","repo":"CommonstackAI/TwinRouterBench","repo_kind":"found_in_text","path":"swerouter/routers/sr_knn_adapter.py","file_url":"https://github.com/CommonstackAI/TwinRouterBench/blob/HEAD/swerouter/routers/sr_knn_adapter.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"20dc193d24ff14c2"}},{"code_sha256_prefix":"33d7368200bac663","entry":"_flatten_message_content","repo":"CommonstackAI/TwinRouterBench","repo_kind":"found_in_text","path":"swerouter/routers/sr_knn_adapter.py","file_url":"https://github.com/CommonstackAI/TwinRouterBench/blob/HEAD/swerouter/routers/sr_knn_adapter.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"33d7368200bac663"}},{"code_sha256_prefix":"f1ea4fe95bcceefc","entry":"_flatten_messages_to_prompt","repo":"CommonstackAI/TwinRouterBench","repo_kind":"found_in_text","path":"swerouter/routers/sr_knn_adapter.py","file_url":"https://github.com/CommonstackAI/TwinRouterBench/blob/HEAD/swerouter/routers/sr_knn_adapter.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f1ea4fe95bcceefc"}},{"code_sha256_prefix":"2806f91ec4c5a608","entry":"_load_knn_module","repo":"CommonstackAI/TwinRouterBench","repo_kind":"found_in_text","path":"swerouter/routers/sr_knn_adapter.py","file_url":"https://github.com/CommonstackAI/TwinRouterBench/blob/HEAD/swerouter/routers/sr_knn_adapter.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2806f91ec4c5a608"}},{"code_sha256_prefix":"53fb76cf69213d57","entry":"SemanticRouterKNNRouter","repo":"CommonstackAI/TwinRouterBench","repo_kind":"found_in_text","path":"swerouter/routers/sr_knn_adapter.py","file_url":"https://github.com/CommonstackAI/TwinRouterBench/blob/HEAD/swerouter/routers/sr_knn_adapter.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"53fb76cf69213d57"}},{"code_sha256_prefix":"d074b2275fc466df","entry":"_category_one_hot","repo":"CommonstackAI/TwinRouterBench","repo_kind":"found_in_text","path":"swerouter/routers/sr_knn_adapter.py","file_url":"https://github.com/CommonstackAI/TwinRouterBench/blob/HEAD/swerouter/routers/sr_knn_adapter.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d074b2275fc466df"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.LG","source":"arxiv_2026.jsonl"},"syntology_extracted_results":null}