SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · openreview_4iupzej9nT

Less Token, More Signal: MoE Expert Pruning via Critical Token Selection

Kai Zhang, Jilin Hu, Wenming Tan, Ye Ren, Zeliang Zong, Yarong Wang

OpenReview · Open in the Atlas

Code that ran

6 of 15 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, 0 violated it and 4 have no contract verdict; 2 failures of our instrument; 9 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/openreview_4iupzej9nT.json · badge: /api/ran/openreview_4iupzej9nT.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
hikvision-research/STEP canonical (classifier label)
classifier basis: census
6 ran · 9 no recorded run
FunctionStatusWhere it lives
align_expert_weight Ran
ran on a synthesized input
hikvision-research/STEP/step/pruning/expert_prune.py
code served (permissive licence) · get_code("32918c00393cb204")
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 SimpleMLP. 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 SimpleMLP(nn.Module):
    def __init__(self, d_model, d_ff):
        super().__init__()
        self.gate_proj = nn.Linear(d_model, d_ff)
        self.up_proj = nn.Linear(d_model, d_ff)
        self.down_proj = nn.Linear(d_ff, d_model)

d_model = 4
d_ff = 3

reference_mlp = SimpleMLP(d_model, d_ff)
target_mlp = SimpleMLP(d_model, d_ff)

ARGS = {
    "reference_mlp": reference_mlp,
    "target_mlp": target_mlp,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
scipy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SimpleMLP — a SimpleMLP output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleMLP 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
apply_rotary_pos_emb Ran
ran; our contract draft was wrong, not the code
hikvision-research/STEP/step/model/olmoe/modeling_olmoe.py
code served (permissive licence) · get_code("bac65c3dafaec040")
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) and returned tuple, ndim 5, 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

torch.manual_seed(0)

# Create small tensors for query and key
# Shape: [batch_size, heads, seq_len, head_dim]
batch_size = 2
heads = 3
seq_len = 4
head_dim = 8

q = torch.randn(batch_size, heads, seq_len, head_dim)
k = torch.randn(batch_size, heads, seq_len, head_dim)

# Create cos and sin tensors
# Shape: [batch_size, seq_len, head_dim]
cos = torch.randn(batch_size, seq_len, head_dim)
sin = torch.randn(batch_size, seq_len, head_dim)

# position_ids is optional and unused according to docstring
position_ids = None

# unsqueeze_dim defaults to 1
unsqueeze_dim = 1

ARGS = {
    "q": q,
    "k": k,
    "cos": cos,
    "sin": sin,
    "position_ids": position_ids,
    "unsqueeze_dim": unsqueeze_dim,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 5, 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
calculate_olmoe_parameters Ran
ran on a synthesized input
hikvision-research/STEP/step/olmoe_parameters_cal.py
code served (permissive licence) · get_code("d9812bda1dc25707")
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 torch
import numpy as np

torch.manual_seed(0)

# The function takes a config dict with specific keys
# Let's build a minimal but realistic config for an OLMoE model

config = {
    'vocab_size': 32000,
    'hidden_size': 768,
    'num_hidden_layers': 12,
    'num_attention_heads': 12,
    'num_key_value_heads': 12,
    'intermediate_size': 3072,
    'num_experts': 8,
    'num_experts_per_tok': 2,
}

ARGS = {
    'config': config
}
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 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
format_number Ran
ran on a synthesized input
hikvision-research/STEP/step/olmoe_parameters_cal.py
code served (permissive licence) · get_code("a6e707d3adfcd489")
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

torch.manual_seed(0)

# The function format_number takes a single numeric parameter
# and formats it for display based on magnitude
# It accepts: int, float, or numeric types

ARGS = {
    'num': 1500000000.5  # A number in the billions range to test formatting
}
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 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_balancing_loss_func Ran
ran on a synthesized input
hikvision-research/STEP/step/model/olmoe/modeling_olmoe.py
code served (permissive licence) · get_code("84f6b3be4b370b1a")
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 Tensor, 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 torch
import torch.nn.functional as F

torch.manual_seed(0)

# Construct valid arguments for load_balancing_loss_func
# The function expects:
# - gate_logits: tuple of tensors or None
# - num_experts: int or None
# - top_k: int (default 2)
# - attention_mask: optional tensor

batch_size = 2
sequence_length = 3
num_experts = 4
num_hidden_layers = 2

# Create gate_logits as a tuple of tensors
# Each tensor has shape [batch_size * sequence_length, num_experts]
gate_logits = tuple(
    torch.randn(batch_size * sequence_length, num_experts)
    for _ in range(num_hidden_layers)
)

# Create attention_mask with shape [batch_size, sequence_length]
attention_mask = torch.ones(batch_size, sequence_length)

ARGS = {
    "gate_logits": gate_logits,
    "num_experts": num_experts,
    "top_k": 2,
    "attention_mask": attention_mask,
}
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 Tensor, 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
rotate_half Ran
ran; our contract draft was wrong, not the code
hikvision-research/STEP/step/model/olmoe/modeling_olmoe.py
code served (permissive licence) · get_code("b99eea6376d1e212")
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) and returned Tensor, ndim 2, dtype family float, shape (2, 4) 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 torch

torch.manual_seed(0)

# The function rotate_half takes a single parameter 'x' which is a tensor
# It accesses x.shape[-1] to get the last dimension
# It uses indexing with [..., :] slicing notation
# It calls torch.cat() to concatenate tensors

# Create a small tensor with shape (2, 4) - batch size 2, hidden dim 4
x = torch.randn(2, 4)

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
evaluate_minipile_perplexity Not yet run
unverified (harvested, no recorded run)
hikvision-research/STEP/step/minipile.py
code served (permissive licence) · get_code("e4b8bffda1c924f8")
How it ran

no invocation recorded.

expert_prune_by_mc_smoe Not yet run
unverified (harvested, no recorded run)
hikvision-research/STEP/step/pruning/expert_prune.py
code served (permissive licence) · get_code("f49e65a511a39ec0")
How it ran

no invocation recorded.

expert_prune_by_routing_score Not yet run
unverified (harvested, no recorded run)
hikvision-research/STEP/step/pruning/expert_prune.py
code served (permissive licence) · get_code("16efc476f1485252")
How it ran

no invocation recorded.

get_c4 Not yet run
unverified (harvested, no recorded run)
hikvision-research/STEP/step/lib/data.py
code served (permissive licence) · get_code("49637fd9dbf67223")
How it ran

no invocation recorded.

get_calib_train_data Not yet run
unverified (harvested, no recorded run)
hikvision-research/STEP/step/lib/data.py
code served (permissive licence) · get_code("16b9060cff9dee69")
How it ran

no invocation recorded.

get_minipile_dataloder Not yet run
unverified (harvested, no recorded run)
hikvision-research/STEP/step/minipile.py
code served (permissive licence) · get_code("2ce9c4afb75f7a42")
How it ran

no invocation recorded.

get_wikitext2 Not yet run
unverified (harvested, no recorded run)
hikvision-research/STEP/step/lib/data.py
code served (permissive licence) · get_code("3bfd595806d439a3")
How it ran

no invocation recorded.

load_olmoe_mix_dataset Not yet run
unverified (harvested, no recorded run)
hikvision-research/STEP/step/dataset/olmoe_dataset.py
code served (permissive licence) · get_code("d05426cd66a110c2")
How it ran

no invocation recorded.

test_dataset_loading Not yet run
unverified (harvested, no recorded run)
hikvision-research/STEP/step/dataset/olmoe_dataset.py
code served (permissive licence) · get_code("f5c85799a7608edf")
How it ran

no invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 4 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 11 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
rotate_half 360 other papers
358 same year, order not determinable, 2 undated · 30 only as an assembly brick
1901.02860 (2019-01)
Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context
2203.08913 (2022-03)
Memorizing Transformers
2302.13971 (2023-02)
LLaMA: Open and Efficient Foundation Language Models
and 357 more not named here
apply_rotary_pos_emb 94 other papers
92 same year, order not determinable, 2 undated · 6 only as an assembly brick
1901.02860 (2019-01)
Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context
2305.17888 (2023-05)
LLM-QAT: Data-Free Quantization Aware Training for Large Language Models
2309.11674 (2023-09)
A Paradigm Shift in Machine Translation: Boosting Translation Performance of Large Language Models
and 91 more not named here
evaluate_minipile_perplexity 1 other paper
1 same year, order not determinable
2410.08589 (2024-10)
Retraining-Free Merging of Sparse MoE via Hierarchical Clustering
get_minipile_dataloder 1 other paper
1 same year, order not determinable
2410.08589 (2024-10)
Retraining-Free Merging of Sparse MoE via Hierarchical Clustering

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) architectures provide strong scalability for large language models, but their large expert parameter footprint poses challenges for efficient deployment. Expert pruning is widely used to reduce model size and inference cost; however, existing approaches are tokenagnostic, treating all tokens equally when estimating expert importance. This uniform treatment dilutes the contributions of informative tokens and leads to suboptimal pruning decisions. To address this fundamental limitation, we propose STEP (Selective Token-guided Expert Pruning), a token-aware framework that rethinks expert pruning from the perspective of selective token guidance. By incorporating loss-aware expert evaluation and a lightweight knowledge-preserving mechanism, STEP reduces information loss while removing redundant experts. Extensive experiments across different MoE architectures and model scales demonstrate the effectiveness of STEP. On the 30B Qwen3 MoE model with 50% expert sparsity, STEP achieves nearly a 50% reduction in memory usage with minimal performance degradation, delivers a 1.5× throughput improvement and completes the entire pruning process within 10 minutes. Codes are available in https://github.com/hikvision-research/STEP.

For agents

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

get_harvested_code_for_paper("openreview_4iupzej9nT")
get_code_for_paper("openreview_4iupzej9nT")
have("openreview_4iupzej9nT")

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

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

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

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

Connect an agent — have() is free.