F1
Transformer Architecture
Tokenization, attention, positional encodings, normalization, mixture-of-experts, and the arithmetic of parameters, FLOPs and memory.
Guides
Tokenization and embeddings
How text becomes integer IDs and vectors: BPE from scratch, byte-level fallback, vocabulary-size trade-offs, tied embeddings and tokenizer pathologies.
12 min 02Self-attention from first principles
Scaled dot-product attention with shapes and code, why √d_k, masking, multi-head attention, FLOP accounting, FlashAttention's online softmax, and MQA/GQA/MLA.
16 min 03Positions, normalization and the residual stream
Sinusoidal, learned, RoPE and ALiBi positions; context extension; LayerNorm vs RMSNorm; pre-norm vs post-norm; SwiGLU; and the residual-stream view of a transformer.
15 min 04The transformer by the numbers
Parameter counts, FLOPs per token for training and inference, the 6N rule, KV-cache size, MFU and worked examples you should be able to do on a whiteboard.
12 minInterview questions
30-second answer plus a full 40-minute walkthrough for each.