Transformer Feed-Forward Block: Per-Token Expand & Project
Every transformer block hides a second sublayer besides attention: a position-wise feed-forward network that expands each token's vector, applies a nonlinearity, and projects it back down — independently, with no mixing across tokens. Watch it run in 3D with live parameter counts and sparsity readouts.
Attention gets most of the attention, but roughly two-thirds of a transformer's parameters live in its other sublayer: the position-wise feed-forward network. This simulator renders every token's vector as a column of bars and runs it through the real two-layer MLP — expand to dff, apply GELU or ReLU, project back to dmodel, add the residual — independently for each position, with live parameter counts and per-token sparsity readouts so you can see exactly why this sublayer, not attention, holds most of the weights in models like GPT and BERT.
Every transformer block hides a second sublayer besides attention: a position-wise feed-forward network that expands each token's vector, applies GELU or ReLU, and projects it back down — independently, with no mixing across tokens. Watch it run in 3D with live parameter counts and activation-sparsity readouts.
3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install