The feed-forward block: one weight matrix, one token
Zoom out: all this is the attention block, half a layer; the other half is the feed-forward block
Per token, no mixing: start with the simplest version, one weight matrix, 7,168 numbers in, 7,168 out (≈ 51 M weights)
Attention mixes tokens; feed-forward thinks about each one
Darken all but the new token: the block never looks at other tokens, each column goes through the same matrices on its own (position-wise feed-forward, original paper)
Nothing to cache; a new token costs one column
Split in two: W_up and W_down
Split the matrix in two: W_up widens each token (7,168 → 18,432), W_down brings it back (18,432 → 7,168)
A bend (the activation, SiLU) goes between them: without it the two would collapse into one matrix
The wide middle is where the block has room to think; ≈ 132 M weights each
Adding the gate (SwiGLU): a dense layer
Add the gate: a second wide matrix, W_gate, on the same input, through SiLU
Multiply it with the W_up result, cell by cell: the gate decides how much of each number passes; then W_down (SwiGLU: Shazeer 2020)
Three matrices, ≈ 396 M weights; adds to the stream
Labelled a dense layer: what the full diagram calls dense (V3.2: first 3 layers are dense, the rest experts)
One expert: a narrower block
Mixture of experts: box the three matrices = an expert; make it narrower