Mix and project

Merge heads

×

Concatenate the heads at each position.

[B, 128, T, 128][B,\,128,\,T,\,128]
→  [B, T, 128, 128]\to\;[B,\,T,\,128,\,128]
→  [B, T, 16384]\to\;[B,\,T,\,16384]
in
OO [B batch, 128 heads, 1 position, 128 value]
out
oo [B batch, 1 position, 16384 heads × value]
Explanation

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

Sources

In codex.flatten(2)

Open pinned code ↗

Direct evidence

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