Output projection
×Map 16,384 head features to the 7,168-feature update.
- in
- [B batch, T positions, 16384 heads × value]
- out
- [B batch, T positions, 7168 d]
Parameters117,440,512 × 58 layers
117,440,512 parameters per instance.
| Component | Calculation | Parameters |
|---|---|---|
| Weight matrix | 16,384 × 7,168 | 117,440,512 |
This projection has no bias parameter.
The reference module holds the weight output by input, [out, in].
One in each of the 58 MoE layers, each with its own weights.
Sources
In codeself.wo(x.flatten(2))
Direct evidence
MLA owns a query down-projection, query RMSNorm and up-projection, a joint key–value down-projection that also emits the shared rotary key, a latent RMSNorm, a key–value up-projection and an output projection.
model.py 523–539 ↗ · deepseek-ai/DeepSeek-V3.2 @ a7e62ac04ecb
Excerpt
self.qk_head_dim = args.qk_nope_head_dim + args.qk_rope_head_dim
self.v_head_dim = args.v_head_dim
self.wq_a = Linear(self.dim, self.q_lora_rank)
self.q_norm = RMSNorm(self.q_lora_rank)
self.wq_b = ColumnParallelLinear(self.q_lora_rank, self.n_heads * self.qk_head_dim)
self.wkv_a = Linear(self.dim, self.kv_lora_rank + self.qk_rope_head_dim)
self.kv_norm = RMSNorm(self.kv_lora_rank)
self.wkv_b = ColumnParallelLinear(self.kv_lora_rank, self.n_heads * (self.qk_nope_head_dim + self.v_head_dim))
self.wo = RowParallelLinear(self.n_heads * self.v_head_dim, self.dim)
self.softmax_scale = self.qk_head_dim ** -0.5
self.scale_fmt = args.scale_fmt
if args.max_seq_len > args.original_seq_len:
mscale = 0.1 * args.mscale * math.log(args.rope_factor) + 1.0
self.softmax_scale = self.softmax_scale * mscale * mscale
self.indexer = Indexer(args)Head outputs are flattened and projected back to the model width.
model.py 607–608 ↗ · deepseek-ai/DeepSeek-V3.2 @ a7e62ac04ecb
Excerpt
x = self.wo(x.flatten(2))
return x