SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.08589 · ICML · 2025

Retraining-Free Merging of Sparse MoE via Hierarchical Clustering

Yen-Chang Hsu, Wei-Fang Sun, Chun-Yi Lee, Chen-Hao Chao, I-Chun Chen, Hsu-Shen Liu

arXiv · PDF · Open in the Atlas

Code that ran

15 of 22 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 0 have no contract verdict; 15 failures of our instrument; 7 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; 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/2410.08589.json · badge: /api/ran/2410.08589.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
wazenmai/HC-SMoE canonical (classifier label)
classifier basis: census
9 ran · 5 no recorded run
wazenmai/hc-smoe canonical (classifier label)
classifier basis: classifier_2025
6 ran · 2 no recorded run
FunctionStatusWhere it lives
apply_mask Ran
ran; our contract draft was wrong, not the code
wazenmai/HC-SMoE/hcsmoe/merging/grouping_mixtral.py
code served (permissive licence) · get_code("2663637656dd4380")
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 RemovableHandle. 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)

# Create a simple nn.Module that will be used with the hook
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Create a small mask tensor (same shape as expected input)
mask = torch.ones(2, 4)

# Create an instance of the module
module = SimpleModel()

ARGS = {
    "module": module,
    "_mask": 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 RemovableHandle — a RemovableHandle output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a RemovableHandle 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
bhattacharyya_distance Ran
ran; our contract draft was wrong, not the code
wazenmai/HC-SMoE/hcsmoe/merging/overlap.py
code served (permissive licence) · get_code("8af6d52439df5ac1")
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

torch.manual_seed(0)

# Create small tensors for testing
# Dimension size: 4
dim = 4

# Mean vectors: shape (4,)
mean_X = torch.randn(dim)
mean_Y = torch.randn(dim)

# Covariance matrices: shape (4, 4), must be positive semi-definite
# Create them as A^T @ A to ensure they're positive semi-definite
A_X = torch.randn(dim, dim)
cov_X = A_X.T @ A_X

A_Y = torch.randn(dim, dim)
cov_Y = A_Y.T @ A_Y

ARGS = {
    "mean_X": mean_X,
    "cov_X": cov_X,
    "mean_Y": mean_Y,
    "cov_Y": cov_Y,
    "epsilon": 1e-06
}
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
compute_distance Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
wazenmai/hc-smoe/hcsmoe/merging/clustering.py
code served (permissive licence) · get_code("89eaaed986467ca4")
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 torch

torch.manual_seed(0)

# Create a small distance matrix (4x4 pairwise distances between 4 points)
pair_distances = torch.tensor([
    [0.0, 1.0, 2.0, 3.0],
    [1.0, 0.0, 1.5, 2.5],
    [2.0, 1.5, 0.0, 1.0],
    [3.0, 2.5, 1.0, 0.0]
])

# Create cluster assignments for 4 points into 3 clusters
clusters = torch.tensor([0, 0, 1, 2])

# Create feature matrix for ward method (4 points, 3 features)
X = torch.randn(4, 3)

ARGS = {
    'pair_distances': pair_distances,
    'clusters': clusters,
    'method': 'average',
    'X': X
}
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 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
compute_silhouette_score Ran
ran; our contract draft was wrong, not the code
wazenmai/hc-smoe/hcsmoe/merging/clustering.py
code served (permissive licence) · get_code("445a25a3378933c0")
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 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

torch.manual_seed(0)

# Create a small tensor list with shape (num_tensors, feature_dim)
# Using distinct dimensions: 5 tensors, 4 features each
tensor_list = torch.randn(5, 4)

# Create cluster labels for the 5 tensors
# Using 2 clusters: some tensors in cluster 0, some in cluster 1
cluster_labels = torch.tensor([0, 0, 1, 1, 0])

ARGS = {
    'tensor_list': tensor_list,
    'cluster_labels': cluster_labels,
}
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 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
compute_silhouette_score Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
wazenmai/hc-smoe/hcsmoe/merging/clustering.py
code served (permissive licence) · get_code("9e3b2b903c89aa39")
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

torch.manual_seed(0)

# Create a small tensor list with shape (num_tensors, feature_dim)
# Using 6 tensors with 4-dimensional features
tensor_list = torch.randn(6, 4)

# Create cluster labels for the 6 tensors
# Using 3 clusters: labels [0, 0, 1, 1, 2, 2]
cluster_labels = torch.tensor([0, 0, 1, 1, 2, 2])

ARGS = {
    'tensor_list': tensor_list,
    'cluster_labels': cluster_labels,
}
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
compute_switch_permutation_by_weight_matching Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
wazenmai/HC-SMoE/hcsmoe/merging/permutation.py
code served (permissive licence) · get_code("cd57bc0268739af9")
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 1, dtype family int, shape (32,) 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
from transformers.models.switch_transformers.modeling_switch_transformers import SwitchTransformersDenseActDense
from transformers import SwitchTransformersConfig

torch.manual_seed(0)

# Create a minimal config for SwitchTransformers
config = SwitchTransformersConfig(
    d_model=16,
    d_ff=32,
    dropout_rate=0.0
)

# Create two MLP instances
reference_mlp = SwitchTransformersDenseActDense(config)
target_mlp = SwitchTransformersDenseActDense(config)

# Verify the MLPs have the expected attributes
# wi.weight shape: (d_ff, d_model) = (32, 16)
# wo.weight shape: (d_model, d_ff) = (16, 32)

ARGS = {
    "reference_mlp": reference_mlp,
    "target_mlp": target_mlp,
    "include_wo": True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
scipy, torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 1, dtype family int, shape (32,) — shape (32,) 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
hijack Ran
ran; our contract draft was wrong, not the code
wazenmai/HC-SMoE/hcsmoe/merging/grouping_mixtral.py
code served (permissive licence) · get_code("644aac920c458274")
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 RemovableHandle. 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)

# Create a simple module that the hijack function will hook into
module = nn.Linear(4, 3)

# Create an empty list to collect hijacked values
_list = []

# Test with input hijacking
_hijack_input = True

# _stop_forward is not used in the function body, but we include it
_stop_forward = False

ARGS = {
    "module": module,
    "_list": _list,
    "_hijack_input": _hijack_input,
    "_stop_forward": _stop_forward
}
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 RemovableHandle — a RemovableHandle output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a RemovableHandle 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
hijack Ran
ran; our contract draft was wrong, not the code
wazenmai/HC-SMoE/hcsmoe/merging/grouping_qwen.py
code served (permissive licence) · get_code("c20ae1a60dcd8e85")
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 RemovableHandle. 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)

# Create a simple module that will be hooked
class SimpleModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Create the module instance
module = SimpleModule()

# Create a list to collect hooked inputs
_list = []

# Set hijack_input to True (the function only implements this case)
_hijack_input = True

# Set stop_forward to False for normal execution
_stop_forward = False

ARGS = {
    'module': module,
    '_list': _list,
    '_hijack_input': _hijack_input,
    '_stop_forward': _stop_forward
}
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 RemovableHandle — a RemovableHandle output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a RemovableHandle 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
linkage_step Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
wazenmai/hc-smoe/hcsmoe/merging/clustering.py
code served (permissive licence) · get_code("4047127dc3316fbe")
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. 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)

# Create a small distance matrix (pairwise distances between 2 points)
pair_distances = torch.tensor([
    [0.0, 1.5],
    [1.5, 0.0]
], dtype=torch.float32)

# Create a condensed distance matrix for the linkage_step function
# This is a symmetric matrix with inf on diagonal
distances = torch.tensor([
    [float('inf'), 2.3],
    [2.3, float('inf')]
], dtype=torch.float32)

# Cluster assignments: point 0 in cluster 0, point 1 in cluster 1
clusters = torch.tensor([0, 1], dtype=torch.long)

# Feature matrix X needed for 'ward' method
X = torch.randn(2, 4, dtype=torch.float32)

ARGS = {
    'distances': distances,
    'pair_distances': pair_distances,
    'clusters': clusters,
    'method': 'single',
    'X': X
}
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 tuple — a tuple output has no array shape of its own; none is 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
overlap_rate Ran
ran; our contract draft was wrong, not the code
wazenmai/HC-SMoE/hcsmoe/merging/overlap.py
code served (permissive licence) · get_code("09fbe56b373956ff")
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 torch

torch.manual_seed(0)

# Create two small tensors with shape (batch_size, dimensions)
# X and Y represent point clouds or bounding boxes in 4D space
X = torch.randn(2, 4)  # 2 points in 4D space
Y = torch.randn(3, 4)  # 3 points in 4D space

ARGS = {
    "X": X,
    "Y": Y,
}
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 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
overlap_rate_bhattacharyya Ran
ran; our contract draft was wrong, not the code
wazenmai/HC-SMoE/hcsmoe/merging/overlap.py
code served (permissive licence) · get_code("ff29e60e8a9b900a")
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 torch

torch.manual_seed(0)

# Create two small tensors for X and Y
# Shape: (batch_size=2, dimensions=4)
X = torch.randn(2, 4)
Y = torch.randn(2, 4)

ARGS = {
    "X": X,
    "Y": Y,
}
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 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
pairwise_distances Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
wazenmai/hc-smoe/hcsmoe/merging/clustering.py
code served (permissive licence) · get_code("881d32a340b4337a")
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 2, dtype family float, shape (2, 2) 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)

# Create a small tensor for pairwise distance computation
# Shape: (2, 4) - 2 points in 4-dimensional space
X = torch.randn(2, 4)

ARGS = {
    'X': X,
    'method': 'single'
}
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 2, dtype family float, shape (2, 2) — shape (2, 2) 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
permute_switch_mlp_dense_expert_ Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
wazenmai/HC-SMoE/hcsmoe/merging/permutation.py
code served (permissive licence) · get_code("ed870812c5e5c849")
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 SwitchTransformersDenseActDense. 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
from transformers import SwitchTransformersConfig
from transformers.models.switch_transformers.modeling_switch_transformers import SwitchTransformersDenseActDense
from copy import deepcopy

torch.manual_seed(0)

# Create a SwitchTransformersDenseActDense module with small dimensions
# d_model=4 (input dimension), d_ff=8 (hidden/feedforward dimension)
config = SwitchTransformersConfig(
    d_model=4,
    d_ff=8,
    dropout_rate=0.0
)

dense_mlp = SwitchTransformersDenseActDense(config)

# Create a permutation vector for d_ff=8
perm = torch.randperm(8)

ARGS = {
    "dense_mlp": dense_mlp,
    "perm": perm
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SwitchTransformersDenseActDense — a SwitchTransformersDenseActDense output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SwitchTransformersDenseActDense 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
remove_col Ran
ran; our contract draft was wrong, not the code
wazenmai/HC-SMoE/hcsmoe/merging/grouping_mixtral.py
pointer only (licence: MIT); the stored copy get_code serves, from zju-vipa/training_free_model_merging, is pointer only (licence: NONE) · get_code("ac28dcec5c8aa992")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from zju-vipa/training_free_model_merging, and GitHub detected no licence in that repository 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.

safe_average Ran
ran; our contract draft was wrong, not the code
wazenmai/hc-smoe/hcsmoe/merging/clustering.py
code served (permissive licence) · get_code("d7c56984b5555b6e")
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 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

torch.manual_seed(0)

# The function safe_average takes a tensor and computes the mean of non-inf values
# We need to create a tensor that demonstrates the function's behavior

# Create a small tensor with some inf values mixed in
tensor = torch.tensor([1.0, 2.0, float('inf'), 3.0, float('-inf'), 4.0])

ARGS = {
    "tensor": tensor
}
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 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
align_switch_permutation_for_all_experts_by_weight_matching Not yet run
unverified (harvested, no recorded run)
wazenmai/HC-SMoE/hcsmoe/merging/permutation.py
code served (permissive licence) · get_code("5f5c679efbd91d5c")
How it ran

no invocation recorded.

evaluate_minipile_perplexity Not yet run
unverified (harvested, no recorded run)
wazenmai/HC-SMoE/hcsmoe/evaluation/minipile.py
code served (permissive licence) · get_code("e4b8bffda1c924f8")
How it ran

no invocation recorded.

generate_random_group_labels Not yet run
unverified (harvested, no recorded run)
wazenmai/HC-SMoE/hcsmoe/merging/utils.py
code served (permissive licence) · get_code("2a3e7e560f218cc4")
How it ran

no invocation recorded.

get_minipile_dataloder Not yet run
unverified (harvested, no recorded run)
wazenmai/HC-SMoE/hcsmoe/evaluation/minipile.py
code served (permissive licence) · get_code("2ce9c4afb75f7a42")
How it ran

no invocation recorded.

group_experts_by_clustering Not yet run
unverified (harvested, no recorded run)
wazenmai/hc-smoe/hcsmoe/merging/clustering.py
code served (permissive licence) · get_code("41388c0799d06a0b")
How it ran

no invocation recorded.

hierarchical_clustering_dynamic Not yet run
unverified (harvested, no recorded run)
wazenmai/hc-smoe/hcsmoe/merging/clustering.py
code served (permissive licence) · get_code("83e8336dcb695d24")
How it ran

no invocation recorded.

safe_average Not yet run
unverified (harvested, no recorded run)
wazenmai/HC-SMoE/hcsmoe/merging/clustering.py
code served (permissive licence) · get_code("1ea84b1496629450")
How it ran

no invocation recorded.

Also present in other papers' code

Of 22 samples lifted from this paper's linked repositories, 22 carry a function identity and 0 do not. Of the 20 distinct functions with an identity, 4 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 0 later) and 16 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
evaluate_minipile_perplexity 1 other paper
1 undated
no dated paper among those named
openreview_4iupzej9nT
Less Token, More Signal: MoE Expert Pruning via Critical Token Selection
generate_random_group_labels 1 other paper
1 dated earlier
2310.01334 (2023-10)
Merge, Then Compress: Demystify Efficient SMoE with Hints from Its Routing Policy
get_minipile_dataloder 1 other paper
1 undated
no dated paper among those named
openreview_4iupzej9nT
Less Token, More Signal: MoE Expert Pruning via Critical Token Selection
remove_col 1 other paper
1 dated earlier
2403.01753 (2024-03)
Training-Free Pretrained Model Merging

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

Sparse Mixture-of-Experts (SMoE) models represent a significant advancement in large language model (LLM) development through their efficient parameter utilization. These models achieve substantial performance improvements at reduced inference costs. However, the deployment of SMoE models faces constraints from extensive memory requirements of expert components in resource-limited environments. To address these limitations, this paper introduces Hierarchical Clustering for Sparsely activated Mixture of Experts (HC-SMoE), a task-agnostic expert merging framework for parameter reduction without retraining. HC-SMoE introduces a novel hierarchical clustering approach based on expert outputs to ensure merging robustness independent of routing decisions. The proposed output-based clustering method enables effective capture of functional relationships between experts for largescale architectures. We provide theoretical analysis and comprehensive evaluations across multiple zero-shot language tasks to demonstrate HC-SMoE's effectiveness in state-of-the-art models including Qwen and Mixtral. The experimental results validate HC-SMoE's superior performance and practical applicability for real-world deployments. Our implementation is available at https://github.com/wazenmai/HC-SMoE.

For agents

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

get_harvested_code_for_paper("2410.08589")
get_code_for_paper("2410.08589")
have("2410.08589")

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

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

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

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

Connect an agent — have() is free.