Transformer
Transformer in the context of production machine-learning systems.
Lessons
Formal explanations, examples, simulations, and checkpoints.
Text to tensors: tokenization, embeddings, position
Tokenizer and position scheme are not preprocessing trivia; together they define what symbols and order the transformer can represent.
Build a transformer from scratchScaled dot-product self-attention by hand
Attention is a masked, normalized lookup: queries score keys, softmax allocates influence, and values carry the information.
Build a transformer from scratchHeads, norms, residuals, and MLPs
Attention mixes tokens, the MLP mixes channels, and normalized residual paths let both transformations accumulate without losing the original stream.
Build a transformer from scratchTrain a causal language model
Causal LM training is next-token alignment plus a no-looking-ahead proof; everything else scales that contract.
Build a transformer from scratchSampling, KV cache, and efficient generation
Efficient generation couples a declared sampling policy with a position-correct KV cache whose logits match the uncached model.
Courses & assignments
Dependency-authoritative learning units.
Casebook
Reported facts and course reconstructions.