LLM From Scratch
A hands-on 6-week course that takes you from tokenisation to a working transformer, with interactive tools that make the maths visible.
Week 1: Tokenization
-
BPE Tokenizer Visualizer
Interactive BPE tokenizer visualizer. See Byte Pair Encoding happen step by step, watch character pairs merge, and compare sequence lengths.
-
Training Batch Shape Debugger
Interactive batch shape debugger for language model training. Compute samples per epoch, batches per epoch, tokens seen, and memory footprint.
-
LLM Parameter Counter
Interactive LLM parameter counter. Break down GPT-style model parameters layer by layer. Compare configs, toggle weight tying, estimate memory usage.
-
Loss & Perplexity Converter
Interactive loss and perplexity converter. Two-way conversion between cross-entropy loss and perplexity.
Week 2: Transformer
-
Attention Matrix Explorer
Interactive attention matrix explorer. See Q, K, V projections, scaled dot-product attention, causal masking, and softmax weights in real time.
Week 3: Training
-
Learning Rate Schedule Visualizer
Interactive learning rate schedule visualizer. Plot warmup + cosine decay, compare schedules, export Python code.
Week 4: Generation
-
Temperature & Sampling Playground
Interactive temperature & sampling playground. Visualise how temperature, top-k, and top-p reshape probability distributions in real time.
Week 6: Optimize
-
Chinchilla Scaling Calculator
Interactive Chinchilla scaling calculator. Enter model parameters to get the optimal training token count, or enter a token budget to get the optimal…