Dense layer
×MLA and a dense SwiGLU MLP, each added to the residual stream; layers 1–3.
All 36 steps
- in
- [B batch, T positions, 7168 d] [T positions, 32 pairs] [T queries, T keys]
- out
- [B batch, T positions, 7168 d]
Each residual addition runs in float32 inside the next RMSNorm, which returns the normalized sum and the sum, both cast back to bfloat16, the sum as the new stream; the first layer’s norm receives no residual (model.py 302–306, 844–849, 907).
Parameters597,442,816 × 3 layers
597,442,816 parameters per dense layer, across its learned components
| Component | Parameters |
|---|---|
| Attention RMSNorm | 7,168 |
| Sparse latent attention | 201,066,752 |
| MLP RMSNorm | 7,168 |
| SwiGLU MLP | 396,361,728 |
| Per-instance total | 597,442,816 |
One of 3 independent dense layers.
Sources
In codeBlock(layer_id, args)
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