Chapter 03 · overview · 1 min read
The Transformer Block
Attention on its own is only half of a transformer layer. This section assembles the rest: the residual connections and normalization that make deep stacks of these layers trainable at all, the feed-forward sublayer that sits alongside attention, and how all of it fits together into the one repeatable block that gets stacked a dozen, or a hundred, times.
Topics in this section:
- Residual Connections in Transformers: why every sublayer adds to its input instead of replacing it.
- Layer Normalization Placement: Pre-Norm vs Post-Norm: where normalization sits relative to a sublayer, and why it matters.
- RMSNorm vs LayerNorm: the normalization function itself, not just where it's placed.
- The Feed-Forward Sublayer: the per-position network sitting alongside attention in every block.
- Modern Feed-Forward Variants: SwiGLU and GeGLU: the gated activations that replaced the original ReLU feed-forward layer.
- Assembling One Transformer Block: putting every piece together and tracing one input all the way through.