SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2608.10392 · 2026

Share First, Route What Remains: A Unified Framework for Token-Adaptive MoE Computation

C Chen, Zhulin Liu, Gongli Zhang

arXiv · PDF · Open in the Atlas

Code that ran

2 of 2 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 0 failures of our instrument; 0 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/2608.10392.json · badge: /api/ran/2608.10392.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
existence0420/UniF-MoE community
Papers with Code archive
2 ran · 0 no recorded run
FunctionStatusWhere it lives
BlockedExperts Ran
ran on a synthesized input · constructed an object; no result was computed
existence0420/UniF-MoE/Language/unif_moe.py
code served (permissive licence) · get_code("ff6ebe09691d6ad8")
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 an instance of its own class, BlockedExperts: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn

torch.manual_seed(0)

class BlockedExperts(nn.Module):
    """FFN parameters stored as ``[expert, block, channel, model_dim]``."""

    def __init__(self, num_experts, model_dim, hidden_dim, num_blocks):
        super().__init__()
        if hidden_dim % num_blocks != 0:
            raise ValueError('hidden_dim ({}) must be divisible by num_blocks ({}).'.format(hidden_dim, num_blocks))
        self.num_experts = int(num_experts)
        self.model_dim = int(model_dim)
        self.hidden_dim = int(hidden_dim)
        self.num_blocks = int(num_blocks)
        self.block_size = self.hidden_dim // self.num_blocks
        shape = (self.num_experts, self.num_blocks, self.block_size, self.model_dim)
        self.up_proj_weight = nn.Parameter(torch.empty(shape))
        self.up_proj_bias = nn.Parameter(torch.empty(self.num_experts, self.num_blocks, self.block_size))
        self.down_proj_weight = nn.Parameter(torch.empty(shape))
        self.down_proj_bias = nn.Parameter(torch.empty(self.num_experts, self.model_dim))
        self.reset_parameters()

    def reset_parameters(self):
        for expert_index in range(self.num_experts):
            up_proj = nn.Linear(self.model_dim, self.hidden_dim)
            down_proj = nn.Linear(self.hidden_dim, self.model_dim)
            with torch.no_grad():
                self.up_proj_weight[expert_index].copy_(up_proj.weight.view(self.num_blocks, self.block_size, self.model_dim))
                self.up_proj_bias[expert_index].copy_(up_proj.bias.view(self.num_blocks, self.block_size))
                self.down_proj_weight[expert_index].copy_(down_proj.weight.t().contiguous().view(self.num_blocks, self.block_size, self.model_dim))
                self.down_proj_bias[expert_index].copy_(down_proj.bias)

    def dense_pretrained_state_dict(self, prefix, up_weight, up_bias, down_weight, down_bias):
        """Copy one dense FFN into every expert."""
        expected_up = (self.hidden_dim, self.model_dim)
        expected_down = (self.model_dim, self.hidden_dim)
        if tuple(up_weight.shape) != expected_up:
            raise ValueError('Expected up-projection shape {}, got {}.'.format(expected_up, tuple(up_weight.shape)))
        if tuple(down_weight.shape) != expected_down:
            raise ValueError('Expected down-projection shape {}, got {}.'.format(expected_down, tuple(down_weight.shape)))
        if tuple(up_bias.shape) != (self.hidden_dim,):
            raise ValueError('Expected up-projection bias shape {}, got {}.'.format((self.hidden_dim,), tuple(up_bias.shape)))
        if tuple(down_bias.shape) != (self.model_dim,):
            raise ValueError('Expected down-projection bias shape {}, got {}.'.format((self.model_dim,), tuple(down_bias.shape)))
        up_weight = up_weight.reshape(self.num_blocks, self.block_size, self.model_dim)
        up_bias = up_bias.reshape(self.num_blocks, self.block_size)
        down_weight = down_weight.t().contiguous().reshape(self.num_blocks, self.block_size, self.model_dim)
        return {'{}.up_proj_weight'.format(prefix): up_weight.unsqueeze(0).expand(self.num_experts, -1, -1, -1).clone(), '{}.up_proj_bias'.format(prefix): up_bias.unsqueeze(0).expand(self.num_experts, -1, -1).clone(), '{}.down_proj_weight'.format(prefix): down_weight.unsqueeze(0).expand(self.num_experts, -1, -1, -1).clone(), '{}.down_proj_bias'.format(prefix): down_bias.reshape(1, self.model_dim).expand(self.num_experts, -1).clone()}

ARGS = {
    'num_experts': 2,
    'model_dim': 4,
    'hidden_dim': 8,
    'num_blocks': 2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type BlockedExperts — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a BlockedExperts 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
UniFMoE Ran
ran on a synthesized input · constructed an object; no result was computed
existence0420/UniF-MoE/Language/unif_moe.py
code served (permissive licence) · get_code("355df018c184f6bc")
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 an instance of its own class, UniFMoE: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn
import torch.nn.functional as F
import math

torch.manual_seed(0)

ARGS = {
    'model_dim': 8,
    'hidden_dim': 16,
    'num_experts': 3,
    'num_blocks': 4,
    'activation_fn': F.gelu,
    'hidden_dropout': 0.1,
    'output_dropout': 0.1,
    'diversity_loss_weight': 0.01,
    'orthogonal_router_init': True,
    'record_routing': False,
    'fixed_shared_demand': None,
    'fixed_residual_expert_count': None,
    'prefix_shared_block_selection': False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type UniFMoE — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a UniFMoE 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

Also present in other papers' code

Of 2 samples lifted from this paper's linked repositories, 2 carry a function identity and 0 do not. Of the 2 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 2 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.

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

Mixture-of-experts (MoE) models have recently moved beyond routing a fixed number of complete experts. Shared-expert designs preserve reusable knowledge, fine-grained methods vary computation within experts, and dynamic routers adapt the number of active experts. Yet these decisions are usually made independently, overlooking a basic dependency: extracting reusable computation changes both what remains and how much expert capacity the remainder needs. We study this dependency by decomposing sparsely upcycled feed-forward experts into keyvalue channels. Co-activated experts align at a subset of value positions; removing these positions changes expert preference; and greater shared coverage is associated with lower residual expert demand. These observations lead to one principle: share first, then route what remains. We instantiate it in UniF-MoE, a unified framework for token-adaptive MoE computation. Each expert is partitioned into aligned blocks. A shared-demand score sets the shared block count and pathway weight, key prototypes select the shared content, and the complementary demand determines the residual expert count through cumulative routing mass. A Gram regularizer separates and normalizes router embeddings, promoting diverse routing directions, sparse expert overlap, and a simple routing geometry. Experiments on DomainBed and GLUE show that this unified design improves predictive performance over representative static and dynamic MoEs while reducing activated computation, inference latency, and memory. Code is available at https://github.com/existence0420/UniF-MoE.

For agents

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

get_harvested_code_for_paper("2608.10392")
get_code_for_paper("2608.10392")
have("2608.10392")

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

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

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

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

Connect an agent — have() is free.