Short, self-contained essays on the techniques that make modern language models practical — each one intuition-first, with just a pinch of maths and a “what to carry forward” at the end. Read them in any order.
Gradient Checkpointing — Trading Recomputation for Room
The memory accounting in the article on AdamW left something out. Weights, gradients, and optimizer state came to roughly sixteen bytes per parameter, which is a large number and a fixed one — it does not change with how much text you push through the model. Activations are the other half of the story, and they behave completely differently: they scale with the batch size and the sequence length, and for a large model on a long context they can dwarf everything else. The remedy is one of the more satisfying trades in the whole subject, because it exchanges a resource that is hard and expensive to obtain for one that is merely tedious. This piece is about why the backward pass needs so much stored material, and how throwing most of it away and computing it a second time turns out to be cheaper than keeping it. ...