Interpretability & Mechanistic Understanding

Chapter opener illustration: Interpretability & Mechanistic Understanding.

"The question is not whether neural networks have interpretable structure, but whether we have the patience and ingenuity to find it."

ProbeProbe, Relentlessly Curious AI Agent
Looking Back

Part II so far has been about LLMs as systems: how they are trained, what families exist, how they reason, how they are served. This chapter turns inward: what is actually happening inside the weights? You will learn how to read attention patterns, run probing classifiers, identify circuits and induction heads, and use sparse autoencoders to find interpretable features. Interpretability sits in Part II because every Part-III-onward chapter implicitly assumes the model behaves predictably, and this chapter is where you learn the tools to verify that.

Chapter Overview

Imagine deploying a medical AI that recommends a treatment, and a doctor asks, "Why this recommendation?" You open the model's attention weights and find it fixated on a patient's zip code, not their symptoms. Without interpretability tools, you would never have caught this failure. As large language models are deployed in high-stakes applications, the question "why did the model produce this output?" becomes critical. Interpretability research aims to open the black box of transformer models, revealing the internal computations that drive predictions, the features that neurons encode, and the circuits that implement specific behaviors.

This chapter covers the full spectrum of interpretability methods for LLMs. It begins with attention analysis and probing classifiers, which offer accessible entry points for understanding model internals. It then advances to mechanistic interpretability, the ambitious program of reverse-engineering neural networks at the level of individual features and circuits. The chapter also covers practical interpretability tools for debugging, model editing, and representation engineering, as well as formal attribution methods for explaining transformer predictions.

By the end of this chapter, you will be able to analyze attention patterns to understand model behavior, use probing classifiers to test what information is encoded in hidden states, apply sparse autoencoders to extract interpretable features, and employ attribution methods to explain individual predictions.

Big Picture

As LLMs become more capable, understanding what they have learned and why they produce specific outputs becomes critical. Interpretability tools like probing, attention analysis, and mechanistic interpretability complement the alignment and safety techniques in Chapter 18 (Alignment, RLHF & DPO) and Chapter 48 (Guardrails & Runtime Safety), helping you build systems you can trust and debug.

Note: Learning Objectives

Prerequisites

Sections

What's Next?

Next: Chapter 11: Working with LLM APIs, and with it, Part III. Parts I and II built up the model: from gradient to tensor to transformer to scaling law to interpretable circuit. From here we stop opening the engine and start driving. Part III shows you how to actually call these models in production code (OpenAI, Anthropic, Google, open routers), how to prompt them to behave, and when an LLM is the wrong tool for the job. The shift is from mechanics to behavior, from understanding to using.