Articles
Interactive lessons with live demos that run in the page.
14 lessons · every demo runs locally
Why Softmax Needs Temperature
A network's raw scores are not probabilities. Temperature is the dial that decides how much the differences between them matter.
1 interactive demoEigenvectors You Can See
Most arrows change direction when a matrix acts on them. A few stay on their own line — and those are the ones worth finding.
1 interactive demoGradient Descent from MSE to Logistic
One update rule, two losses. Watch the same recipe fit a line by squared error and by cross-entropy.
1 interactive demoK-Means: Assignment to Convergence
Two alternating steps, one stubborn goal. Step through the loop and watch the total spread only ever fall.
1 interactive demoAttention Is a Heatmap
Strip away the code and attention is a table of dot products, a softmax on every row, and a weighted average of values.
1 interactive demoTokenization: Byte-Pair Encoding
Before a model reads a word, it reads a merge list. BPE decides how text becomes tokens — and tokens decide cost, context, and where a model fails.
1 interactive demoEmbeddings & Cosine Similarity
A good embedding puts dog near puppy and far from semiconductor. Cosine similarity is how that claim gets measured.
1 interactive demoQuantization: INT8 to FP8
Fewer bits per weight means less memory and faster decoding. The price is a rounding error you can steer.
1 interactive demoKV Cache & FlashAttention
Attention costs time that grows with the square of the sequence and memory that never shrinks. The KV cache is why long context costs what it costs — and FlashAttention is why it fits.
1 interactive demoRAG: From Chunks to Citations
Retrieval-augmented generation is a pipeline, not a prompt. Most failures happen before the model reads a single token.
1 interactive demoPost-Training: RLHF → DPO → GRPO
Pretraining teaches the model language. Post-training teaches it behavior — and by 2026 the human preference label gave way to the reward a program can check.
1 interactive demoPCA & SVD in Practice
The eigenvector article ends at Av = λv. This one starts there: project the cloud, keep the top axes, rebuild — and account for every bit of what you threw away.
1 interactive demoCalibration & Uncertainty
A model that says 90% should be right 90% of the time. Modern networks are not — and one number fitted on held-out data fixes most of the gap.
1 interactive demoLoRA / PEFT: Low-Rank Fine-Tuning
Freeze the model, train a small rank-16 shadow. In 2026 that shadow is most fine-tuning — and at serving time it disappears into the weights.
1 interactive demo