Merge heads
×Concatenate the 96 heads into 12,288 features.
- in
- [B batch, 96 heads, T positions, 128 d_h]
- out
- [B batch, T positions, 12288 heads × d_h]
Explanation
Heads are concatenated in order: head fills features .
Sources
In coderearrange(o, 'b t h d -> b t (h d)') · 658
Direct evidence
The kernel’s output passes a gated RMSNorm, whose gate is the sigmoid of a full-rank projection of the layer’s input, and an output projection.
modeling_kimi_linear.py 651–659 ↗ · moonshotai/Kimi-K3 @ f831ab668142
Excerpt
if self.use_full_rank_gate:
g = self.g_proj(hidden_states)
else:
g = self.g_b_proj(self.g_a_proj(hidden_states))
g = rearrange(g, '... (h d) -> ... h d', d=self.head_dim)
o = self.o_norm(o, g)
o = rearrange(o, 'b t h d -> b t (h d)')
o = self.o_proj(o)