Browse tutorials
Tutorials
How Language Models Generate Text: Temperature, Top-k, and Top-p
Inspect a language model’s next-token distribution, then measure how temperature, top-k, top-p, and min-p change uncertainty and sampled support-ticket continuations.
Next-Token Prediction: The Learning Objective Behind Language Models
Train a tiny causal language model from scratch, inspect shifted labels, compare perplexity with a uniform baseline, and see overfitting appear on a small…
Embeddings: Turning Meaning Into Geometry
Build a small co-occurrence embedding with PPMI and SVD, inspect its geometry, and learn what embedding vectors capture, lose, and require before semantic search…
Tokenization: How Language Becomes Model Input
Build character, word, and byte-pair tokenizers on a support-ticket corpus, then inspect the trade-offs between vocabulary size, context length, Unicode, and unknown text.
Transformers: How Self-Attention Turns Tokens Into Context
Derive scaled dot-product self-attention, inspect real attention weights, and build a small NumPy transformer block that routes support tickets while making its limits visible.
Cosine Similarity: The Math Behind Semantic Search
Semantic search and RAG rank results by cosine similarity — but what does that actually measure? Build it from the dot product, see the…
Verify Stripe Webhook Signatures (and Make Handlers Idempotent)
Your Stripe webhook is a public endpoint that grants access and moves money. Here’s exactly what Stripe signs, how to verify it in Node…
Write an AGENTS.md That Actually Steers Claude Code and Codex
Your coding agent ignores your conventions because nothing tells it how the repo works. Here’s what AGENTS.md is, the five sections that change behavior,…

Attention Mechanisms: Let Models Focus Where It Matters
Toy Question–Answer Dataset → Customer Support Chatbots Why Attention Mechanisms? In long sequences, a model easily “forgets” early tokens or crams everything into a…

Seq2Seq Models: From Sentences to Sentences
Machine Translation Toy Dataset → Google Translate Why Seq2Seq Models? Machine translation is the canonical “sequence-in, sequence-out” problem: given a source sentence (e.g., English),…