Mix and project

Merge heads

×

Concatenate the heads at each position.

[B, 64, T, 128][B,\,64,\,T,\,128]
→  [B, T, 64, 128]\to\;[B,\,T,\,64,\,128]
→  [B, T, 8192]\to\;[B,\,T,\,8192]
in
OO [B batch, 64 heads, T positions, 128 value]
out
oo [B batch, T positions, 8192 heads × value]
Explanation

Heads are concatenated in order: head ii fills features 128i,…,128i+127{128i},\dots,{128i+127}.

Sources

In codeattn_output.reshape(bsz, q_len, self.num_heads * self.v_head_dim)

Open pinned code ↗

Direct evidence

Head outputs are flattened and projected back to the model width.

modeling_deepseek.py 843–848 ↗ · moonshotai/Kimi-K2.5 @ 4d01dfe0332d

Excerpt
        attn_output = attn_output.transpose(1, 2).contiguous()

        attn_output = attn_output.reshape(bsz, q_len,
                                          self.num_heads * self.v_head_dim)

        attn_output = self.o_proj(attn_output)