Shared expert

Up projection

×

Map 8,192 input features to 2,048 features in parallel with the gate.

u=xffnWup{\htmlData{light=u up}{u}}={\htmlData{light=x}{x_{\mathrm{ffn}}}}W_{\mathrm{up}}
in
xffnx_{\mathrm{ffn}} [B batch, 1 position, 8192 d]
out
uu [B batch, 1 position, 2048 shared d_ff]
Parameters16,777,216 × 69 layers

16,777,216 parameters per instance.

ComponentCalculationParameters
Weight matrix8,192 × 2,04816,777,216

This projection has no bias parameter.

The reference module holds the weight output by input, [out, in].

One in each of the 69 GDN layers, each with its own weights.

Sources

In codeself.up_proj(x)

Open pinned code ↗

Direct evidence

The shared expert is a SwiGLU MLP: down(SiLU(gate x) · up x).

modeling_qwen3_5_moe.py 814–827 ↗ · huggingface/transformers @ 18329f106538

Excerpt
class Qwen3_5MoeMLP(nn.Module):
    def __init__(self, config: Qwen3_5MoeConfig, intermediate_size: int):
        super().__init__()
        self.config = config
        self.hidden_size = config.hidden_size
        self.intermediate_size = intermediate_size
        self.gate_proj = nn.Linear(self.hidden_size, self.intermediate_size, bias=False)
        self.up_proj = nn.Linear(self.hidden_size, self.intermediate_size, bias=False)
        self.down_proj = nn.Linear(self.intermediate_size, self.hidden_size, bias=False)
        self.act_fn = ACT2FN[config.hidden_act]

    def forward(self, x):
        down_proj = self.down_proj(self.act_fn(self.gate_proj(x)) * self.up_proj(x))
        return down_proj