Skip to content
GKgkml.dev

LLM mechanisms 🧠

Not how to prompt a model — how one works. This track goes from a string of text to the integers a network multiplies, builds a GPT one component at a time, trains and fine-tunes it, then takes it apart again to find out which parts do what.

Every module states the essence of its subject in plain language, why it matters, the full list of topics it covers, and runnable Python for each idea. The code is the point: nearly every claim here is something you can check in a notebook in under a minute.

8 parts · 24 modules288 topics covered~7 hours of reading

Where to start

  • New to deep learning? Start at Part 8, then Part 7, then come back to Part 1. Parts 7 and 8 are last in the ordering but first in the dependency graph.
  • Comfortable with PyTorch? Start at Part 1 and read straight through. Parts 1–3 build the model and the tooling; Parts 4–6 take it apart.
  • Here for interpretability? Read Part 2's “Build a GPT” first regardless — Parts 5 and 6 refer to specific tensors inside that architecture on every page.

Part 1

Tokenization and embeddings

How text becomes numbers, and how those numbers become a geometry where meaning is a direction.

36 topics · ~34 min

Part 2

Large language models

Build a GPT from an embedding table upwards, then pretrain, fine-tune and instruction-tune it.

74 topics · ~78 min

Part 3

Evaluating LLMs

The numbers — perplexity, benchmarks, divergences — and the structured looking that finds what numbers miss.

20 topics · ~32 min

Part 4

AI safety and interpretability

Why alignment is a specification problem, and why understanding the mechanism is the only way to verify a fix.

11 topics · ~27 min

Part 5

Observational mech interp

Measuring what a model represents — embeddings, neurons, layers, trajectories and circuits — without changing anything.

70 topics · ~100 min

Part 6

Causal mech interp

Editing activations to establish what the model actually uses: ablation, patching, silencing and subspace removal.

19 topics · ~58 min

Part 7

Python foundations

The slice of Python this work uses heavily, plus Matplotlib, text handling and PyTorch tensors.

31 topics · ~35 min

Part 8

Deep learning foundations

The maths that everything above is made of, gradient descent, and a network built from scratch.

27 topics · ~52 min

The topic outline follows the syllabus of a course on LLM mechanisms; the explanations, code and commentary here are written for this site. Quizzes for this track are not built yet — for graded practice, see the question banks.