-
Speculative Decoding: Faster Language Model Inference Without Changing the Output
A first-principles explanation of speculative decoding, with a proof that it samples from exactly the same distribution as the large model, a derivation of the expected speedup, and a NumPy implementation that tests both claims.
-
Vision-Language Models from Scratch: Teaching a Language Model to See
Build a small vision-language model in PyTorch, with a patch-based image encoder, a projector, and a language model, train it to caption and answer questions about images, and test what happens when you throw away visual tokens.
-
How Large Language Models Work: Tokens, Prediction, and Post-Training
A clear, technically careful tour of how a large language model turns text into probabilities and back into text, from tokenization and the training objective to sampling, post-training, and why generation is expensive, with small tested code examples.
-
A Transformer from Scratch: Attention, Residual Blocks, and Next-Token Prediction
Build a small GPT-style transformer in PyTorch, with attention, layer normalization, and residual connections written out explicitly, then verify it with causality and reference checks, train it on character-level text, and sample from it.
-
Generative Adversarial Networks from Scratch: A Two-Player Game for Learning Distributions
Build a GAN in PyTorch, derive what the adversarial game optimizes, watch it learn a toy distribution and handwritten digits, and look honestly at where it fails.