SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2407.01906 · EMNLP · 2024

Let the Expert Stick to His Last: Expert-Specialized Fine-Tuning for Sparse Architectural Large Language Models

Yu Wu, Deli Chen, Zihan Wang, Damai Dai, Runxin Xu, Zhuoshu Li, Deepseek Ai

arXiv · PDF · Open in the Atlas

Code that ran

1 of 3 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; 1 failure of our instrument; 2 no recorded run), measured 2026-11-22; 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/2407.01906.json · badge: /api/ran/2407.01906.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
deepseek-ai/ESFT community
Papers with Code archive
1 ran · 2 no recorded run
FunctionStatusWhere it lives
to_esft Ran
ran; our contract draft was wrong, not the code
deepseek-ai/ESFT/esft.py
code served (permissive licence) · get_code("ea1f4e479a8241f9")
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 SimpleModel. 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)

# Build a minimal DeepseekV2MoE-like MLP module
class Expert(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def forward(self, x):
        return self.linear(x)

class DeepseekV2MoE(nn.Module):
    def __init__(self, num_experts=4):
        super().__init__()
        self.experts = nn.ModuleList([Expert() for _ in range(num_experts)])
        self.shared_experts = nn.ModuleList([Expert() for _ in range(2)])
    
    def forward(self, x):
        return x

class TransformerLayer(nn.Module):
    def __init__(self):
        super().__init__()
        self.mlp = DeepseekV2MoE(num_experts=4)
    
    def forward(self, x):
        return x

class SimpleModel(nn.Module):
    def __init__(self, num_layers=2):
        super().__init__()
        self.model = nn.Module()
        self.model.layers = nn.ModuleList([TransformerLayer() for _ in range(num_layers)])
    
    def forward(self, x):
        return x

# Create model instance
model = SimpleModel(num_layers=2)

# Create adapter config
adapter_config = {
    'non_expert_modules': False,
    'shared_experts': False,
    'experts': {
        '0': [0, 2],  # trainable expert indices for layer 0
        '1': [1, 3],  # trainable expert indices for layer 1
    }
}

ARGS = {
    'model': model,
    'adapter_config': adapter_config,
}
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 SimpleModel — a SimpleModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleModel 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
to_buffer Not yet run
unverified (harvested, no recorded run)
deepseek-ai/ESFT/esft.py
code served (permissive licence) · get_code("a3bb19394f240948")
How it ran

no invocation recorded.

to_param Not yet run
unverified (harvested, no recorded run)
deepseek-ai/ESFT/esft.py
code served (permissive licence) · get_code("ff1eb7fa11457860")
How it ran

no invocation recorded.

Also present in other papers' code

Of 3 samples lifted from this paper's linked repositories, 3 carry a function identity and 0 do not. Of the 3 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 3 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-22.

Repositories linked to this paper

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

Abstract

Parameter-efficient fine-tuning (PEFT) is crucial for customizing Large Language Models (LLMs) with constrained resources. Although there have been various PEFT methods for dense-architecture LLMs, PEFT for sparsearchitecture LLMs is still underexplored. In this work, we study the PEFT method for LLMs with the Mixture-of-Experts (MoE) architecture and the contents of this work are mainly threefold: (1) We investigate the dispersion degree of the activated experts in customized tasks, and found that the routing distribution for a specific task tends to be highly concentrated, while the distribution of activated experts varies significantly across different tasks. (2) We propose Expert-Specialized Fine-Tuning, or ESFT, which tunes the experts most relevant to downstream tasks while freezing the other experts and modules; experimental results demonstrate that our method not only improves the tuning efficiency, but also matches or even surpasses the performance of fullparameter fine-tuning. (3) We further analyze the impact of the MoE architecture on expertspecialized fine-tuning. We find that MoE models with finer-grained experts are more advantageous in selecting the combination of experts that are most relevant to downstream tasks, thereby enhancing both the training efficiency and effectiveness. Our code is available at https://github.com/deepseek-ai/ESFT.

For agents

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

get_harvested_code_for_paper("2407.01906")
get_code_for_paper("2407.01906")
have("2407.01906")

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

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

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

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

Connect an agent — have() is free.