Learn Mechanistic Interpretability

Mechanistic interpretability, often shortened to mech interp or MI, reverse-engineers how neural networks compute. Learn it through a free, structured textbook.

This is an open source textbook. If you find something incorrect, missing, or that could use improvement, send a PR.

Start with a question

Follow the full curriculum in order, or use these routes into the material.

How does a transformer compute?

Build the model from token embeddings and position through attention and MLPs.

How do we test a causal claim?

Move from observation to intervention with activation patching, then isolate paths with attribution patching.

Which research tools should I use?

Compare the hooks and caches in TransformerLens with feature workflows built around SAE Lens and Neuronpedia.

What you will learn

The curriculum connects mathematical foundations to the experiments researchers use to explain, compare, and change model behavior.

Representations and features

Understand the linear representation hypothesis, superposition, and sparse autoencoders.

Circuits and mechanisms

Trace computations from induction heads to modern attribution graphs, with explicit tests of faithfulness.

Steering and safety

Study how representations can be changed, what those interventions establish, and where mechanistic interpretability falls short for AI safety.