Don't be scared by Transformer or 'Attention Is All You Need' — start with the smallest piece: attention. Explained with the hash table you already know, plus 20 lines of numpy so you can compute it yourself.
Understanding Attention and Transformers from Scratch
Last post: attention is one 'soft lookup'. So why multi-head at all? And why is it order-blind, needing positional encoding to rescue it? Two things, explained with minimal code.
Understanding Attention and Transformers from Scratch
Attention mixes information between tokens; the FFN transforms each token independently. This article explains where the FFN sits in a Transformer block, position-wise computation, the 4x expansion, GELU/SwiGLU, parameter counts, and why the FFN often holds most of a layer's parameters.
Understanding Attention and Transformers from Scratch
BERT is neither encoder-decoder nor decoder-only. It stacks Transformer encoders with bidirectional self-attention. This article compares BERT, GPT and T5, and explains why BERT cannot generate freely like GPT.
Understanding Attention and Transformers from Scratch