{"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-05167","title":"RelayLLM: Efficient Reasoning via Collaborative Decoding","arxiv_id":"2601.05167","date":"2026-01-08","proceeding":null,"authors":["Chengsong Huang","Tong Zheng","Langlin Huang","Jinyuan Li","Haolin Liu","Jiaxin Huang"],"abstract":"Large Language Models (LLMs) for complex reasoning is often hindered by high computational costs and latency, while resource-efficient Small Language Models (SLMs) typically lack the necessary reasoning capacity. Existing collaborative approaches, such as cascading or routing, operate at a coarse granularity by offloading entire queries to LLMs, resulting in significant computational waste when the SLM is capable of handling the majority of reasoning steps. To address this, we propose RelayLLM, a novel framework for efficient reasoning via token-level collaborative decoding. Unlike routers, RelayLLM empowers the SLM to act as an active controller that dynamically invokes the LLM only for critical tokens via a special command, effectively \"relaying\" the generation process. We introduce a two-stage training framework, including warm-up and Group Relative Policy Optimization (GRPO) to teach the model to balance independence with strategic help-seeking. Empirical results across six benchmarks demonstrate that RelayLLM achieves an average accuracy of 49.52%, effectively bridging the performance gap between the two models. Notably, this is achieved by invoking the LLM for only 1.07% of the total generated tokens, offering a 98.2% cost reduction compared to performance-matched random routers.","url_abs":"https://arxiv.org/abs/2601.05167","url_pdf":"https://arxiv.org/pdf/2601.05167","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.05167","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2601.05167"}},"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/Chengsong-Huang/RelayLLM","reach":{"status":"ok"}}],"summary":{"ran_draft_wrong":1,"ran":1,"unverified":13},"by_repo_kind":{"found_in_text":{"samples":15,"ran":2,"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":15,"samples":[{"code_sha256_prefix":"e81f53ee64a9fcbe","entry":"get_rope_index","repo":"Chengsong-Huang/RelayLLM","repo_kind":"found_in_text","path":"RL_stage/verl/models/transformers/qwen2_vl.py","file_url":"https://github.com/Chengsong-Huang/RelayLLM/blob/HEAD/RL_stage/verl/models/transformers/qwen2_vl.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e81f53ee64a9fcbe"}},{"code_sha256_prefix":"a91c18341292d50e","entry":"unpad_dataproto","repo":"Chengsong-Huang/RelayLLM","repo_kind":"found_in_text","path":"RL_stage/verl/protocol.py","file_url":"https://github.com/Chengsong-Huang/RelayLLM/blob/HEAD/RL_stage/verl/protocol.py","link_basis":"plan_row","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":"a91c18341292d50e"}},{"code_sha256_prefix":"600783807e2925f1","entry":"call_large_model_service_batch","repo":"Chengsong-Huang/RelayLLM","repo_kind":"found_in_text","path":"eval/generate_withhelp.py","file_url":"https://github.com/Chengsong-Huang/RelayLLM/blob/HEAD/eval/generate_withhelp.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":"600783807e2925f1"}},{"code_sha256_prefix":"0638ade1ad381db2","entry":"compute_advantage_return","repo":"Chengsong-Huang/RelayLLM","repo_kind":"found_in_text","path":"RL_stage/verl/trainer/core_algos.py","file_url":"https://github.com/Chengsong-Huang/RelayLLM/blob/HEAD/RL_stage/verl/trainer/core_algos.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":"0638ade1ad381db2"}},{"code_sha256_prefix":"81c1dcce890376c5","entry":"flash_attention_forward","repo":"Chengsong-Huang/RelayLLM","repo_kind":"found_in_text","path":"RL_stage/verl/models/transformers/flash_attention_utils.py","file_url":"https://github.com/Chengsong-Huang/RelayLLM/blob/HEAD/RL_stage/verl/models/transformers/flash_attention_utils.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":"81c1dcce890376c5"}},{"code_sha256_prefix":"e8ef1d6648c2b294","entry":"format_reward","repo":"Chengsong-Huang/RelayLLM","repo_kind":"found_in_text","path":"RL_stage/data_filter.py","file_url":"https://github.com/Chengsong-Huang/RelayLLM/blob/HEAD/RL_stage/data_filter.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":"e8ef1d6648c2b294"}},{"code_sha256_prefix":"7633fd09bcf8972a","entry":"get_kl_controller","repo":"Chengsong-Huang/RelayLLM","repo_kind":"found_in_text","path":"RL_stage/verl/trainer/core_algos.py","file_url":"https://github.com/Chengsong-Huang/RelayLLM/blob/HEAD/RL_stage/verl/trainer/core_algos.py","link_basis":"plan_row","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":"7633fd09bcf8972a"}},{"code_sha256_prefix":"151d28c51ebb0904","entry":"insert_special_string_between_tokens","repo":"Chengsong-Huang/RelayLLM","repo_kind":"found_in_text","path":"SFT_stage/add_command_upload.py","file_url":"https://github.com/Chengsong-Huang/RelayLLM/blob/HEAD/SFT_stage/add_command_upload.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":"151d28c51ebb0904"}},{"code_sha256_prefix":"21c38014814eae1e","entry":"pad_dataproto_to_divisor","repo":"Chengsong-Huang/RelayLLM","repo_kind":"found_in_text","path":"RL_stage/verl/protocol.py","file_url":"https://github.com/Chengsong-Huang/RelayLLM/blob/HEAD/RL_stage/verl/protocol.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":"21c38014814eae1e"}},{"code_sha256_prefix":"74621bb999fe25b1","entry":"prepare_fa2_from_position_ids","repo":"Chengsong-Huang/RelayLLM","repo_kind":"found_in_text","path":"RL_stage/verl/models/transformers/flash_attention_utils.py","file_url":"https://github.com/Chengsong-Huang/RelayLLM/blob/HEAD/RL_stage/verl/models/transformers/flash_attention_utils.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":"74621bb999fe25b1"}},{"code_sha256_prefix":"76700adff75fb92c","entry":"process_example","repo":"Chengsong-Huang/RelayLLM","repo_kind":"found_in_text","path":"eval/results_recheck.py","file_url":"https://github.com/Chengsong-Huang/RelayLLM/blob/HEAD/eval/results_recheck.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":"76700adff75fb92c"}},{"code_sha256_prefix":"94cb835f47dcfc92","entry":"qwen2_vl_attn_forward","repo":"Chengsong-Huang/RelayLLM","repo_kind":"found_in_text","path":"RL_stage/verl/models/transformers/qwen2_vl.py","file_url":"https://github.com/Chengsong-Huang/RelayLLM/blob/HEAD/RL_stage/verl/models/transformers/qwen2_vl.py","link_basis":"plan_row","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":"94cb835f47dcfc92"}},{"code_sha256_prefix":"1a0b75b2de257457","entry":"qwen2_vl_forward_old","repo":"Chengsong-Huang/RelayLLM","repo_kind":"found_in_text","path":"RL_stage/verl/models/transformers/qwen2_vl.py","file_url":"https://github.com/Chengsong-Huang/RelayLLM/blob/HEAD/RL_stage/verl/models/transformers/qwen2_vl.py","link_basis":"plan_row","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":"1a0b75b2de257457"}},{"code_sha256_prefix":"42327ca81422c69b","entry":"register_adv_estimator","repo":"Chengsong-Huang/RelayLLM","repo_kind":"found_in_text","path":"RL_stage/verl/trainer/core_algos.py","file_url":"https://github.com/Chengsong-Huang/RelayLLM/blob/HEAD/RL_stage/verl/trainer/core_algos.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":"42327ca81422c69b"}},{"code_sha256_prefix":"ad658a1d6fe829ba","entry":"union_tensor_dict","repo":"Chengsong-Huang/RelayLLM","repo_kind":"found_in_text","path":"RL_stage/verl/protocol.py","file_url":"https://github.com/Chengsong-Huang/RelayLLM/blob/HEAD/RL_stage/verl/protocol.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":"ad658a1d6fe829ba"}}]},"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}