{"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-2601-05903","title":"HAPS: Hierarchical LLM Routing with Joint Architecture and Parameter Search","arxiv_id":"2601.05903","date":"2026-01-09","proceeding":null,"authors":["Zihang Tian","Rui Li","Jingsen Zhang","Xiaohe Bo","Wei Huo","Xu Chen"],"abstract":"Large language model (LLM) routing aims to exploit the specialized strengths of different LLMs for diverse tasks. However, existing approaches typically focus on selecting LLM architectures while overlooking parameter settings, which are critical for task performance. In this paper, we introduce HAPS, a hierarchical LLM routing framework that jointly searches over model architectures and parameters. Specifically, we use a high-level router to select among candidate LLM architectures, and then search for the optimal parameters for the selected architectures based on a low-level router. We design a parameter generation network to share parameters between the two routers to mutually enhance their capabilities. In the training process, we design a reward-augmented objective to effectively optimize our framework. Experiments on two commonly used benchmarks show that HAPS consistently outperforms strong routing baselines. We have released our code at https://github.com/zihangtian/HAPS.","url_abs":"https://arxiv.org/abs/2601.05903","url_pdf":"https://arxiv.org/pdf/2601.05903","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=2601.05903","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2601.05903"}},"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/zihangtian/HAPS","reach":null}],"summary":{"ran":8,"ran_draft_wrong":5,"ran_honours":2,"unverified":14},"by_repo_kind":{"found_in_text":{"samples":29,"ran":15,"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":29,"samples":[{"code_sha256_prefix":"421651a025757bd2","entry":"Retriever","repo":"zihangtian/HAPS","repo_kind":"found_in_text","path":"HotpotQA/joint_rl/rl_batch.py","file_url":"https://github.com/zihangtian/HAPS/blob/HEAD/HotpotQA/joint_rl/rl_batch.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"421651a025757bd2"}},{"code_sha256_prefix":"4e352843534fc897","entry":"_build_mlp","repo":"zihangtian/HAPS","repo_kind":"found_in_text","path":"HotpotQA/joint_rl/rl_batch.py","file_url":"https://github.com/zihangtian/HAPS/blob/HEAD/HotpotQA/joint_rl/rl_batch.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4e352843534fc897"}},{"code_sha256_prefix":"bdcb5e997f2d2deb","entry":"_make_generator","repo":"zihangtian/HAPS","repo_kind":"found_in_text","path":"HotpotQA/joint_rl/rl_batch.py","file_url":"https://github.com/zihangtian/HAPS/blob/HEAD/HotpotQA/joint_rl/rl_batch.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"bdcb5e997f2d2deb"}},{"code_sha256_prefix":"07274e6bcd20a571","entry":"build_prompt","repo":"zihangtian/HAPS","repo_kind":"found_in_text","path":"HotpotQA/joint_rl/rl_batch.py","file_url":"https://github.com/zihangtian/HAPS/blob/HEAD/HotpotQA/joint_rl/rl_batch.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"07274e6bcd20a571"}},{"code_sha256_prefix":"688aa7b93e59d244","entry":"create_llama_8b","repo":"zihangtian/HAPS","repo_kind":"found_in_text","path":"HotpotQA/joint_rl/rl_batch.py","file_url":"https://github.com/zihangtian/HAPS/blob/HEAD/HotpotQA/joint_rl/rl_batch.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"688aa7b93e59d244"}},{"code_sha256_prefix":"21fc093fb707f917","entry":"create_mistral_7b","repo":"zihangtian/HAPS","repo_kind":"found_in_text","path":"HotpotQA/joint_rl/rl_batch.py","file_url":"https://github.com/zihangtian/HAPS/blob/HEAD/HotpotQA/joint_rl/rl_batch.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"21fc093fb707f917"}},{"code_sha256_prefix":"2a0e8ed4d390ad37","entry":"create_qwen_7b","repo":"zihangtian/HAPS","repo_kind":"found_in_text","path":"HotpotQA/joint_rl/rl_batch.py","file_url":"https://github.com/zihangtian/HAPS/blob/HEAD/HotpotQA/joint_rl/rl_batch.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2a0e8ed4d390ad37"}},{"code_sha256_prefix":"3bbfdafb9b91dbc5","entry":"em","repo":"zihangtian/HAPS","repo_kind":"found_in_text","path":"HotpotQA/joint_rl/rl_batch.py","file_url":"https://github.com/zihangtian/HAPS/blob/HEAD/HotpotQA/joint_rl/rl_batch.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3bbfdafb9b91dbc5"}},{"code_sha256_prefix":"0caf82090ef6e6d4","entry":"eval_mode_for_base_and_gens","repo":"zihangtian/HAPS","repo_kind":"found_in_text","path":"HotpotQA/joint_rl/rl_batch.py","file_url":"https://github.com/zihangtian/HAPS/blob/HEAD/HotpotQA/joint_rl/rl_batch.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0caf82090ef6e6d4"}},{"code_sha256_prefix":"c871481cb5ee3d92","entry":"f1_score","repo":"zihangtian/HAPS","repo_kind":"found_in_text","path":"HotpotQA/joint_rl/rl_batch.py","file_url":"https://github.com/zihangtian/HAPS/blob/HEAD/HotpotQA/joint_rl/rl_batch.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c871481cb5ee3d92"}},{"code_sha256_prefix":"98c58698259e92d3","entry":"get_linear_scheduler","repo":"zihangtian/HAPS","repo_kind":"found_in_text","path":"HotpotQA/joint_rl/rl_batch.py","file_url":"https://github.com/zihangtian/HAPS/blob/HEAD/HotpotQA/joint_rl/rl_batch.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"98c58698259e92d3"}},{"code_sha256_prefix":"fb49c3f0373ad6da","entry":"infer_backbone_hidden_dim","repo":"zihangtian/HAPS","repo_kind":"found_in_text","path":"HotpotQA/joint_rl/rl_batch.py","file_url":"https://github.com/zihangtian/HAPS/blob/HEAD/HotpotQA/joint_rl/rl_batch.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"fb49c3f0373ad6da"}},{"code_sha256_prefix":"2f50635caabfd754","entry":"load_txt","repo":"zihangtian/HAPS","repo_kind":"found_in_text","path":"HotpotQA/joint_rl/rl_batch.py","file_url":"https://github.com/zihangtian/HAPS/blob/HEAD/HotpotQA/joint_rl/rl_batch.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2f50635caabfd754"}},{"code_sha256_prefix":"6c668580324cfd97","entry":"normalize_answer","repo":"zihangtian/HAPS","repo_kind":"found_in_text","path":"HotpotQA/joint_rl/rl_batch.py","file_url":"https://github.com/zihangtian/HAPS/blob/HEAD/HotpotQA/joint_rl/rl_batch.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6c668580324cfd97"}},{"code_sha256_prefix":"de9edf0e896f695f","entry":"parse_router_output","repo":"zihangtian/HAPS","repo_kind":"found_in_text","path":"HotpotQA/joint_rl/rl_batch.py","file_url":"https://github.com/zihangtian/HAPS/blob/HEAD/HotpotQA/joint_rl/rl_batch.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"de9edf0e896f695f"}},{"code_sha256_prefix":"799d16886a6a81e3","entry":"Agent","repo":"zihangtian/HAPS","repo_kind":"found_in_text","path":"HotpotQA/joint_rl/rl_batch.py","file_url":"https://github.com/zihangtian/HAPS/blob/HEAD/HotpotQA/joint_rl/rl_batch.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"799d16886a6a81e3"}},{"code_sha256_prefix":"72c43d0193d96948","entry":"GeneratorConfig","repo":"zihangtian/HAPS","repo_kind":"found_in_text","path":"HotpotQA/joint_rl/rl_batch.py","file_url":"https://github.com/zihangtian/HAPS/blob/HEAD/HotpotQA/joint_rl/rl_batch.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"72c43d0193d96948"}},{"code_sha256_prefix":"5d71dd1ffa52a5e3","entry":"LoRAParamGenerator","repo":"zihangtian/HAPS","repo_kind":"found_in_text","path":"HotpotQA/joint_rl/rl_batch.py","file_url":"https://github.com/zihangtian/HAPS/blob/HEAD/HotpotQA/joint_rl/rl_batch.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"5d71dd1ffa52a5e3"}},{"code_sha256_prefix":"d5697c67776c9c90","entry":"_init_linear_","repo":"zihangtian/HAPS","repo_kind":"found_in_text","path":"HotpotQA/joint_rl/rl_batch.py","file_url":"https://github.com/zihangtian/HAPS/blob/HEAD/HotpotQA/joint_rl/rl_batch.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d5697c67776c9c90"}},{"code_sha256_prefix":"501cee2e98916613","entry":"align_model_and_tokenizer","repo":"zihangtian/HAPS","repo_kind":"found_in_text","path":"HotpotQA/joint_rl/rl_batch.py","file_url":"https://github.com/zihangtian/HAPS/blob/HEAD/HotpotQA/joint_rl/rl_batch.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"501cee2e98916613"}},{"code_sha256_prefix":"1cdca1d7dc67aa3b","entry":"candidate2gen","repo":"zihangtian/HAPS","repo_kind":"found_in_text","path":"HotpotQA/joint_rl/rl_batch.py","file_url":"https://github.com/zihangtian/HAPS/blob/HEAD/HotpotQA/joint_rl/rl_batch.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1cdca1d7dc67aa3b"}},{"code_sha256_prefix":"0f9fc87d9679a749","entry":"create_generator_optimizer","repo":"zihangtian/HAPS","repo_kind":"found_in_text","path":"HotpotQA/joint_rl/rl_batch.py","file_url":"https://github.com/zihangtian/HAPS/blob/HEAD/HotpotQA/joint_rl/rl_batch.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0f9fc87d9679a749"}},{"code_sha256_prefix":"07cfc394c321ff0c","entry":"evaluate_HALO_bucketed","repo":"zihangtian/HAPS","repo_kind":"found_in_text","path":"HotpotQA/joint_rl/rl_batch.py","file_url":"https://github.com/zihangtian/HAPS/blob/HEAD/HotpotQA/joint_rl/rl_batch.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"07cfc394c321ff0c"}},{"code_sha256_prefix":"0e8bb5d73900d198","entry":"load_mNt","repo":"zihangtian/HAPS","repo_kind":"found_in_text","path":"HotpotQA/joint_rl/rl_batch.py","file_url":"https://github.com/zihangtian/HAPS/blob/HEAD/HotpotQA/joint_rl/rl_batch.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0e8bb5d73900d198"}},{"code_sha256_prefix":"7ad611ed8663e682","entry":"rl_train","repo":"zihangtian/HAPS","repo_kind":"found_in_text","path":"HotpotQA/joint_rl/rl_batch.py","file_url":"https://github.com/zihangtian/HAPS/blob/HEAD/HotpotQA/joint_rl/rl_batch.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7ad611ed8663e682"}},{"code_sha256_prefix":"a6e6550ffa3be13f","entry":"route","repo":"zihangtian/HAPS","repo_kind":"found_in_text","path":"HotpotQA/joint_rl/rl_batch.py","file_url":"https://github.com/zihangtian/HAPS/blob/HEAD/HotpotQA/joint_rl/rl_batch.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a6e6550ffa3be13f"}},{"code_sha256_prefix":"caaef05dd205f755","entry":"route_batch","repo":"zihangtian/HAPS","repo_kind":"found_in_text","path":"HotpotQA/joint_rl/rl_batch.py","file_url":"https://github.com/zihangtian/HAPS/blob/HEAD/HotpotQA/joint_rl/rl_batch.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"caaef05dd205f755"}},{"code_sha256_prefix":"9460a8aaf3d5ea99","entry":"run","repo":"zihangtian/HAPS","repo_kind":"found_in_text","path":"HotpotQA/joint_rl/rl_batch.py","file_url":"https://github.com/zihangtian/HAPS/blob/HEAD/HotpotQA/joint_rl/rl_batch.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"9460a8aaf3d5ea99"}},{"code_sha256_prefix":"10daa5c7dd333b7e","entry":"run_batch","repo":"zihangtian/HAPS","repo_kind":"found_in_text","path":"HotpotQA/joint_rl/rl_batch.py","file_url":"https://github.com/zihangtian/HAPS/blob/HEAD/HotpotQA/joint_rl/rl_batch.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"10daa5c7dd333b7e"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.CL","source":"arxiv_2026.jsonl"},"syntology_extracted_results":null}