SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2605.11301 · 2026

LatentRouter: Can We Choose the Right Multimodal Model Before Seeing Its Answer?

Xueqi Cheng, Yushun Dong

arXiv · PDF

Code that ran

7 of 8 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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 6 failures of our instrument; 1 no recorded run), measured 2026-11-23; 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/2605.11301.json · badge: /api/ran/2605.11301.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
LabRAI/LatentRouter canonical (classifier label)
classifier basis: census
7 ran · 1 no recorded run
FunctionStatusWhere it lives
discover_model_groups Ran
ran; our contract draft was wrong, not the code
LabRAI/LatentRouter/src/latentrouter/benchmarks/mmr.py
code served (permissive licence) · get_code("d960f42aad3c72c7")
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 dict. 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

torch.manual_seed(0)

def setup_args():
    # The function discover_model_groups takes a list of column names
    # and discovers model groups based on suffixes.
    # Looking at the function body:
    # - It iterates through columns (list[str])
    # - For each column, it checks if it ends with a suffix from MODEL_SUFFIXES
    # - It extracts model_id and canonical_name
    # - It filters groups that have at least one of: 'prediction', 'is_correct', 'cost'
    
    # Create test columns that will match various suffixes and form valid model groups
    columns = [
        'model_a_prediction',      # model_a with prediction
        'model_a_is_correct',      # model_a with is_correct
        'model_a_cost',            # model_a with cost (required for filtering)
        'model_b_pred',            # model_b with _pred -> prediction
        'model_b_is_correct',      # model_b with is_correct
        'model_b_cost',            # model_b with cost (required for filtering)
        'model_c_response',        # model_c with _response -> prediction
        'model_c_score',           # model_c with score
        'some_other_column',       # won't match any suffix or model_id will be empty
        'model_d_completion_tokens',  # model_d with completion_tokens
        'model_d_prompt_tokens',      # model_d with prompt_tokens
        'model_d_is_correct',         # model_d with is_correct
        'model_d_cost',              # model_d with cost (required for filtering)
    ]
    
    return {
        'columns': columns
    }

ARGS = setup_args()
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
ensure_dir Ran
ran; our contract draft was wrong, not the code
LabRAI/LatentRouter/src/latentrouter/io.py
code served (permissive licence) · get_code("25ba597a53fa8704")
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 PosixPath. 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 tempfile
from pathlib import Path

# Create a temporary directory to use as a base
temp_base = tempfile.gettempdir()

# Construct valid arguments for ensure_dir
ARGS = {
    "path": str(Path(temp_base) / "test_ensure_dir_subdir")
}
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 PosixPath — a PosixPath output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PosixPath 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
load_run_config Ran
ran; our contract draft was wrong, not the code
LabRAI/LatentRouter/src/latentrouter/config.py
code served (permissive licence) · get_code("f6fd3c5a4e15c317")
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 RunConfig. 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.

from pathlib import Path
from dataclasses import dataclass, field
from typing import Any
import tempfile
import yaml

# Create a temporary YAML file with valid configuration
with tempfile.NamedTemporaryFile(mode='w', suffix='.yaml', delete=False) as f:
    config_dict = {
        'data': {
            'benchmark': 'mmr',
            'source': 'hf://gh0stHunter/MMR-Bench',
            'source_split': 'train',
            'raw_dir': 'data/raw/mmr_bench',
            'processed_dir': 'data/processed/mmr_bench',
            'split_manifest': None,
            'train_fraction': 0.7,
            'validation_fraction': 0.1,
            'test_fraction': 0.2,
            'seed': 20260308,
            'adapter_options': {}
        },
        'features': {
            'backend': 'openclip',
            'openclip_model': 'ViT-B-32',
            'openclip_pretrained': 'laion2b_s34b_b79k',
            'hashing_dim': 256,
            'coconut_repo_path': None,
            'coconut_model_id': 'openai-community/gpt2',
            'coconut_checkpoint': None,
            'coconut_checkpoint_filename': 'pytorch_model.bin',
            'coconut_latent_tokens': 2,
            'coconut_max_length': 256,
            'batch_size': 32,
            'device': 'cpu',
            'output_dir': None,
            'force': False
        },
        'router': {
            'name': 'knn',
            'model_path': None,
            'random_seed': 20260308,
            'hyperparameters': {}
        },
        'evaluation': {
            'lambda_min_exp': -4.0,
            'lambda_max_exp': 4.0,
            'num_lambdas': 201,
            'output_dir': 'artifacts/runs',
            'aggregate_by': ['dataset_name', 'mode_id'],
            'protocol_options': {},
            'measure_throughput': False
        }
    }
    yaml.dump(config_dict, f)
    config_path = f.name

ARGS = {
    'path': config_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
yaml — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type RunConfig — a RunConfig output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a RunConfig 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
parse_dataset_fields Ran
ran; our contract draft was wrong, not the code
LabRAI/LatentRouter/src/latentrouter/benchmarks/mmr.py
code served (permissive licence) · get_code("6dd9cb3d46e60860")
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 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 re

def parse_dataset_fields(dataset_idx: str) -> tuple[str, str]:
    text = (dataset_idx or 'unknown').strip()
    patterns = ['::', '__', '|', '/', ':']
    for pattern in patterns:
        if pattern in text:
            left, right = text.split(pattern, 1)
            if left and right:
                return (left, right)
    match = re.match('^(?P<dataset>[A-Za-z0-9._-]+)[\\[\\(](?P<mode>[^\\]\\)]+)[\\]\\)]$', text)
    if match:
        return (match.group('dataset'), match.group('mode'))
    suffix_match = re.match('^(?P<dataset>.+)_(?P<row_id>\\d+)$', text)
    if suffix_match:
        return (suffix_match.group('dataset'), 'default')
    return (text or 'unknown', 'default')

ARGS = {
    'dataset_idx': 'train::validation'
}
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 tuple, ndim 1, dtype family float — 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
rank_score Ran
ran, honoured the contract we drafted
LabRAI/LatentRouter/src/latentrouter/benchmarks/vl_routerbench.py
code served (permissive licence) · get_code("2fae12bd97a83615")
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 float, 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 numpy as np

ARGS = {
    "avg_acc": 0.85,
    "avg_cost": 50.0,
    "cmin": 10.0,
    "cmax": 100.0,
    "beta": 0.1,
    "eps": 1e-12,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, 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
read_json Ran
ran; our contract draft was wrong, not the code
LabRAI/LatentRouter/src/latentrouter/io.py
code served (permissive licence) · get_code("578cfc781460c39a")
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 dict. 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 json
import tempfile
from pathlib import Path

# Create a temporary JSON file with test data
temp_dir = tempfile.TemporaryDirectory()
temp_file = Path(temp_dir.name) / "test.json"

test_data = {
    "key1": "value1",
    "key2": [1, 2, 3],
    "key3": {"nested": "object"}
}

with temp_file.open('w', encoding='utf-8') as f:
    json.dump(test_data, f)

ARGS = {
    "path": temp_file
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
stable_hash Ran
ran; our contract draft was wrong, not the code
LabRAI/LatentRouter/src/latentrouter/io.py
code served (permissive licence) · get_code("058d208375639d01")
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 hashlib

# The function takes a single parameter 'value' of type str
# It encodes the string to UTF-8 and computes its SHA256 hash

ARGS = {
    "value": "hello world"
}
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
load_frame Not yet run
unverified (harvested, no recorded run)
LabRAI/LatentRouter/src/latentrouter/benchmarks/mmr.py
code served (permissive licence) · get_code("0af18f548ef77495")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 2 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 1 the same month, 2 later) and 6 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
ensure_dir 2 other papers
1 the same month, 1 later
2605.28222 (2026-05)
Analyzing Quality-Latency-Resource Trade-offs in a Technical Documentation RAG Assistant Using LoRA Adaptation
2606.22305 (2026-06)
Learning at the Right Pace: Adaptive Data Scheduling Improves LLM Reinforcement Learning
read_json 1 other paper
1 later
2606.03980 (2026-06)
Skill-RM: Unifying Heterogeneous Evaluation Criteria via Agent Skill

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-23.

Repositories linked to this paper

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

Abstract

Multimodal large language models (MLLMs) have heterogeneous strengths across OCR, chart understanding, spatial reasoning, visual question answering, cost, and latency. Effective MLLM routing therefore requires more than estimating query difficulty: a router must match the multimodal requirements of the current image-question input with the capabilities of each candidate model. We propose LATENTROUTER, a router that formulates MLLM routing as counterfactual multimodal utility prediction. Given an image-question query, LATENTROUTER extracts learned multimodal routing capsules, represents each candidate MLLM with a model capability token, and performs latent communication between these states to estimate how each model would perform if selected. A distributional outcome head predicts model-specific counterfactual quality, while a bounded capsule correction refines close decisions without allowing residual signals to dominate the prediction. The resulting utility-based policy supports performanceoriented and performance-cost routing, and handles changing candidate pools through shared per-model scoring with availability masking. Experiments on MMR-Bench and VL-RouterBench show that LATENTROUTER outperforms fixedmodel, feature-level, and learned-router baselines. Additional analyses show that the gains are strongest on multimodal task groups where model choice depends on visual, layout-sensitive, or reasoning-oriented requirements, and that latent communication is the main contributor to the improvement. The code is available at: https://github.com/LabRAI/LatentRouter. Despite this practical need, MLLM routing remains underdeveloped compared with text-only LLM routing [26,18]. Most existing routers for multi-LLM systems were designed for language-only inputs, where routing decisions are typically based on text-derived query features [11,27], confidence or uncertainty estimates [44,1], cascading policies [4,10], or hierarchical routing structures [33,32].

For agents

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

get_harvested_code_for_paper("2605.11301")
get_code_for_paper("2605.11301")
have("2605.11301")

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

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

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

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

Connect an agent — have() is free.