{"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-2606-05859","title":"TARPO: Token-Wise Latent-Explicit Reasoning via Action-Routing Policy Optimization","arxiv_id":"2606.05859","date":"2026-06-04","proceeding":null,"authors":["Liting Zhang","Shiwan Zhao","Xuyang Zhao","Zichen Xu","Jianye Wang","Qicheng Li"],"abstract":"Latent reasoning has emerged as a promising alternative to discrete Chain-of-Thought (CoT) in large language models (LLMs), enabling more expressive reasoning by operating over continuous representations. However, the inherently deterministic nature of continuous representations limits policy exploration in reinforcement learning (RL). To address this, we propose TARPO (Token-Wise Latent-Explicit Reasoning via Action-Routing Policy Optimization), a pure RL framework that adaptively switches between discrete token generation and continuous latent reasoning at each step. TARPO introduces a lightweight action head router that observes the current hidden state and samples a routing decision from a binary mode-selection space, preserving the stochasticity of discrete token sampling from the vocabulary. The LLM backbone and router are jointly optimized end-to-end with a shared group-relative advantage signal. Extensive experiments across Qwen2.5 (from 1.5B to 7B) and Llama-3.1-8B backbones demonstrate that TARPO consistently outperforms existing explicit and latent reasoning RL baselines across diverse benchmarks. Further analysis shows that TARPO learns adaptive token-wise switching behaviors while maintaining stable training dynamics. Our code is available at https://github.com/NKU-LITI/TARPO-master.","url_abs":"https://arxiv.org/abs/2606.05859","url_pdf":"https://arxiv.org/pdf/2606.05859","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=2606.05859","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2606.05859"}},"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/unslothai/unsloth","reach":null},{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/NKU-LITI/TARPO-master","reach":null}],"summary":{"ran":9,"ran_draft_wrong":1,"unverified":8},"by_repo_kind":{"found_in_text":{"samples":18,"ran":10,"repositories":2}},"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":5,"samples":[{"code_sha256_prefix":"5734cdff3479c248","entry":"build_view","repo":"unslothai/unsloth","repo_kind":"found_in_text","path":"docker/unsloth_nb_view.py","file_url":"https://github.com/unslothai/unsloth/blob/HEAD/docker/unsloth_nb_view.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5734cdff3479c248"}},{"code_sha256_prefix":"c994f7c8db8f0369","entry":"clean_section","repo":"unslothai/unsloth","repo_kind":"found_in_text","path":"docker/unsloth_nb_view.py","file_url":"https://github.com/unslothai/unsloth/blob/HEAD/docker/unsloth_nb_view.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"c994f7c8db8f0369"}},{"code_sha256_prefix":"749159f289094827","entry":"colab_cell_magic_fix","repo":"unslothai/unsloth","repo_kind":"found_in_text","path":"docker/unsloth_colab_compat.py","file_url":"https://github.com/unslothai/unsloth/blob/HEAD/docker/unsloth_colab_compat.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"749159f289094827"}},{"code_sha256_prefix":"e080db2eaa81fdb3","entry":"estimate_pass_at_k","repo":"NKU-LITI/TARPO-master","repo_kind":"found_in_text","path":"humanevaleval.py","file_url":"https://github.com/NKU-LITI/TARPO-master/blob/HEAD/humanevaleval.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e080db2eaa81fdb3"}},{"code_sha256_prefix":"6cad710a9cef59bc","entry":"extract_python_code","repo":"NKU-LITI/TARPO-master","repo_kind":"found_in_text","path":"eval_tharp_humaneval_avg.py","file_url":"https://github.com/NKU-LITI/TARPO-master/blob/HEAD/eval_tharp_humaneval_avg.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":"6cad710a9cef59bc"}},{"code_sha256_prefix":"0e45f9de20f9f709","entry":"parse_readme","repo":"unslothai/unsloth","repo_kind":"found_in_text","path":"docker/unsloth_nb_view.py","file_url":"https://github.com/unslothai/unsloth/blob/HEAD/docker/unsloth_nb_view.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0e45f9de20f9f709"}},{"code_sha256_prefix":"9a228da89620120f","entry":"pin_from","repo":"unslothai/unsloth","repo_kind":"found_in_text","path":"docker/unsloth_nb_compat.py","file_url":"https://github.com/unslothai/unsloth/blob/HEAD/docker/unsloth_nb_compat.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9a228da89620120f"}},{"code_sha256_prefix":"e289de48f4ad6a1e","entry":"read_problems","repo":"NKU-LITI/TARPO-master","repo_kind":"found_in_text","path":"humanevaleval.py","file_url":"https://github.com/NKU-LITI/TARPO-master/blob/HEAD/humanevaleval.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":"e289de48f4ad6a1e"}},{"code_sha256_prefix":"76d9203754a4938d","entry":"strip_notebook","repo":"unslothai/unsloth","repo_kind":"found_in_text","path":"docker/unsloth_nb_strip_colab.py","file_url":"https://github.com/unslothai/unsloth/blob/HEAD/docker/unsloth_nb_strip_colab.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"76d9203754a4938d"}},{"code_sha256_prefix":"3b12c847e4486846","entry":"tier_for_model","repo":"unslothai/unsloth","repo_kind":"found_in_text","path":"docker/unsloth_nb_compat.py","file_url":"https://github.com/unslothai/unsloth/blob/HEAD/docker/unsloth_nb_compat.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"3b12c847e4486846"}},{"code_sha256_prefix":"1177382634e74969","entry":"check_correctness","repo":"NKU-LITI/TARPO-master","repo_kind":"found_in_text","path":"humanevaleval.py","file_url":"https://github.com/NKU-LITI/TARPO-master/blob/HEAD/humanevaleval.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":"1177382634e74969"}},{"code_sha256_prefix":"4ff13c21e1ebe6bd","entry":"evaluate_saved_trajectories","repo":"NKU-LITI/TARPO-master","repo_kind":"found_in_text","path":"eval_tarpo_math_avg.py","file_url":"https://github.com/NKU-LITI/TARPO-master/blob/HEAD/eval_tarpo_math_avg.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":"4ff13c21e1ebe6bd"}},{"code_sha256_prefix":"6b380b9c888dc9d8","entry":"main","repo":"unslothai/unsloth","repo_kind":"found_in_text","path":"docker/unsloth_nb_content_sig.py","file_url":"https://github.com/unslothai/unsloth/blob/HEAD/docker/unsloth_nb_content_sig.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":"6b380b9c888dc9d8"}},{"code_sha256_prefix":"97ce574c0c7a8f63","entry":"main","repo":"unslothai/unsloth","repo_kind":"found_in_text","path":"docker/unsloth_nb_strip_colab.py","file_url":"https://github.com/unslothai/unsloth/blob/HEAD/docker/unsloth_nb_strip_colab.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":"97ce574c0c7a8f63"}},{"code_sha256_prefix":"df154046e115394b","entry":"middle_digest","repo":"unslothai/unsloth","repo_kind":"found_in_text","path":"docker/unsloth_nb_content_sig.py","file_url":"https://github.com/unslothai/unsloth/blob/HEAD/docker/unsloth_nb_content_sig.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":"df154046e115394b"}},{"code_sha256_prefix":"b001aed562e92777","entry":"migrate","repo":"unslothai/unsloth","repo_kind":"found_in_text","path":"docker/unsloth_nb_strip_colab.py","file_url":"https://github.com/unslothai/unsloth/blob/HEAD/docker/unsloth_nb_strip_colab.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":"b001aed562e92777"}},{"code_sha256_prefix":"8325061d57610640","entry":"run","repo":"unslothai/unsloth","repo_kind":"found_in_text","path":"unsloth-cli.py","file_url":"https://github.com/unslothai/unsloth/blob/HEAD/unsloth-cli.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":"8325061d57610640"}},{"code_sha256_prefix":"10d7392c75c7582a","entry":"sidecar_for","repo":"unslothai/unsloth","repo_kind":"found_in_text","path":"docker/unsloth_nb_compat.py","file_url":"https://github.com/unslothai/unsloth/blob/HEAD/docker/unsloth_nb_compat.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":"10d7392c75c7582a"}}]},"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}