SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2606.05859 · 2026

TARPO: Token-Wise Latent-Explicit Reasoning via Action-Routing Policy Optimization

Xuyang Zhao, Shiwan Zhao, Qicheng Li, Jianye Wang, Liting Zhang, Zichen Xu

arXiv · PDF · Open in the Atlas

Code that ran

10 of 18 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 9 failures of our instrument; 8 no recorded run), measured 2026-11-24; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2606.05859.json · badge: /api/ran/2606.05859.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
unslothai/unsloth canonical (classifier label)
classifier basis: census
7 ran · 6 no recorded run
NKU-LITI/TARPO-master canonical (classifier label)
classifier basis: census
3 ran · 2 no recorded run
FunctionStatusWhere it lives
build_view Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
unslothai/unsloth/docker/unsloth_nb_view.py
code served (permissive licence) · get_code("5734cdff3479c248")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import tempfile
import shutil

# Create a temporary directory structure for testing
tmpdir = tempfile.mkdtemp()
dest = tmpdir
view = os.path.join(tmpdir, 'view')

# Create nb directory with some test notebooks
nb_dir = os.path.join(dest, 'nb')
os.makedirs(nb_dir, exist_ok=True)

# Create some test notebook files
with open(os.path.join(nb_dir, 'notebook1.ipynb'), 'w') as f:
    f.write('{}')
with open(os.path.join(nb_dir, 'notebook2.ipynb'), 'w') as f:
    f.write('{}')
with open(os.path.join(nb_dir, 'AMD-notebook.ipynb'), 'w') as f:
    f.write('{}')

# Create a README.md with references to notebooks
readme_content = """# Getting Started

## Section 1
- [Notebook 1](nb/notebook1.ipynb)

## Section 2
- [Notebook 2](nb/notebook2.ipynb)

## Other Notebooks
- [AMD Notebook](nb/AMD-notebook.ipynb)
"""

with open(os.path.join(dest, 'README.md'), 'w') as f:
    f.write(readme_content)

# Create the view directory
os.makedirs(view, exist_ok=True)

ARGS = {
    'dest': dest,
    'view': view,
    'amd': False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
unsloth_run — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family int — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
clean_section Ran
ran; our contract draft was wrong, not the code
unslothai/unsloth/docker/unsloth_nb_view.py
code served (permissive licence) · get_code("c994f7c8db8f0369")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re

def clean_section(title):
    title = title.strip().strip('#').strip()
    title = re.sub('^[^\\w]+', '', title)
    title = title.replace('-', ' ').replace('/', ' ')
    title = re.sub('\\s+', ' ', title).strip()
    return title

ARGS = {
    'title': '### Hello-World / Test ###'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
colab_cell_magic_fix Ran
ran; our contract draft was wrong, not the code
unslothai/unsloth/docker/unsloth_colab_compat.py
code served (permissive licence) · get_code("749159f289094827")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

# Construct arguments for colab_cell_magic_fix
# The function takes 'lines' parameter which should be a list of strings

# Test case 1: Simple lines with a cell magic that should be hoisted
lines_with_magic = [
    '',
    '# This is a comment',
    '',
    '%%time',
    'print("hello")',
    'x = 1'
]

ARGS = {
    'lines': lines_with_magic
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
estimate_pass_at_k Ran
ran; our contract draft was wrong, not the code
NKU-LITI/TARPO-master/humanevaleval.py
pointer only (licence: NONE); the stored copy get_code serves, from rucaibox/bamboo, is pointer only (licence: NONE) · get_code("e080db2eaa81fdb3")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, NKU-LITI/TARPO-master when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

extract_python_code Ran
ran; our contract draft was wrong, not the code
NKU-LITI/TARPO-master/eval_tharp_humaneval_avg.py
pointer only (licence: NONE) · get_code("6cad710a9cef59bc")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, NKU-LITI/TARPO-master when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

parse_readme Ran
ran; our contract draft was wrong, not the code
unslothai/unsloth/docker/unsloth_nb_view.py
code served (permissive licence) · get_code("0e45f9de20f9f709")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tempfile
import os

# Create a temporary README file with sample content
temp_dir = tempfile.mkdtemp()
readme_path = os.path.join(temp_dir, 'README.md')

readme_content = """# Overview

Some introductory text here.

## Getting Started

Check out [this notebook](nb/intro.ipynb) to begin.

## Advanced Topics

Here are some advanced notebooks:
- [Advanced notebook](nb/advanced%20techniques.ipynb)
- [Another one](nb/data%20processing.ipynb)

### Subsection Example

More content with [notebook link](nb/subsection%20example.ipynb).

## Getting Started

Duplicate section header with [another notebook](nb/another_notebook.ipynb).
And [intro.ipynb](nb/intro.ipynb) appears again in different section.

## Data Analysis

Check [analysis(v2).ipynb](nb/analysis%28v2%29.ipynb) for details.
"""

with open(readme_path, 'w', encoding='utf-8') as f:
    f.write(readme_content)

ARGS = {
    'readme_path': readme_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
pin_from Ran
ran; our contract draft was wrong, not the code
unslothai/unsloth/docker/unsloth_nb_compat.py
code served (permissive licence) · get_code("9a228da89620120f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re
import shlex

def pin_from(text):
    """transformers version pinned by an install command in `text`, else None."""
    _PIN_RE = re.compile('(?<![\\w.\\-])([A-Za-z0-9][A-Za-z0-9._\\-]*)[ \\t]*(?:\\[[^\\]]*\\])?[ \\t]*==[ \\t]*([0-9][0-9A-Za-z.\\-]*)')
    
    def _norm_req(name):
        """PEP 503 normalised distribution name, the rule unsloth_pip_shim._norm_name uses."""
        return re.sub('[-_.]+', '-', name.strip()).lower()

    def _marker_skipped_versions(lines):
        """transformers versions on these lines whose PEP 508 marker is FALSE here."""
        skipped = set()
        try:
            from packaging.requirements import Requirement
        except Exception:
            return skipped
        for line in lines.splitlines():
            try:
                tokens = shlex.split(line, posix=True)
            except ValueError:
                continue
            for tok in tokens:
                try:
                    req = Requirement(tok)
                    if _norm_req(req.name) != 'transformers' or req.marker is None:
                        continue
                    if req.marker.evaluate():
                        continue
                except Exception:
                    continue
                for spec in req.specifier:
                    if spec.operator == '==':
                        skipped.add(spec.version)
        return skipped

    def _strip_comment(line):
        """Drop a trailing `# ...` from a shell/magic line."""
        quote = None
        for i, ch in enumerate(line):
            if quote:
                if ch == quote:
                    quote = None
            elif ch in '\'"':
                quote = ch
            elif ch == '#' and (i == 0 or line[i - 1].isspace()):
                return line[:i]
        return line

    _INSTALL_RE = re.compile('^[ \\t]*(?![ \\t]*\\#)[!%]?[ \\t]*\n        (?: uv (?:[ \\t]+-{1,2}\\S+)* [ \\t]+ )?\n        (?: \\S+ [ \\t]+ -m [ \\t]+ )?\n        pip[0-9.]* [ \\t]+\n        (?: -{1,2}\\S+ [ \\t]+ )*\n        install (?: [ \\t] | $ )', re.VERBOSE)

    def _install_lines(src):
        kept, cont = ([], False)
        for line in src.splitlines():
            if cont or _INSTALL_RE.match(line):
                code = _strip_comment(line)
                kept.append(code)
                cont = code.rstrip().endswith('\\')
            else:
                cont = False
        return '\n'.join(kept)

    lines = _install_lines(text)
    skipped = _marker_skipped_versions(lines)
    for m in _PIN_RE.finditer(lines):
        if _norm_req(m.group(1)) == 'transformers' and m.group(2) not in skipped:
            return m.group(2)
    return None


ARGS = {
    "text": "pip install transformers==4.30.0 torch==2.0.0"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
packaging — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
read_problems Ran
ran; our contract draft was wrong, not the code
NKU-LITI/TARPO-master/humanevaleval.py
pointer only (licence: NONE) · get_code("e289de48f4ad6a1e")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, NKU-LITI/TARPO-master when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

strip_notebook Ran
ran, violated the contract we drafted
unslothai/unsloth/docker/unsloth_nb_strip_colab.py
code served (permissive licence) · get_code("76d9203754a4938d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tempfile
import json
import os

# Create a temporary notebook file for testing
temp_dir = tempfile.mkdtemp()
notebook_path = os.path.join(temp_dir, "test_notebook.ipynb")

# Create a valid Jupyter notebook structure
notebook = {
    "cells": [
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": ["# Test Notebook\n", "to run this, press Shift+Enter"]
        },
        {
            "cell_type": "code",
            "execution_count": None,
            "metadata": {},
            "outputs": [
                {
                    "data": {
                        "application/vnd.jupyter.widget-view+json": {
                            "version_major": 2,
                            "version_minor": 0,
                            "model_id": "abc123"
                        }
                    },
                    "metadata": {},
                    "output_type": "display_data"
                }
            ],
            "source": ["print('hello')"]
        }
    ],
    "metadata": {
        "kernelspec": {
            "display_name": "Python 3",
            "language": "python",
            "name": "python3"
        },
        "widgets": {
            "application/vnd.jupyter.widget-view+json": {
                "version_major": 2,
                "version_minor": 0,
                "state": {}
            }
        }
    },
    "nbformat": 4,
    "nbformat_minor": 4
}

# Write the notebook to disk
with open(notebook_path, 'w', encoding='utf-8') as f:
    json.dump(notebook, f, indent=1, ensure_ascii=False)
    f.write('\n')

# Create a dict to hold staged metadata
staged_dict = {}

ARGS = {
    "path": notebook_path,
    "staged": staged_dict
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
tier_for_model Ran
ran; our contract draft was wrong, not the code
unslothai/unsloth/docker/unsloth_nb_compat.py
code served (permissive licence) · get_code("3b12c847e4486846")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

ARGS = {
    "model_name": "gemma-4-12b"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
check_correctness Not yet run
unverified (harvested, no recorded run)
NKU-LITI/TARPO-master/humanevaleval.py
pointer only (licence: NONE) · get_code("1177382634e74969")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, NKU-LITI/TARPO-master when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

evaluate_saved_trajectories Not yet run
unverified (harvested, no recorded run)
NKU-LITI/TARPO-master/eval_tarpo_math_avg.py
pointer only (licence: NONE) · get_code("4ff13c21e1ebe6bd")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, NKU-LITI/TARPO-master when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

main Not yet run
unverified (harvested, no recorded run)
unslothai/unsloth/docker/unsloth_nb_content_sig.py
code served (permissive licence) · get_code("6b380b9c888dc9d8")
How it ran

no invocation recorded.

main Not yet run
unverified (harvested, no recorded run)
unslothai/unsloth/docker/unsloth_nb_strip_colab.py
code served (permissive licence) · get_code("97ce574c0c7a8f63")
How it ran

no invocation recorded.

middle_digest Not yet run
unverified (harvested, no recorded run)
unslothai/unsloth/docker/unsloth_nb_content_sig.py
code served (permissive licence) · get_code("df154046e115394b")
How it ran

no invocation recorded.

migrate Not yet run
unverified (harvested, no recorded run)
unslothai/unsloth/docker/unsloth_nb_strip_colab.py
code served (permissive licence) · get_code("b001aed562e92777")
How it ran

no invocation recorded.

run Not yet run
unverified (harvested, no recorded run)
unslothai/unsloth/unsloth-cli.py
code served (permissive licence) · get_code("8325061d57610640")
How it ran

no invocation recorded.

sidecar_for Not yet run
unverified (harvested, no recorded run)
unslothai/unsloth/docker/unsloth_nb_compat.py
code served (permissive licence) · get_code("10d7392c75c7582a")
How it ran

no invocation recorded.

Also present in other papers' code

Of 18 samples lifted from this paper's linked repositories, 18 carry a function identity and 0 do not. Of the 18 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 0 later) and 15 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
estimate_pass_at_k 20 other papers
20 dated earlier
2107.03374 (2021-07)
Evaluating Large Language Models Trained on Code
2207.14255 (2022-07)
Efficient Training of Language Models to Fill in the Middle
2210.14868 (2022-10)
Multi-lingual Evaluation of Code Generation Models
and 17 more not named here
read_problems 10 other papers
10 dated earlier
2310.20329 (2023-10)
InstructCoder: Instruction Tuning Large Language Models for Code Editing
2401.08565 (2024-01)
Tuning Language Models by Proxy
2401.14196 (2024-01)
DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligence
and 7 more not named here
check_correctness 2 other papers
2 dated earlier
2107.03374 (2021-07)
Evaluating Large Language Models Trained on Code
2402.14852 (2024-02)
HumanEval on Latest GPT Models -- 2024

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-24.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

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.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2606.05859")
get_code_for_paper("2606.05859")
have("2606.05859")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2606.05859.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2606.05859.svg)](https://syntology.ai/paper/2606.05859)

Connect an agent — have() is free.