MoE layer

xnx_n [B, T, 7168], RR [T, 32], MM [T, T]to xn+1x_{n+1} [B, T, 7168]

Parameters11,521,245,696 × 58 layers

11,521,245,696 parameters per MoE layer, across its learned components

ComponentParameters
Attention RMSNorm7,168
Sparse latent attention201,066,752
MoE RMSNorm7,168
Mixture of experts11,320,164,608
Per-instance total11,521,245,696

One of 58 independent MoE layers.

Weights · one layer, by sublayer

MoE layer · FP810.7 GiB
Attention · FP8193.1 MiB
MoE · FP810.5 GiB
Two RMSNorms · float3256 KiB

Attention 1.7% and the MoE 98.3% of the layer’s parameters; the two RMSNorms hold 14,336.

config_671B_v3.2.json 5–8, 17, 21model.py 826–829, 844–851, 876, 183–187, 284, 317–318, 449, 674–675generate.py 109
Sources

In codeBlock(layer_id, args)

Open pinned code ↗

Direct evidence

A layer applies attention-norm, MLA, ffn-norm and the FFN; the first n_dense_layers layers use the dense MLP, the rest MoE. Residual additions happen inside the next normalization.

model.py 826–851 ↗ · deepseek-ai/DeepSeek-V3.2-Exp @ 87e509a2e5a1

Excerpt
        self.attn = MLA(args)
        self.ffn = MLP(args.dim, args.inter_dim) if layer_id < args.n_dense_layers else MoE(args)
        self.attn_norm = RMSNorm(args.dim)
        self.ffn_norm = RMSNorm(args.dim)

… lines 830–843 omitted …

        if residual is None:
            x, residual = self.attn_norm(x), x
        else:
            x, residual = self.attn_norm(x, residual)
        x = self.attn(x, start_pos, freqs_cis, mask)
        x, residual = self.ffn_norm(x, residual)
        x = self.ffn(x)
        return x, residual