Chapter 25

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 20162016; the modern sparse-autoencoder breakthrough (Bricken et al., Anthropic) is from 20232023; circuit discovery is largely an artisanal craft on small models. What works today: linear probes for many concepts at 808095%95\% accuracy on hidden states of frontier models, sparse autoencoders scaled to Claude 33 Sonnet with millions of extracted features (Templeton 20242024), 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 20242024, 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  :  what does the model compute?vs.verification  :  is it doing what we want?\text{understanding} \;:\; \text{what does the model compute?} \quad\text{vs.}\quad \text{verification} \;:\; \text{is it doing what we want?}

(25.interpretability-goals)

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 20242024, 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 20252025 is worth keeping in mind. Probe accuracy for common concepts: 808095%95\% on hidden states of frontier models. SAE feature count (Templeton 20242024): millions extracted from Claude 33 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 20162016) 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 XX linearly decodable from layer LL?, yes or no, with probe accuracy as the signal. At which layer does concept XX emerge?, train probes at every layer and find where accuracy spikes. How does concept XX 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.

Linear probing visualizer

Interactive
Linear probing visualizer
6 concepts · 12-layer transformer · layer-wise feature emergence
Pick a concept:
TOKEN IDENTITY
surface
Decoding which token is at a given position. The most basic information; trivially recoverable from the input embedding.
0.500.751.00L0L1L2L3L4L5L6L7L8L9L10L11peak: L0 (0.99)probe accuracylayer index
Why this layer?
Token identity is maximally decodable at layer 0 (the embedding). As the model adds task-relevant transformations across layers, the original token identity is gradually mixed into more abstract representations.
All 6 concepts overlaid (selected concept in cyan)
0.500.751.00L0L1L2L3L4L5L6L7L8L9L10L11Token identitySentence boundariesPart of speechNamed entitiesSentimentRefusal patterns
ConceptCategoryPeak layerPeak accuracy
Token identitysurfaceL00.99
Sentence boundariessyntacticL30.96
Part of speechsyntacticL40.94
Named entitiessemanticL80.92
SentimentsemanticL90.93
Refusal patternstask-specificL110.95
Click through the concepts. Surface features (token identity) peak at layer 0 and fade across layers, as the model transforms surface info into abstract representations. Syntactic features (sentence boundary, POS) peak in early-middle layers. Semantic features (named entities, sentiment) peak in middle-late layers, requiring more context integration. Task-specific features (refusal patterns) peak at the last layer: the model commits to behavioral decisions only after integrating all context. This layer-wise emergence pattern is one of probing's most robust findings, and a window into how computation flows through a transformer.

Six concepts (token identity, sentence boundaries, part-of-speech, named entities, sentiment, refusal patterns) probed across 12 layers of a small transformer. Each concept's probe accuracy curve reveals where in the network the concept becomes most decodable. The pattern: surface features peak early, syntactic features in early-middle, semantic features in mid-late, task-specific features at the very end. One of probing's most robust empirical findings, and a window into how computation flows through transformer layers.

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 12341234 might fire on Python for loops, French sentences about cooking, and digit-grouped numbers. Neuron 56785678 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 20222022) 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 FF, the relevant direction lights up, which can manifest as activation on several different neurons.

dmodel    number of meaningful features        features must share neuronsd_{\text{model}} \;\ll\; \text{number of meaningful features} \;\;\Longrightarrow\;\; \text{features must share neurons}

(25.superposition)

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 20232023, Templeton 20242024), are the path through superposition. The recipe is five steps. Take model activations xRd\mathbf{x} \in \mathbb{R}^{d} from a chosen layer, typically the residual stream after some block. Train an autoencoder with a much wider hidden layer: often 8×8 \times to 128×128 \times the residual dimension, and a sparsity penalty. Encoder: f=ReLU(Wencx+benc)\mathbf{f} = \text{ReLU}(W_{\text{enc}} \mathbf{x} + \mathbf{b}_{\text{enc}}), with WencRD×dW_{\text{enc}} \in \mathbb{R}^{D \times d} and DdD \gg d. Decoder: x^=Wdecf+bdec\hat{\mathbf{x}} = W_{\text{dec}} \mathbf{f} + \mathbf{b}_{\text{dec}}. Loss: xx^22+λf1\lVert \mathbf{x} - \hat{\mathbf{x}} \rVert_2^2 + \lambda \lVert \mathbf{f} \rVert_1, reconstruction plus an L1L_1 sparsity penalty on the hidden code.

What you get is DD “features” f1,,fD\mathbf{f}_1, \ldots, \mathbf{f}_D, each a sparse signal across the dataset. For each feature you can identify the inputs that activate it, the top-KK 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 20242024 on Claude 33 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.

SAE feature explorer

Interactive
SAE feature explorer
10 curated monosemantic features · inspired by Templeton 2024
Pick a feature:
GOLDEN GATE BRIDGE
knowledge
Activates on text about the Golden Gate Bridge: its history, engineering, and references to San Francisco landmarks.
  • The Golden Gate Bridge spans the strait between San Francisco Bay and the Pacific.
    1.00
  • Construction of the Golden Gate began in 1933 and finished in 1937.
    0.92
  • The bridge's distinctive "International Orange" color was chosen for visibility.
    0.81
  • San Francisco's skyline is dominated by the Bay Bridge and Golden Gate.
    0.65
  • Visitors can walk across the pedestrian path on either side of the bridge.
    0.54
Discovery note
Templeton 2024 made this feature famous when Anthropic released "Golden Gate Claude," a version of Claude where this feature was clamped high, causing it to mention the Golden Gate Bridge constantly. A clean demonstration of feature-level intervention.
Feature space: related features cluster together
Golden Gate BridgeMathematical equationsPython for-loopsCode vulnerabilitiesScientific reasoningHedging and uncertaintyDeception / secrecySycophancyRefusal patternsFrench language
  1. 1.Mathematical equations(knowledge)
  2. 2.Hedging and uncertainty(reasoning)
  3. 3.Scientific reasoning(reasoning)
Click through the features. Each one represents a learned direction in the model’s activation space that activates on a specific, interpretable concept. The activation bars show how sharply the feature fires on its top inputs: peak inputs hit 1.0, related-but-not-perfect inputs fall off. The 2D map reveals decoder geometry: features in the same family cluster together because the SAE learned them as related directions. This is what Anthropic’s breakthrough looks like: not a finished science, but a tractable handle on what’s inside the model, and a foundation for safety verification.

Ten curated SAE features, each a learned direction that activates on a specific interpretable concept (Golden Gate Bridge, Python loops, code vulnerabilities, deception, scientific reasoning, French language, sycophancy, math equations, hedging, refusal). Inspired by Templeton 2024. Each feature shows its top-5 activating inputs with relative activation strengths. The 2D feature-space map shows family-based clustering and the top-3 nearest neighbors for the selected feature. Demonstrates what monosemantic features look like, Anthropic's recent interpretability breakthrough in interactive form.

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 20202020), 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 20212021, Olsson 20222022), 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-22-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 2525 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 XX is present in the activations” to “concept XX causes behavior YY” 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 20202020), 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 20232023), 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 20222022), identify MLP layers that store factual associations; surgically edit MLP weights to change a fact (e.g., “Paris is the capital of France” \to “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 20252025. 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 20242024. Circuits, dozens identified in small models, with the canonical examples (induction heads, IOI) well-established; scaling beyond GPT-22 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 20232023, Templeton 20242024); circuits (Elhage 20212021); 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:

  1. Initialize w (shape (d,)) and b (scalar) randomly.
  2. For each iteration: compute logits = hidden_states @ w + b; apply sigmoid to get probs; compute cross-entropy loss; update via gradient descent.
  3. The gradient of the cross-entropy loss is: (probs - labels) @ hidden_states / N for w, mean for b.

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:

  1. Encoder: f = ReLU(W_enc x + b_enc), shape (N, D) where D > d.
  2. Decoder: x_hat = W_dec f + b_dec.
  3. Loss = reconstruction (MSE) + sparsity (L1 penalty on f).
  4. 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_dec

Running 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:

  1. Run two prompts: a “clean” one (correct answer) and a “corrupted” one (wrong answer).
  2. Each of the network’s 4 components writes additively into a shared output, like heads in a residual stream. For patch depth LL, use the clean run’s components for depths 0..L0..L and the corrupted run’s components for the rest.
  3. Measure how much the output flips toward the clean answer as LL grows.
  4. 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:

  1. For each feature, look at its top-K activating inputs (text snippets).
  2. Identify common patterns: shared topics, common keywords, semantic themes.
  3. 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 33 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.