Interpretability
Interpretability, the discipline of opening up trained LLMs and reading what's inside. From the foundational technique (linear probes, train a tiny classifier on hidden states), through the polysemanticity problem (one neuron, many concepts) and the superposition explanation, to sparse autoencoders as a path through superposition (Anthropic's Towards Monosemanticity and Scaling Monosemanticity), mechanistic interpretability and circuits (induction heads, IOI circuit), causal interventions (logit lens, activation patching, ROME), and the current state of a rapidly-evolving research field. The middle chapter of Part VIII, where safety asks "what we want," interpretability asks "what's actually there," and Ch 26 will ask "how do we measure both."
Chapter 24 covered safety from the outside in: alignment training, refusal calibration, red-teaming, the helpful-versus-harmless trade-off. All of those techniques operate on model behavior. Behavior is one signal; the model’s internals are another. Interpretability is the discipline of reading those internals. Probes that decode concepts from hidden states. Sparse autoencoders that pull apart superposition into monosemantic features. Circuits, small weight subgraphs that implement specific algorithms. Causal interventions that test whether a component actually matters. The goal is two-fold: understand what the model is computing, and verify that it is computing what we want.
This is not a settled science. Interpretability research is empirical and progressing fast. Probes have existed since ; the modern sparse-autoencoder breakthrough (Bricken et al., Anthropic) is from ; circuit discovery is largely an artisanal craft on small models. What works today: linear probes for many concepts at – accuracy on hidden states of frontier models, sparse autoencoders scaled to Claude Sonnet with millions of extracted features (Templeton ), dozens of identified circuits in transformers, including induction heads and the indirect-object-identification circuit. What is open: coverage, do our methods find all the features? Scale, most mechanistic-interpretability work is on small models. Automation, interpreting features still requires humans.
Interpretability matters for safety because sleeper agents (Hubinger , referenced in Chapter 24) demonstrated that behavioral safety training can leave invisible backdoors, and interpretability is the only known route to catch these. For engineers, interpretability tools are increasingly used in production, Anthropic’s monitoring work, OpenAI’s interpretability team, deployed feature-clamping pilots. By the end of this chapter you should have both the conceptual toolkit and the operational realism. Chapter 26 then covers how to measure all of this quantitatively, and Part IX will assemble the full stack, capability and discipline together, into complete agent architectures.
The interpretability question
Two senses of black-box
A trained LLM is opaque in two senses. Internal opacity: we cannot easily tell what computations are happening at each layer. External opacity: we cannot always predict what the model will do on new inputs. Chapter 24 addressed external opacity through alignment training and red-teaming. This chapter addresses internal opacity through interpretability research.
The two are not interchangeable. A well-aligned model behaves correctly on the inputs we test, but behavior alone does not tell us how it produces those outputs, or whether the same internal computation will hold under distribution shift. Interpretability is the second channel, read the model’s internals directly rather than infer them from outputs.
Two complementary goals
Interpretability research has two goals that are sometimes confused but should be kept distinct.
Understanding is the explanatory goal, describe what the model is computing in human-interpretable terms. Verification is the operational goal, confirm or refute alignment claims by reading internal state. The two share methods but have different success criteria; a technique that yields rich understanding may still be too costly or partial to verify production claims, and vice versa.
Three forces make this matter now. Sleeper agents (Hubinger , Chapter 24) demonstrated that behavioral safety training can leave invisible backdoors that survive standard alignment. Frontier capability: models that can reason, plan, and act are increasingly hard to evaluate by behavior alone; reading internals provides a second channel. Trust at scale: production deployments need confidence that does not depend on perfect red-teaming.
The empirical scale of the field in early is worth keeping in mind. Probe accuracy for common concepts: – on hidden states of frontier models. SAE feature count (Templeton ): millions extracted from Claude Sonnet. Known circuits: dozens, induction heads, the indirect-object-identification (IOI) circuit, copy-suppression heads, and others. Active research labs: Anthropic, OpenAI, DeepMind, Apollo Research, EleutherAI, plus independent research organizations including Conjecture and Redwood Research.
Probes: reading concepts from hidden states
The probing recipe
The foundational interpretability technique (Alain & Bengio ) has four steps. Run inputs through a frozen LLM. Extract hidden states at a chosen layer, typically the residual-stream activations after some block. Train a small classifier, usually linear, on those hidden states to predict a concept of interest. Report the classifier’s accuracy as your probe accuracy for that concept at that layer.
What you can probe for spans three categories. Syntactic concepts, part-of-speech, dependency relations, sentence boundaries. Semantic concepts, sentiment, entity type, factual properties. Abstract concepts, deception, hedging, intent, refusal. The same recipe works across all three; the differences live in what data you label and which layer you read.
Why linear probes specifically. Simple, fewer parameters than the underlying model, which reduces the risk that the probe “learns the concept” from scratch instead of reading it out. Fast, trains in seconds on a few thousand examples. Interpretable, a linear weight vector is itself a direction in representation space, and you can analyze it directly.
What probes tell you (and don’t)
What probes tell you is narrow but important. Is concept linearly decodable from layer ?, yes or no, with probe accuracy as the signal. At which layer does concept emerge?, train probes at every layer and find where accuracy spikes. How does concept evolve across layers?, compare probe accuracies layer by layer.
What probes don’t tell you matters as much. Causation, a probe says the concept is present, not that the model uses it. The model might decode a concept and ignore it downstream. Mechanism, a probe does not tell you how the concept is computed, only that it is there. Robustness, probes work in-distribution; out-of-distribution accuracy can collapse without warning.
Layer-wise feature emergence
A robust empirical finding: concepts come online at different depths. Early layers: surface features (token identity, position). Middle layers: syntactic and semantic features. Late layers, task-specific and output-aligned features. The layer-wise feature emergence pattern is one of probing’s most reproducible results across architectures and training regimes.
The polysemanticity problem
One neuron, many concepts
What you find when you look at neurons: a single neuron in a trained LLM activates on many unrelated concepts. Neuron might fire on Python for loops, French sentences about cooking, and digit-grouped numbers. Neuron might fire on negation, present tense, and the word “however.” This is polysemanticity, one neuron, multiple concepts.
Polysemanticity is the rule, not the exception. Early efforts to inspect individual neurons produced confusing results precisely because the substrate is polysemantic. Neuron-level interpretability is not a path forward by itself; the concepts you want to find are not stored one-per-neuron.
Superposition
Why does this happen? Superposition (Elhage ) is the explanation. Models need to represent many more features than they have neurons. The solution that gradient descent finds is to store features as approximately-orthogonal directions in the residual stream, not as individual neurons. When the model needs feature , the relevant direction lights up, which can manifest as activation on several different neurons.
Three consequences follow. Neuron-level interpretability is misleading, a single neuron is not a “feature.” Concepts are encoded in directions: not units, a feature is a learned vector in activation space. Decoding requires finding the right directions: not just inspecting raw activations. Probes work because they find the right direction, a linear combination of neurons that aligns with a concept. But you cannot just inspect a model’s neurons and know what it is doing. You need a method to extract the meaningful directions from activations.
Sparse autoencoders
The recipe
Sparse autoencoders, or SAEs (Bricken , Templeton ), are the path through superposition. The recipe is five steps. Take model activations from a chosen layer, typically the residual stream after some block. Train an autoencoder with a much wider hidden layer: often to the residual dimension, and a sparsity penalty. Encoder: , with and . Decoder: . Loss: , reconstruction plus an sparsity penalty on the hidden code.
What you get is “features” , each a sparse signal across the dataset. For each feature you can identify the inputs that activate it, the top- examples in the dataset that drive that feature high. Most features turn out to be monosemantic, they activate on a single interpretable concept, in a way that single neurons do not.
Why this works. The wider layer gives the autoencoder room to un-pack superposed features. The sparsity penalty forces each input to be reconstructed by few features, which pushes the SAE toward a basis where each direction has a single semantic meaning. Together, the SAE approximates the implicit feature decomposition the model was using internally.
What features look like
Sanitized examples from Templeton on Claude Sonnet give a sense of what the feature dictionary contains. A feature that activates on Golden Gate Bridge mentions. A feature that activates on code vulnerabilities. A feature that activates on scientific reasoning steps. A feature that activates on deception or secrecy. A feature that activates on specific languages, Spanish, Mandarin. A feature that activates on hedging and epistemic uncertainty. The range is wide enough that “feature dictionary” is the right mental model.
Why this matters for safety
Three properties make SAEs the interpretability community’s current flagship for safety. Surfaces concepts the model uses internally: including potentially-dangerous ones (manipulation, dishonesty), which a behavioral test would miss if you do not think to probe for them. Enables targeted intervention: clamp a feature’s activation high or low, and observe how behavior changes. Validates alignment claims: confirm that “deception” features do not activate during honest behavior, or that “refusal” features fire on requests the model declines.
Mechanistic interpretability: circuits
The mech-interp ambition
Mechanistic interpretability, mech-interp in the field’s shorthand, has a bigger ambition than probes or SAEs. Not just identify what concepts the model uses, but identify how the model computes them, tracing specific algorithmic computations through specific weight subgraphs. A circuit is a small subgraph of weights, a few attention heads plus MLPs, that implements a specific, interpretable algorithm, verifiable by activation patching or direct inspection.
Canonical examples
Three circuits are worth knowing by name. Curve detectors in InceptionV1 (Cammarata ), convolutional neurons that detect curves at various orientations, built from simpler edge detectors in lower layers, verified by examining activations and weight patterns. The reference example from the original Distill circuits thread, and the proof-of-concept that mechanistic interpretability is a tractable empirical project.
Induction heads in transformers (Elhage , Olsson ), a pair of attention heads that implement: find the previous occurrence of the current token; copy what came after it. Pattern: A B ... A → B. Load-bearing for in-context learning, ablating induction heads drops in-context learning capability substantially, which is a strong causal claim about a non-obvious component of model behavior.
The Indirect Object Identification (IOI) circuit, a specific GPT--small circuit for sentences like “When John and Mary went to the store, John gave a drink to Mary.” The circuit identifies “Mary” as the indirect object. It decomposes into roughly attention heads with named roles, S-inhibition heads, name-mover heads, and others. The first circuit in a real LLM mapped at component-level detail, and the canonical case study for what mech-interp produces when it succeeds.
Why it’s hard at scale
The methodology is straightforward to describe. Identify a behavior, e.g., “the model copies text from earlier in context.” Hypothesize a circuit that might implement it. Verify by activation patching, remove or alter the hypothesized components and see whether the behavior breaks. Refine and characterize the components’ individual roles.
Three obstacles make this hard at scale. Most behaviors are not localized: they span many layers and heads, and the “circuit” you would draw is more like a wide subnetwork than a small subgraph. Components are polysemantic: they participate in many circuits, which means analyzing one circuit in isolation is misleading about what the component does in general. Verification is labor-intensive, confirming a circuit can take weeks of activation patching and ablation studies even on a small model.
Causal interventions
From correlation to causation
Probes correlate; interventions cause. The discipline pivots from “concept is present in the activations” to “concept causes behavior ” via direct manipulation of the model. A probe shows that information is decodable from a layer. An intervention shows that the layer’s encoding of that information affects downstream behavior. Both are necessary; neither alone suffices, and the most common methodological error in published interpretability work is treating a high probe accuracy as sufficient evidence for a causal claim.
The intervention toolkit
Four techniques carry most of the causal-intervention work in modern interpretability: activation patching, ROME, steering vectors, and feature clamping. Two more, logit lens and tuned lens, are commonly grouped alongside them but are observational read-outs, not interventions, they project activations through the unembedding rather than manipulating the model, so they belong in the same correlational category as probes.
Logit lens (nostalgebraist ), project intermediate residual stream activations through the unembedding matrix; see what the model “would predict” at each layer. Surfaces the layer-by-layer evolution of predictions. An observational read-out, not an intervention, and a useful baseline before reaching for the four techniques below.
Tuned lens (Belrose ), a refined logit lens with learned layer-specific projections. More accurate than the unmodified logit lens; the same observational frame, still not causal.
Activation patching: run two prompts, a clean one that produces the correct answer and a corrupted one that produces the wrong answer. Copy activations from clean to corrupted at specific points. If the corrupted prompt now produces the correct answer, those activations carry the relevant information. Identifies which components store specific information and is the workhorse of mech-interp.
ROME (Meng ), identify MLP layers that store factual associations; surgically edit MLP weights to change a fact (e.g., “Paris is the capital of France” “Berlin is the capital of France”). Demonstrates causal localization, facts have specific weights, and serves as a clean proof-of-concept for the entire intervention paradigm.
Steering vectors: add a learned direction to the residual stream to push the model toward a behavior; subtract to push it away. Crude but effective for behavior modulation, and a common starting point for “make the model more X” interventions before reaching for the heavier machinery.
Feature clamping: the SAE-enabled variant of steering. Force an SAE feature’s activation high or low; observe the behavioral effect. Maps SAE features to causal influence in a way that pure observation cannot.
The current state of the field
What works
Four areas of progress as of early . Probing, mature; works well for many concepts; layer-wise emergence is well-characterized across architectures. Sparse autoencoders: rapidly advancing; Anthropic’s flagship direction; scaling to frontier models with Templeton . Circuits, dozens identified in small models, with the canonical examples (induction heads, IOI) well-established; scaling beyond GPT- small is the open frontier. Causal interventions, well-developed methodology; widely used; combined with SAEs and circuits routinely in current papers.
What’s open
Five open problems define the field’s near-term research agenda. Coverage, do our methods find all the model’s features? Almost certainly not; current SAEs are large but presumably incomplete dictionaries. Scale, most mech-interp work is on small models; frontier models are largely uncharted at the circuit level. Automation, discovering circuits and interpreting features still requires significant human labor; ACDC and successors attack this but have not removed the bottleneck. Verification, how do we know a circuit truly explains a behavior, versus offering a partial story that happens to fit the patching results? Generalization, do circuits found at one scale or task transfer to others?
Where research is heading shapes what engineers should expect over the next few years. Larger SAE deployments, more features, more models. Cross-layer circuit discovery, tracing computations across all layers, not just within a few. Safety applications: using interpretability to detect specific dangerous behaviors before they manifest in evaluations. Real-time monitoring, applying interpretability tools to production model inference, which is a substantial engineering project on top of the research advances.
Key labs and groups, with rough specialization. Anthropic, SAEs (Bricken , Templeton ); circuits (Elhage ); interpretability as a core safety bet. OpenAI, sparse coding and probing; dedicated interpretability team. DeepMind, mechanistic interpretability; circuit discovery. Apollo Research, focused on detecting deceptive alignment via interpretability. EleutherAI, open-source interpretability tooling, including the tuned-lens library and the Pythia model suite built for interpretability research. TransformerLens, the mech-interp community’s standard library (originated as Neel Nanda’s EasyTransformer, now maintained under TransformerLensOrg), independent of any single lab. Independent research organizations including Conjecture, Redwood Research, alongside university labs.
Exercises
Four exercises that lock in the interpretability toolkit. Each is a self-contained problem with a starting template; hints are collapsed by default; try the problem first.
The exercises trace the chapter’s arc: train a linear probe from scratch (Ex 1) → train a toy sparse autoencoder (Ex 2) → run activation patching to verify causal information flow (Ex 3) → label SAE features by examining their top activating inputs (Ex 4).
Exercise 1 (easy): Linear probe from scratch
Implement a linear probe that decodes a binary concept from hidden states. Evaluate at multiple layers and report which layer best decodes the concept.
Hint
The training loop:
- Initialize
w(shape(d,)) andb(scalar) randomly. - For each iteration: compute logits =
hidden_states @ w + b; apply sigmoid to get probs; compute cross-entropy loss; update via gradient descent. - The gradient of the cross-entropy loss is:
(probs - labels) @ hidden_states / Nforw, mean forb.
For multi-layer evaluation: train one probe per layer; report which layer achieved the highest test accuracy.
Solution
Standard logistic-regression gradient descent, trained independently per layer; the layer with the highest post-training accuracy is the peak.
def sigmoid(z):
return 1 / (1 + np.exp(-z))
def train_linear_probe(hidden_states, labels, n_iterations=500, lr=0.01, seed=0):
N, d = hidden_states.shape
np.random.seed(seed)
w = np.random.randn(d) * 0.01
b = 0.0
for _ in range(n_iterations):
logits = hidden_states @ w + b
probs = sigmoid(logits)
dw = hidden_states.T @ (probs - labels) / N
db = np.mean(probs - labels)
w -= lr * dw
b -= lr * db
return w, b
accuracies = []
for layer_idx in range(n_layers):
w, b = train_linear_probe(hidden_per_layer[layer_idx], labels)
acc = probe_accuracy(hidden_per_layer[layer_idx], labels, w, b)
accuracies.append(acc)
best_layer = max(range(n_layers), key=lambda i: accuracies[i])With this seed setup, accuracy runs from 76% at L0 up to 92.5% at L6, back down to 74% at L11: the measured peak lands one layer off the true signal peak (L5, strength 1.7 vs. L6’s 92.5% and strength 1.5), which is expected sampling noise with only 200 examples per layer. The overall shape (rise, peak, fall) tracks signal_strengths closely.
Exercise 2 (medium): Toy sparse autoencoder
Train a sparse autoencoder on synthetic data with a known number of “true features.” Report how many live features the trained SAE produces.
Hint
The SAE training loop:
- Encoder:
f = ReLU(W_enc x + b_enc), shape(N, D)whereD > d. - Decoder:
x_hat = W_dec f + b_dec. - Loss = reconstruction (MSE) + sparsity (L1 penalty on
f). - Gradients via chain rule (manual or with autograd).
A “live” feature is one that activates above a threshold on at least some input.
Solution
Manual backprop through decoder → ReLU → encoder, with the L1 term’s subgradient sign(f) added to the feature gradient before the ReLU mask is applied.
def train_sae(X, D, lr=0.02, sparsity_lambda=0.05, n_iterations=1500, seed=11):
N_, d = X.shape
np.random.seed(seed)
W_enc = np.random.randn(D, d) * 0.1
b_enc = np.zeros(D)
W_dec = np.random.randn(d, D) * 0.1
b_dec = np.zeros(d)
for it in range(n_iterations):
pre = X @ W_enc.T + b_enc
f = np.maximum(0, pre)
x_hat = f @ W_dec.T + b_dec
resid = x_hat - X
d_xhat = 2 * resid / N_
d_Wdec = d_xhat.T @ f
d_bdec = d_xhat.sum(axis=0)
d_f = d_xhat @ W_dec + sparsity_lambda * np.sign(f) / N_
d_pre = d_f * (pre > 0)
d_Wenc = d_pre.T @ X
d_benc = d_pre.sum(axis=0)
W_dec -= lr * d_Wdec
b_dec -= lr * d_bdec
W_enc -= lr * d_Wenc
b_enc -= lr * d_benc
return W_enc, b_enc, W_dec, b_decRunning this against the 10 true features gives True feature count: 10 / Live SAE features: 89 (of 96 possible) and Reconstruction MSE: 0.0827, confirming the observation comments above: plain L1 on an unconstrained decoder leaves most of the 96 hidden units live instead of collapsing to ~10, because the penalty can be gamed by shrinking f while W_dec’s column norms grow. Getting live count down near n_true_features needs the fixes noted above (decoder unit-norm constraint + dead-feature resampling), not just a larger sparsity_lambda.
Exercise 3 (medium): Activation patching across layers
Implement activation patching to identify which layer carries the relevant information for a behavioral difference between two prompts.
Hint
The patching loop:
- Run two prompts: a “clean” one (correct answer) and a “corrupted” one (wrong answer).
- Each of the network’s 4 components writes additively into a shared output, like heads in a residual stream. For patch depth , use the clean run’s components for depths and the corrupted run’s components for the rest.
- Measure how much the output flips toward the clean answer as grows.
- The depth where recovery jumps from near-zero to high is where the information lives.
Solution
Depths 0..patch_depth take the clean run’s component outputs, the rest take the corrupted run’s; recovery is how far the mixed output has moved back toward the clean output.
def patched_forward(clean_contribs, corrupt_contribs, patch_depth):
mixed = [clean_contribs[L] if L <= patch_depth else corrupt_contribs[L]
for L in range(n_layers)]
return model_output(mixed)
for depth in range(n_layers):
patched = patched_forward(clean_contribs, corrupt_contribs, depth)
recovery = (patched - out_corrupt) / (out_clean - out_corrupt)
print(f"Patch through depth {depth}: output = {patched:.4f} "
f"recovery = {recovery:.0%}")Output: Clean output: -1.2401, Corrupted output: 0.5690, Gap to recover: -1.8091, then recovery of 2% (depth 0), 34% (depth 1), 65% (depth 2), 100% (depth 3), matching the observation comments exactly: depth 0 (listens_to_dim0 = 0.05) barely moves the output, recovery jumps once depth 1 (listens_to_dim0 = 0.9) is patched in, and climbs to full recovery by depth 3.
Exercise 4 (hard): SAE feature labeling
Given an SAE feature represented by its top activating inputs, assign it a human-readable label. Evaluate label accuracy against a curated set of “ground truth” features.
Hint
The feature-labeling pipeline:
- For each feature, look at its top-K activating inputs (text snippets).
- Identify common patterns: shared topics, common keywords, semantic themes.
- Generate a short label that captures the common concept.
For this exercise, mock the labeling step with a keyword-frequency heuristic. Real feature labeling uses an LLM to read the inputs and produce a description.
To evaluate: compare your labels to ground-truth labels for some features. Report accuracy as exact-match or label-similarity.
Solution
Extract the top common words per feature, then match against a fixed keyword set per category; the intersection check works even when a keyword appears only once (ties in Counter.most_common are broken by first-seen order, so widening top_n catches keywords that would otherwise fall just outside the cutoff).
def label_feature(feature):
words = extract_common_words(feature['top_inputs'], top_n=8)
wordset = set(words)
if wordset & {'for', 'while', 'range'}:
return 'Python loops'
if wordset & {'vous', 'un', 'en', 'je', 'la', 'nous'}:
return 'French language'
if wordset & {"can't", "won't", 'decline'}:
return 'Refusal patterns'
if wordset & {'love', 'great', 'amazing', 'excellent'}:
return 'Sentiment positive'
return 'unknown'All four features label correctly: feat_001 -> Python loops, feat_002 -> French language (via unaccented function words vous, un, en, je), feat_003 -> Refusal patterns (via can't, since won't and decline fall outside the top-8 common words but can't alone is enough), feat_004 -> Sentiment positive. Accuracy: 4/4 = 100%.
From interpretability to evaluation
Connecting interp to eval
Part VIII is three chapters with a shared central question. Can capable models be made trustworthy at scale? Chapter 24 covered what we want the model to do, how we train it, and how we red-team. Chapter 25, this chapter, covers what the model is actually computing internally. Chapter 26 covers how we measure capability and safety quantitatively, including the methodology problems that make many published benchmark numbers misleading.
The connection between the three is structural. Safety plus evaluation without interpretability is behavioral testing only: it catches what we think to test for and misses what we do not. Safety plus interpretability without evaluation gives us tools but no measurement; we cannot say “is this model safer than the last?” Interpretability plus evaluation without safety gives us tools and measurements but no operational discipline. All three together is a complete safety practice: what we want, what the model is computing, and whether it is improving.
Part VIII’s central question
Interpretability is the verification arm of safety. Probes read concepts from hidden states; sparse autoencoders pull apart superposition into monosemantic features; circuits reveal how the model computes; causal interventions confirm that components actually matter. None of these techniques is complete; together, they are a microscope on alignment. The techniques already appear in production-oriented work, including Anthropic’s SAE work on Claude Sonnet, OpenAI’s interpretability team, and deployed feature-clamping pilots. The toolkit is improving rapidly.
Chapter 26 opens the evaluation discipline. If interpretability tells you what the model is computing, evaluation tells you how well: capability benchmarks, safety benchmarks, leaderboards, what they measure, and what they miss. Together with Chapter 24, the three disciplines of Part VIII turn capability into trustworthiness. Part IX then assembles the full stack, capability and discipline together, into complete agent architectures.