A transformer block is a wiring pattern. This lesson shows the components, the order in which data moves through them, and which nodes are exact versus named.

highlighted = computed this step

Stacking the pieces

A transformer block wires attention and an MLP together with residual connections and normalization. The flowchart shows which component feeds which, and each node is flagged exact or named so the reader can see where arithmetic stays pinned and where a boundary is only named.

inputattentionMLPoutput\text{input}\rightarrow\text{attention}\rightarrow\text{MLP}\rightarrow\text{output}
Transformer block wiringExact wiring with named boundary flags.Transformer block wiringExact wiring with named boundary flags.transformer block wiringwiring is exact; named components carry no numeric outputinput hexactdisplayed vector+ positional encodingnamed (sin/cos)attentionnamed (softmax)residual addexactvector additionlayernormnamed (√)MLP-ReLUexactrational ReLU wiringresidual addexactvector additionlayernormnamed (√)outputexact

The block order

The validated order is input, positional encoding, attention, residual add, layernorm, MLP-ReLU, residual add, layernorm, output. This lesson is about the wiring spine: the path through the block before any large-scale model claim enters.

wiring order is validated\text{wiring order is validated}
Transformer block wiringExact wiring with named boundary flags.Transformer block wiringExact wiring with named boundary flags.transformer block wiringwiring is exact; named components carry no numeric outputinput hexactdisplayed vector+ positional encodingnamed (sin/cos)attentionnamed (softmax)residual addexactvector additionlayernormnamed (√)MLP-ReLUexactrational ReLU wiringresidual addexactvector additionlayernormnamed (√)outputexact

Summary

This lesson is about wiring, not hidden arithmetic. Exact nodes and named-boundary nodes are flagged before any lesson uses the residual example, so the structure itself is the first visible source.

flowchart nodes carry exact or named flags\text{flowchart nodes carry exact or named flags}
Transformer block wiringExact wiring with named boundary flags.Transformer block wiringExact wiring with named boundary flags.transformer block wiringwiring is exact; named components carry no numeric outputinput hexactdisplayed vector+ positional encodingnamed (sin/cos)attentionnamed (softmax)residual addexactvector additionlayernormnamed (√)MLP-ReLUexactrational ReLU wiringresidual addexactvector additionlayernormnamed (√)outputexact