Lessons
About this phase
The transformer is the architecture behind every frontier language model, most vision and speech systems, and the agents you will build at the end of this path. This phase takes it apart completely. You derive scaled dot-product attention and compute it by hand, see why positions must be injected and how rotary embeddings do it, count the parameters of a block, and learn the three architectural families (encoder-only, decoder-only, encoder–decoder) and when each wins. Then you build a GPT from scratch, learn the scaling laws that decide how big a model should be, and understand what makes inference fast: KV caches, grouped-query attention, FlashAttention, speculative decoding and quantization. The phase closes with mixture-of-experts and the sub-quadratic alternatives (state space models, hybrids) that are reshaping the field in 2026.
By the end you can
- Derive scaled dot-product and multi-head attention, including the √d_k scaling, and compute attention by hand for a small example
- Explain sinusoidal, learned, rotary (RoPE) and ALiBi positional schemes and why they enable or limit length extrapolation
- Count the parameters, FLOPs and KV-cache memory of any transformer configuration and apply Chinchilla-style compute-optimal reasoning
- Choose between encoder-only, decoder-only and encoder–decoder designs for a task and justify the choice
- Implement and train a small GPT, then read production code (nanoGPT, Llama) with full understanding
- Describe the mechanics and trade-offs of MoE, FlashAttention, speculative decoding, quantization, and state-space/hybrid models