Connect torch.compile, FlashAttention and vocabulary padding to one training update. Derive AdamW's bias correction, then follow four microbatches through gradient accumulation, global clipping, warmup and cosine decay, with bilingual diagrams and interactive walkthroughs.
A gradient from 32 samples is wrong, yet 820× faster than the full batch and lands a lower loss. The learning rate comes from a sweep: even spacing in the exponent is even ratios in the rate — and why that U-curve can only rule out, never select.
Connecting the parts from the last two: a loss function gathers the outputs into one number, and a three-part loop actually drives it down. Plus what happens when you deliberately skip zeroing the gradients — across ten random seeds.
A 2→2→1 network, and where every single number in three rounds of training comes from. Plus two things you only see once you actually run it.