Zain Dana Harpernight school

Night School. How AI works, taught on a coast at night.

Each lesson is a place on one stretch of coast, with a guide who works there. You watch a short film, then you open the same place in your browser and run the real thing: a tiny model trains in front of you, and every number you see is computed as you watch.

Start here

New to the maths? Begin with Pylon on the hill above the harbour: Vectors: a list of numbers is a place, then Matrices move space, Gradients, Backpropagation, Optimisers and The held-out set. All six come back to the attention lesson's small language model, so its numbers carry over.

Then down to the dock, where language models start: Tokens: cutting text into crates with Pylon, and Embeddings: every token gets coordinates with Tallow in the lamp room. Then Tallow's wheel: Next-word prediction and the loss, and Decoding: temperature, top-k, top-p. Then the whole machine: The transformer block in Tallow's tower, and The training loop on Pylon's dock, then what feeds it and how far it goes: Data and Scaling. Then down to the small boatyard, where big models are made small: Distillation: a big teacher, a small student, and LoRA and fine-tuning. Then to the prism at the tide line, where Rerun checks the numbers: Error bars: how sure is the number, and When the check can be fooled. Then Evaluating a language model puts both to work, and Pylon opens the cannery, where graphics chips do the sums: Threads, workgroups and memory. Then make a model smaller and faster: Quantisation with Tallow, and Matmul tiling in the cannery. Then attention without its table of scores, Fused attention, and the model in 16-bit numbers, Mixed precision with Tallow. Then two case studies with Rerun on the beach: a real check that failed, The denoiser's tensor-core parity, and A score that carries its receipt. And the algorithms under all of it: Search and sorting, and Dynamic programming. Last, back at the boatyard, the whole method on a real contest, misses and all: Our MMBU Challenge entry.

Attention: how a language model decides what matters. Tallow keeps the lamp at the top of the lighthouse. A word shines its question back along the sentence, and the earlier words that answer it best get the light. In the lab you train a 2-layer model with 20,864 numbers on sentences from the coast and watch its heads learn where to look.

The lessons

30 lessons in six tracks, from vectors to fused attention kernels. "After" names the lessons that help first; nothing is locked. 30 lessons are live, every one of them. To see them all at once, as lights along the guides' shore, open the Lantern Coast.

Foundations

The hill above the harbour, with Pylon

  1. F1 Vectors: a list of numbers is a place ready
  2. F2 Matrices move space after F1 ready
  3. F3 Gradients: which way is downhill after F1 ready
  4. F4 Backpropagation: blame, passed backwards after F2, F3 ready
  5. F5 Optimisers: momentum, Adam and the step size after F3 ready
  6. F6 Overfitting and the held-out set after F4 ready

How language models work and are built

The lighthouse and the dock, with Tallow

  1. L7 Tokens: cutting text into crates after F1 ready
  2. L8 Embeddings: every token gets coordinates after F1, L7 ready
  3. L9 Next-word prediction and the loss after F3, L8 film and lab live; narration not recorded yet
  4. L10 Attention: how a language model decides what matters after F1, L8, L9 ready
  5. L11 The transformer block after L10, F4 film and lab live; narration not recorded yet
  6. L12 The training loop after L11, F5 film and lab live; narration not recorded yet
  7. L13 Data: what goes in comes out after L12 film and lab live; narration not recorded yet
  8. L14 Scaling: bigger, longer, how much after L12, L13 film and lab live; narration not recorded yet
  9. L15 Decoding: temperature, top-k, top-p after L9 film and lab live; narration not recorded yet
  10. L16 Evaluating a language model after L15, E23 film and lab live; narration not recorded yet

Small models

The small boatyard, with Tallow

  1. S17 Distillation: a big teacher, a small student after L12 film and lab live; narration not recorded yet
  2. S18 Quantisation: fewer bits per number after F1, K21 film and lab live; narration not recorded yet
  3. S19 LoRA and fine-tuning after L12, F2 film and lab live; narration not recorded yet
  4. S20 Case study: our MMBU Challenge entry after S19, L16, E24 film and lab live; narration not recorded yet

GPU kernels

The cannery, with Rerun

  1. K21 Threads, workgroups and memory after F2 film and lab live; narration not recorded yet
  2. K22 Matmul tiling after K21 film and lab live; narration not recorded yet
  3. K23 Fused attention after K22, L10 film and lab live; narration not recorded yet
  4. K24 Mixed precision: fp16, bf16 and tensor cores after K22, S18 film and lab live; narration not recorded yet
  5. K25 Case study: the denoiser's tensor-core parity after K24 film and lab live; narration not recorded yet

Algorithms

The tide tables, with Rerun

  1. A26 Search and sorting: the cost of looking film and lab live; narration not recorded yet
  2. A27 Dynamic programming: remember what you already worked out after A26 film and lab live; narration not recorded yet

Evaluation and honesty

The prism at the tide line, with Rerun

  1. E23 Error bars: how sure is the number after F6 film and lab live; narration not recorded yet
  2. E24 When the check can be fooled after E23 film and lab live; narration not recorded yet
  3. E25 Case study: Flywheel and re-derivable evaluation after E24, L16 film and lab live; narration not recorded yet

How it works

The films are drawn by the raw-native engine, live in your browser or rendered to video, from the same scene files. The labs train real models in plain JavaScript on your own computer; nothing is sent anywhere. Every claim in a film has its source listed beside the lesson, and every number about a model comes from the trained model's own file.

There are no points, streaks or badges here, and nothing plays the next lesson on its own. Come when you want, learn a thing, and go.