Michael Igorevich Ivanitskiy
2026-06-22
The Problem:
Gradient descent finds a set of parameters which minimize the training objective, but it’s just a point in a billions-dimensional space of possible models. We don’t build models the way we build cars or planes.
and when we give them agency, they misbehave – often in ways we don’t see coming.
(good luck with that)
What does it even mean to “understand” a neural network anyway?
When training a linear classifier with Lasso, you can just look at the weights to see what inputs mattered. With a deep neural net, this is not so easy!
“Local Interpretable Model-Agnostic Explanations” (LIME), from Riberio et al (2016): locally around a sample, make a linear model that behaves like your big model
“SHapley Additive exPlanations” (SHAP), from Lundberg et al (2017): much like LIME, but with nicer game-theoretic guarantees
What part of the input is most relevant for the decision the network is making?
“Neural correlates of interspecies perspective taking in the post-mortem Atlantic Salmon: An argument for multiple comparisons correction” (Bennett et al)
Key issue: everything so far is merely correlational.
Let \mathcal{V} be a finite vocabulary (typically |\mathcal{V}| > 10^5):
"The quick red fox jumped over the lazy brown dog"
\Rightarrow
[
"The", "quick", "red", "fox", "jumps",
"over", "the", "lazy", "dog"
]
\Rightarrow \begin{bmatrix} 3, 17, 42, 8, 123, 56, 3, 78, 9 \end{bmatrix} \in \N_{d_v}^{9}
\Rightarrow X \in \R^{9 \times d_m}
A Language Model learns the conditional probability:
\mathbb{P}\left[ q_{n+1} \mid [q_1, \ldots, q_n] \right]
i.e. given a sequence s, predict the distribution over possible next tokens. By sampling from the distribution over the next token and appending it to the sequence, we can generate text.
\mathbb{A}: \R^{n \times d_m} \to \R^{n \times d_m}
[\mathbb{A}(X)]_i = \sum_{j=1}^n \sigma(\mathcal{A}(X))_{i,j} W_{OV} x_j
where \sigma is the softmax function applied row-wise:
\sigma(B)_{i,j} = \frac{e^{B_{i,j}}}{\sum_k e^{B_{i,k}}}
and the “attention pattern” \mathcal{A}(X) \in \R^{n \times n} is a “measure of similarity” between the embeddings.
So where do we get \mathcal{A}(X) from? \mathcal{A}(X)_{i,j} = x_i W_{QK} x_j^T + M_{i,j} where M \in \R^{n \times n}, \quad M := \begin{cases} 0 & i \leq j \\ -\infty & i > j \end{cases}
Masking is necessary to prevent the model from “cheating” by looking at future tokens.
The learnable parameters of an attention head are thus given by the matrices W_{QK}, W_{OV} \in \R^{d_m \times d_m}. In practice, we learn low-rank approximations to both of these.
A primary object of study in interpretability is the residual stream: the set of activations at various layers and sequence positions.
If W_U converts a final-layer residual vector into a next-token prediction, why not apply it to an intermediate one? This is exactly the logit lens, introduced by nostalgebraist (2020):
\texttt{logits}^{(\ell)} = X^{(\ell)} W_U \in \mathbb{R}^{n_c \times d_v}.
Residual connections exist, so there is some level of stability in representations across layers. But, this stability is imperfect
enter the Tuned Lens (Belrose et al., 2023): learn a small affine translator mapping intermediate to final-layer basis before unembedding
We’ve been watching: the logit lens shows what the model predicts at each layer.
But watching can’t separate cause from coincidence: a direction can be present and never used.
To find what the model actually uses, we have to intervene.
"The Eiffel Tower is located in _____"
"Paris"A debugging move you’ve all done: splice a value from a
known-good run into a broken run to
find where it diverges – git bisect, inside one forward
pass.
However, this is trickier than it looks! Naively, given this one example, you might as well just find the (un)embedding of the token “Paris” and patch that in.
Obviously, this is not what we’d like! Our interventions should ideally modify the thing we are trying to modify, and nothing else!
Do the surgical swap at every site (\ell, t) \to a heatmap of causal importance.
Meng et al., 2022 (ROME): factual recall lights up at mid-layer MLPs, last subject token – and they then edit those weights so the model says “Rome”.
What the swap bought us:
But one swap finds one part. A behavior is many parts, wired together.
The simplest interesting case is just nodes and one edge: induction heads. Then many parts, found automatically \to circuits.
Our first circuit: the smallest one that does something interesting – two heads, one wire.
Try the following:
Almost any language model trivially does this task. No n-gram, for any value of n, could ever do this!
Language models learn in-context. Even in the simplest possible case, you can think of them learning an n-gram during a single forward pass!
Given a sequence:
A B C D E ... A B C D _
How does a language model correctly predict E?
Two steps:
“In-context Learning and Induction Heads”, Olsson et al (2022)”
The induction head was our first circuit: a small group of components that together implement a behavior.
Picture the whole transformer as a computational graph:
Every block reads and writes the shared residual stream, so the graph is densely connected. A circuit is the sparse subgraph that actually does the work.
A circuit C should be:
“When Mary and John went to the store, John gave a drink to ___”
GPT-2 small answers “Mary”. Wang et al. (2023) reverse-engineered how – \approx 26 heads in cooperating roles:
IOI also has backup name-mover heads: dormant heads that take over when the primary name-movers are ablated.
So single-component ablation understates importance – knock out the “important” head and the model quietly routes around it. Networks are redundant and self-repairing.
Hand-analysis doesn’t scale. Automate the search over the graph:
Validate a candidate circuit C by ablation:
Subtlety: how you ablate matters. Zero-ablation (delete entirely) goes off-distribution. Hence, mean-ablation or resampling from other task inputs – but these come with their own problems.
Circuits over heads and neurons hit a wall:
The model has ~no incentive to have it’s internal representations align with your canonical basis vectors (neurons)!
The Johnson–Lindenstrauss lemma (Johnson & Lindenstrauss, 1984):
n vectors can be embedded in \mathbb{R}^{d_m} with pairwise near-orthogonality
|\langle u, v\rangle| \le \epsilon
as long as
d_m = O(\log n / \epsilon^2)
The number of “almost orthogonal” directions grows exponentially in the dimension, not linearly.
The model can store more features than it gets orthogonal directions!
Leads us to the current paradigm: the residual stream contains dense vectors, but these secretly contain many features, which we would like to find
Going back in time a bit: Alain & Bengio, 2016 introduce linear probes:
Given some known feature (that you have labels for) of the dataset, you can train an affine model to predict the feature given only the target model’s activations. Whether or not it works might tell you something about whether the model is using this known feature.
For example:
Your instructor said " there will be no homework for this course " and the students were glad.
0 0 0 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0
def probe(text: list[str]) -> list[bool]:
output: list[bool] = []
# count the quotes
n_quotes: int = 0
for x in text:
if x == '"':
# if a quote, increment count and append True
n_quotes += 1
output.append(True)
else:
# otherwise, True if there have been an odd number of quotes
output.append(bool(n_quotes % 2))Linear Probes provide a supervised way to figure out which directions represent a feature. However:
Here we have the reverse problem: our data has already been packed into a high dim space. We need to unpack it.
Given some intermediate activation x, learn an autoencoder
z = \mathrm{ReLU}\!\bigl(W_{u} x + b_{u}\bigr) \in \mathbb{R}^n, \qquad \hat{x} = W_{d}\, z + b_{d} \in \mathbb{R}^{d_m}.
with loss
\mathcal{L} = \lVert x - \hat{x}\rVert_2^2 + \lambda \lVert z \rVert_1 .
See: Bricken et al., 2023, Cunningham et al., 2023, Templeton et al., 2024.
Just give a language model examples of text where the feature activates, and ask it to explain what’s going on!
Lots of variants of SAEs exist and are an active area of research, but the key idea of “decomposing activations into a sparse set of features” is the core.
TopK SAEs (Makhzani & Frey, 2013; Gao et al., 2024): Replace the L_1 penalty with a hard constraint that exactly k features activate per input.
Gated SAEs (Rajamanoharan et al., 2024): Separate the “which features activate” decision from the “what magnitude” computation using a gating mechanism. Improves reconstruction at the same sparsity level.
Transcoders (Dunefsky et al., 2024): Instead of autoencoding a layer’s activations, learn to predict the next layer’s activations from the current layer’s features. This gives a feature-level description of computation rather than just representation. Applied to MLP blocks: input is the MLP input, output is the MLP output, and the hidden features describe what the MLP “does” in interpretable terms.
Attention SAEs / Multi-layer SAEs: Apply SAEs to attention outputs, or train joint SAEs across multiple layers to capture features that evolve through the network.
Matrioshka SAEs (Bussmann et al., 2025): Train a hierarchy of SAEs where each layer’s features are autoencoded by the next layer, creating a multi-scale decomposition of the model’s representations. Helps with feature splitting.
See:
Sparse Autoencoders let us decompose activations in an unsupervised way, but intervening on these activations can be brittle. What if we could decompose the weights instead?
Furthermore, circuit-based methods suffer from language model components (Attention Heads, MLPs) being too coarse. Having a way to decompose the weights into meaningful components would be helpful!
Given some network f_\theta : \mathbb{R}^d \to \mathbb{R}^d taking inputs x \sim \mathcal{D} \subset \mathbb{R}^d with learned parameters \theta = \{W^1, \ldots, W^L \}, SPD learns:
How do we learn this?
Faithfulness Loss (Parameter Matching) \mathcal{L}_{\text{weight}} = \sum_{\ell \in \mathbb{N}_L} \left\| W^\ell - \sum_{i \in \mathbb{N}_C} C_{\ell,i} \right\|^2_F
Minimality Loss (Sparsity) \mathcal{L}_{\text{min}} = \mathop{\mathbb{E}}_{x \in \mathcal{D}} \left[ \sum_{ \substack{\ell \in \mathbb{N}_L \\ i \in \mathbb{N}_C} } |g_{\ell,i}(x)|^p \right]
Stochastic Reconstruction
Loss:
Stochastically masking out the components according to the gate should
not change the output
Given some input x, we have the “original” forward pass f_\theta(x), and we want our “masked” forward pass with weights \hat{\theta} to give the same output.
Stochastic Parameter Decomposition:
Slice up (decompose) a network's weights (parameters) into rank-1 components so that only some of them are needed for any given computation, and the rest can be set to arbitrary magnitudes (stochastically)
More on parameter decomposition methods:
Read one survey first to get the lay of the land, then a problem list to find something to work on.
| Resource | What it is |
|---|---|
| Räuker et al. (2022), Toward Transparent AI | Broad survey of methods for inspecting the internals of DNNs; the framing this review borrows from. |
| Bereska & Gavves (2024), Mechanistic Interpretability for AI Safety — A Review | The most current end-to-end survey of mech interp, organized around features, circuits, and safety. |
| Sharkey et al. (2025), Open Problems in Mechanistic Interpretability | A 29-author forward-looking agenda; the best single source for thesis-scale open problems. |
| Nanda (2022), 200 Concrete Open Problems | A ranked, beginner-friendly list of concrete projects. Now dated — the author has since marked it as no longer current — but still a useful on-ramp for the flavor of problems. |
| Resource | What it is |
|---|---|
| ARENA (Alignment Research Engineer Accelerator) | The standard hands-on curriculum: build transformers from scratch, then work through interpretability case studies (balanced-bracket classifier, modular-arithmetic grokking, OthelloGPT). Materials are free for self-study. |
| Learn Mechanistic Interpretability | A community-maintained open-source textbook covering probing, steering, circuits, SAEs, and the tooling below. |
| Tool | Use |
|---|---|
| TransformerLens | The workhorse for transformer mech interp: hooks, activation caching, and patching across 9,000+ pretrained models. Originally by Neel Nanda. |
| nnsight (Fiotto-Kaufman et al., 2025) | Architecture-agnostic interventions on any PyTorch model via a computation-graph API; pairs with the NDIF remote-execution fabric so you can probe frontier-scale open-weight models without local GPUs. |
| SAELens | Training and analyzing sparse autoencoders on TransformerLens-compatible models; ships pretrained SAEs and tutorials. |
| Neuronpedia | Web platform for browsing, searching, and steering with pretrained SAE features across many models — the fastest way to build intuition for what features look like. |