Marginal

Mechanistic Interpretability

Understanding what neural networks compute: features and the linear representation hypothesis, superposition, probes and steering, the residual stream and logit lens, activation patching, circuits and induction heads, sparse autoencoders, attribution graphs, automated interpretability and its uses for safety.

21 lessons in 1 unit · free with an account

Start your free trialThis course stays free after the trial.
What you'll learn

21 lessons, one small step at a time

Each lesson states its goal, then works up to it in short steps with practice after each. A placement test at the start skips what you already know.

Mechanistic Interpretability

21 lessons
  1. Features as directionsRead how strongly a feature is present by projecting an activation onto its direction, and weigh the evidence for and against representing concepts as directions.
  2. Features in vision modelsMatch the evidence that a vision channel detects curves to its kind, and explain universality and polysemanticity.
  3. Steering vectorsSteer an activation by adding a feature direction, ablate a feature by projecting it out, and explain how steering is used.
  4. SuperpositionExplain how a model represents more features than dimensions, compute how nearly orthogonal random directions are, and weigh interference against sparsity.
  5. Toy models of superpositionCount how many nearly orthogonal directions a space holds, predict when the toy model superposes features, and describe the geometry they form.
  6. Linear probesCompute a linear probe's output on an activation, tell a decodable property from a used one, and judge probes as monitors.
  7. Probing world modelsFind a feature direction by contrastive activation addition, and explain what Othello-GPT's internal board and the refusal direction show.
  8. The residual streamExplain how every block of a transformer adds to a shared residual stream, and split a logit difference among the components.
  9. Direct logit attributionCompute a component's direct logit attribution, including the final layer norm, read a middle layer with the logit lens, and state the limits of both.
  10. Gradient attributionCompute input-times-gradient and integrated-gradients attributions, and explain the pitfalls of both.
  11. Activation patchingRun an activation-patching experiment, score how much of a behavior a patch restores, and explain how path patching leads to circuits.
  12. Circuits & induction headsPredict what an induction head outputs, explain how its two heads compose, and test a proposed circuit by its faithfulness.
  13. Finding circuitsDescribe a hand-found circuit, compare automated search with causal scrubbing, and explain the hard limit on circuit search.
  14. SAE encodersExplain why a sparse autoencoder is overcomplete and sparse, compute its latents from an activation, and say what makes a latent interpretable.
  15. Sparse autoencodersReconstruct an activation from SAE latents, compute the training objective, and name the open problems that limit SAEs.
  16. Better dictionariesTrace sparse dictionaries to compressed sensing, explain shrinkage and absorption, and evaluate SAE variants by the loss they recover.
  17. Attribution graphsCompute the edges and paths of an attribution graph, and explain what such graphs revealed about how a model reasons.
  18. Automated interpretabilityScore a feature explanation by correlating simulated with true activations, and name the limits of automated interpretability.
  19. Explaining activations in wordsExplain how activation oracles and natural language autoencoders describe activations in words, and what they have found.
  20. Interpretability for safetyMatch safety uses of interpretability to examples, state the limits of current methods, and explain what auditing exercises show.
  21. The debate over interpretabilityOrder the stages of the interpretability pipeline, match claims to four prominent critiques, and say what kind of result would answer them.
Sample lesson

Features as directions

Goal: Read how strongly a feature is present by projecting an activation onto its direction, and weigh the evidence for and against representing concepts as directions.

Mechanistic interpretability tries to reverse-engineer what a network computes from its weights and activations. Its basic working assumption is that concepts are represented as directions in activation space.

We will state the linear representation hypothesis, read a feature, and finish with evidence and exceptions.

Step 1: The linear representation hypothesis

An activation is the vector of numbers a layer produces for an input. The linear representation hypothesis says that a concept the model uses, such as "this text is in French" or "the subject is plural", corresponds to a direction u in that vector space, called a feature. Different inputs have the concept more or less strongly, and the strength shows up as how far the activation points along u.

The first evidence came from word embeddings: the offset from "man" to "woman" is close to the offset from "king" to "queen", so gender behaves like a direction that can be added or removed.

Step 2: Reading a feature

If u is a unit vector, the feature's strength in activation a is the projection

a · u = a₁u₁ + a₂u₂ + …

For a = (2, 1, 4) and u = (0, 0.6, 0.8), the strength is 0 + 0.6 + 3.2 = 3.8. On a plot of activations, the feature is strongest for the point that reaches furthest along the dashed line of u, which need not be the point furthest from the origin.

Step 3: Evidence and exceptions

Correlation is not enough: if a model really uses a direction, then intervening on it, adding or removing it, should change behavior predictably, and for many features it does. Directions also explain why single neurons are hard to interpret: feature directions need not line up with the neuron basis, so one neuron usually mixes several features. The hypothesis has exceptions: some language models represent the days of the week on a circle, a feature that needs two dimensions so that Sunday can sit next to Monday.

In the app, each step ends with practice questions, new ones every time, and the lesson comes back later in spaced reviews.

Start Mechanistic Interpretability

Lessons that need something you haven't learned yet bring it in first, from any course.

Start your free trialThis course stays free after the trial.