Mechanistic Interpretability Techniques in Circuit Tracing (Anthropic 2025)
In the blog post “Circuit Tracing: Revealing Computational Graphs in Language Models” (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models), Anthropic’s interpretability team introduces a methodology for dissecting model internals using an interpretable “replacement model” and attribution graphs. Below we summarize the key concepts and methods from that work, including their mathematical formulation and role in mechanistic interpretability:
Transcoders and Sparse Feature Representations
Transcoders are a class of learned interventions designed to resolve superposition by finding an alternate basis of features for a model’s activations (Circuit Tracing: Revealing Computational Graphs in Language Models). A transcoder is trained to approximate the function of one or more model subcomponents (typically an MLP layer) using a wider but sparsely-activating layer ([2406.11944] Transcoders Find Interpretable LLM Feature Circuits) ([2406.11944] Transcoders Find Interpretable LLM Feature Circuits). In practice, this means replacing the original densely active neurons with a larger set of “features” that each fire rarely (ideally on a single human-interpretable concept). Mathematically, if is the input activation (e.g. a residual stream vector) to an MLP and the MLP’s output, a transcoder introduces an encoder matrix and decoder matrix such that:
- Encoder: , where is a high-dimensional hidden feature vector and is a sparsifying nonlinearity (e.g. a thresholded ReLU). The dimension of is larger than , allowing an overcomplete representation.
- Decoder: , producing a reconstructed output. can be viewed as defining the meaning of each feature in the original activation space.
The transcoder is trained to minimize a reconstruction loss, typically mean squared error (MSE) between the actual model output and the reconstructed output . For example, one can minimize
summing over layers if multiple layers are being approximated (Circuit Tracing: Revealing Computational Graphs in Language Models). To achieve sparsity, an additional penalty is added to the loss, often based on the norm of the hidden features or a saturating proxy (like a hyperbolic tangent of activations) (Circuit Tracing: Revealing Computational Graphs in Language Models). The total loss is with tuning sparsity. Intuitively, this encourages each feature in to be mostly zero, activating only for particular inputs. In Anthropic’s implementation, they use a custom activation called JumpReLU (a thresholded ReLU with a straight-through estimator) and a tanh-based sparsity penalty to achieve a good trade-off between reconstruction fidelity and feature sparsity (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). They also include a small “pre-activation” loss to prevent dead (never-active) features (Circuit Tracing: Revealing Computational Graphs in Language Models).
Because transcoders produce sparsely activating features, these features tend to correspond to more monosemantic concepts than standard neurons ([2309.08600] Sparse Autoencoders Find Highly Interpretable Features in Language Models) ([2309.08600] Sparse Autoencoders Find Highly Interpretable Features in Language Models). In other words, each feature often responds to a specific human-understandable pattern. The blog notes that prior work used Sparse Autoencoders (SAEs) for a similar purpose (Circuit Tracing: Revealing Computational Graphs in Language Models), but their approach prefers transcoders for improved circuit interpretability (Circuit Tracing: Revealing Computational Graphs in Language Models). An SAE likewise learns an encoder-decoder pair to reconstruct activations with a sparsity constraint (often via regularization or a k-sparse objective), typically solving:
where is a dataset of activation vectors and is a possibly nonlinear sparsity-enforcing transform (e.g. identity with an penalty, or an explicit k-sparse function). SAEs can discover an alternative basis of directions in activation space that are invisible in the neuron basis (e.g. one SAE feature might be a combination of many neurons) ([2309.08600] Sparse Autoencoders Find Highly Interpretable Features in Language Models) ([2309.08600] Sparse Autoencoders Find Highly Interpretable Features in Language Models). Both SAEs and transcoders address polysemanticity by resolving the superposition of multiple concepts in one neuron into separate sparse features. However, transcoders in this work are engineered to integrate seamlessly into a replacement model, as described next.
Interpretability use-case: By training transcoders on a pre-trained transformer’s activations, researchers can decompose the model’s computations into human-interpretable feature units. Dunefsky et al. (2024) demonstrated that transcoders can approximate GPT-2’s MLP layers faithfully while yielding features as interpretable as SAE features ([2406.11944] Transcoders Find Interpretable LLM Feature Circuits) ([2406.11944] Transcoders Find Interpretable LLM Feature Circuits). In practice, one can replace the model’s neurons with these sparse features to analyze circuits. For example, Anthropic trains transcoders on an 18-layer language model’s MLPs, then replaces those MLPs with the transcoder features, obtaining similar outputs ~50% of the time (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). This creates a “proxy” model that is easier to interpret, since its units (features) correspond to understandable patterns (e.g. “feature that activates on the word digital”) rather than opaque linear combinations of neurons.
Cross-Layer Transcoder (CLT) and Replacement Model
A key innovation in the blog is using a Cross-Layer Transcoder (CLT) (Circuit Tracing: Revealing Computational Graphs in Language Models). Instead of training an independent transcoder per layer, they train a single set of features that operate across multiple layers. In a CLT, each feature is associated with a specific source layer but can influence later layers. Concretely, if the original transformer has layers, the CLT defines features at each original layer . Each such feature reads from that layer’s residual stream and writes to the residual stream of all subsequent layers. Anthropic’s replacement model then substitutes the original MLP at layer with the contributions of all CLT features from layers . In formula form (Circuit Tracing: Revealing Computational Graphs in Language Models):
- Let be the residual stream at layer . The feature activations at layer are (Circuit Tracing: Revealing Computational Graphs in Language Models). This produces a sparse vector of feature activations for that layer.
- The contribution of features from a source layer to a later layer is linear: (the reconstructed MLP output at layer ) sums over all active features from earlier layers: Here is the decoder matrix mapping features from layer into the residual update at layer (Circuit Tracing: Revealing Computational Graphs in Language Models). In effect, a feature born at layer contributes additively to the residual streams of every subsequent layer .
Because each feature’s effect bridges over the nonlinearities of intermediate MLPs, the direct interactions between features become approximately linear (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). This is crucial for interpretability: if feature influences feature down the line, one can treat it (for a fixed input) as a linear dependence rather than a complicated nonlinear coupling. The replacement model constructed from the CLT thus behaves like a feedforward linear model (for fixed attention) composed of these features. Formally, Anthropic freezes other nonlinear components (the attention patterns and layer norm scaling) so that for a given input prompt, the pre-activation of any feature is an affine function of earlier feature activations (Circuit Tracing: Revealing Computational Graphs in Language Models). As they note, this setup is analogous to treating the network as a linearized computational graph around that input (Circuit Tracing: Revealing Computational Graphs in Language Models). The CLT’s outputs match the original model’s MLP outputs with reasonable accuracy (around 50% exact match on next-token output) (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). While not perfect, this alignment means the same features that the CLT uses often correspond to actual mechanisms in the original model.
Interpretability use-case: The CLT-enabled replacement model serves as a stand-in for the original network when analyzing specific behaviors. Researchers can forward a chosen prompt through the replacement model and obtain all feature activations and their pairwise influences, which are far more interpretable than raw neuron activations. Because each feature spans multiple layers, entire multi-step computations (circuits) can sometimes be captured by a single feature’s chain of effects (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). The blog emphasizes that cross-layer features “greatly simplify” the circuits by reducing redundant re-encoding of the same concept in each layer (Circuit Tracing: Revealing Computational Graphs in Language Models). In other words, a concept first detected in layer 3 might be carried through as one persistent feature, instead of being rediscovered by separate neurons in layers 4, 5, etc. This simplification helps isolate direct feature–feature interactions, which can then be analyzed via attribution graphs.
Attribution Graphs (Per-Prompt Computational Graphs)
At the heart of Circuit Tracing is the construction of an attribution graph for a given prompt (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). An attribution graph is a directed acyclic graph in which nodes represent activations (of features, input tokens, or output logits) and edges represent the quantitative influence of one node on another in the replacement model’s computation. In essence, it is a causal circuit diagram of how the model computed its output for that specific input (Circuit Tracing: Revealing Computational Graphs in Language Models).
Nodes: The graphs include several node types (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models):
- Primary input nodes: token embedding vectors for each position in the prompt.
- Intermediate feature nodes: active CLT features at particular layer and position (each feature at each position is a separate node if it fires).
- Error nodes: any portion of the original model’s MLP output that the CLT failed to reconstruct. (These account for approximation error by the replacement model (Circuit Tracing: Revealing Computational Graphs in Language Models).)
- Output nodes: the logits for the target output token(s) of interest. (Typically, they consider the top few most likely next-token logits, to focus on the relevant outputs (Circuit Tracing: Revealing Computational Graphs in Language Models).)
Edges: An edge between two nodes indicates that source node directly contributes to activating target node . Since the replacement model is largely linear w.r.t. feature activations, the edge weights are defined by a linear attribution:
- Let be the activation of source feature and be the effective weight connecting to in the replacement model. Then the edge attribution is (Circuit Tracing: Revealing Computational Graphs in Language Models). This represents how much of ’s activation is coming from . In other words, each feature’s activation is explained as the sum of incoming edges from its predecessors (Circuit Tracing: Revealing Computational Graphs in Language Models).
Anthropic computes in a principled way using the model’s Jacobians (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). Intuitively, is the partial derivative of ’s pre-activation with respect to ’s activation, holding all nonlinearities fixed (no gradients propagate through other features). Formally, they use stop-gradient on the nonlinear parts and accumulate the linear paths. If is a feature at layer and a feature at layer , then (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models):
where index the sequence position of those feature activations, and is a “stop-gradient Jacobian” that propagates linearly through the residual stream (attention outputs and skip connections) from layer to layer (Circuit Tracing: Revealing Computational Graphs in Language Models). In simpler terms, sums up all linear paths from feature to feature through the transformer’s residual connections (including any attention outputs along the way). Multiplying by then gives the actual contribution to ’s value. Similarly, edges from an input token embedding to a feature use (Circuit Tracing: Revealing Computational Graphs in Language Models).
The result of this computation is a potentially huge graph of feature interactions for the given prompt. In practice, each prompt can activate hundreds of features per position, and edges number in the thousands or millions (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). To make the graph interpretable, the authors apply pruning: they algorithmically remove nodes and edges that contribute negligibly to the final output probability. They focus on the subgraph that carries the majority of attribution to the correct output token (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). This pruned attribution graph is the primary object of study in the paper (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models).
Interpretability use-case: Attribution graphs provide a mechanistic explanation for why the model produced a certain output for a given input (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). By tracing paths from input tokens through features to the output, researchers can identify specific circuits. For example, in one case study the attribution graph revealed an “acronym-writing” circuit, involving features that detect letters in parentheses and features that cause the model to output those letters as an acronym expansion (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). Each edge tells which feature influences which other feature, and with what sign and magnitude. This is much more fine-grained than traditional attribution methods (like integrated gradients) because it distinguishes individual intermediate components. The approach is similar in spirit to Dunefsky et al. (2023), who also construct per-prompt feature graphs using transcoders (Circuit Tracing: Revealing Computational Graphs in Language Models).
By examining attribution graphs, one can hypothesize the roles of features in the circuit. The blog describes a process of manually labeling each feature node with a human-understandable description (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). For instance, they find an early-layer feature that activates on the token “digital” and label it “digital (input trigger)” (Circuit Tracing: Revealing Computational Graphs in Language Models), or a late-layer feature that directly increases the probability of the token “dag” and label it “say ‘dag’” (an output-driving feature) (Circuit Tracing: Revealing Computational Graphs in Language Models). These labels then help interpret chains of edges: e.g. a “(first letter of acronym)” feature connects to a “say ‘D’” feature, suggesting a subcircuit for generating acronyms (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). Such feature visualizations and labeling are crucial to make sense of the raw graph (Circuit Tracing: Revealing Computational Graphs in Language Models). The authors generate feature visualizations by looking at examples of text that strongly activate a feature and the direct logit effects of that feature (which tokens it promotes or suppresses) (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). This is analogous to classic feature visualization in vision models (where one might optimize an input to maximize a neuron), but here done by either finding dataset examples or examining the _unembedding weights that a feature feeds into. (In prior work, Anthropic indeed used optimization-based visualization for sparse features (Circuit Tracing: Revealing Computational Graphs in Language Models), although the blog implies they relied more on dataset-based interpretations in this study.)
Finally, once an attribution graph is built and annotated for a prompt, researchers can formulate claims like “Feature A (say, a ‘basketball’ feature) activated by the prompt causes Feature B (a ‘Michael Jordan -> basketball’ association feature) to activate, which in turn raises the logit for ‘basketball’.” These hypotheses can then be validated with causal interventions, as described next.
Causal Interventions and Validation (Activation Patching)
To ensure the attribution graph reflects actual mechanisms used by the original model, the authors perform perturbation experiments (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). This involves directly modifying feature activations and checking if downstream activations and outputs change as predicted by the graph. In mechanistic interpretability, this technique is often called activation patching (or interchange interventions) (Attribution Patching: Activation Patching At Industrial Scale — Neel Nanda). Activation patching means taking two inputs – a source prompt that elicits a certain behavior and a destination prompt that does not – and then transplanting some internal activations from the source run into the destination run (Attribution Patching: Activation Patching At Industrial Scale — Neel Nanda). If doing so causes the destination’s output to switch to the source’s behavior, it implies those activations carried the causal information for that behavior.
In the context of Circuit Tracing, they intervene on one or more CLT features. For example, suppose the attribution graph suggests feature at layer 5 strongly influences an output. To test this, they can artificially boost or suppress ’s activation and see if the final output changes accordingly. Because CLT features propagate to multiple layers, Anthropic introduces a refined method called constrained patching (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). The idea is to modify a feature’s decoded contribution within a specific range of layers so as to isolate its effect. If feature writes to layers 6,7,…,, one can choose a range (say layers 6–10) and replace the feature’s contributions in that range with an amplified or zeroed version, then run the model from layer 10 onwards. By not recomputing earlier or later parts, this prevents complicated feedback loops or double-counting of the feature’s influence (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). Essentially, patching a path means we only allow the intervention to affect a targeted route in the computation graph, rather than everything downstream indiscriminately. (This concept of path patching generalizes standard activation patching by confining the effect to a chosen “path” or subset of connections (How to use and interpret activation patching).)
Mathematically, one simple form of feature patching is: replace the activation with (for some multiplier or to ablate) and propagate its effects to the next layer(s) while holding other components constant. If is some scalar output metric (e.g. the logit difference between the originally predicted token and an alternative), we can measure caused by this intervention. The attribution graph predicts approximately by the summed contributions along edges from . Successful validation means that in the real model matches the sign and relative magnitude expected from the graph’s edge weights (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). The blog reports that across many prompts, these interventions were qualitatively consistent with the attribution graphs, bolstering confidence that the replacement model’s identified circuits are real mechanisms used by the original model (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models).
In broader literature, activation patching (also known as causal tracing in some contexts (Attribution Patching: Activation Patching At Industrial Scale — Neel Nanda) (Advanced Interpretability Techniques for Tracing LLM Activations …)) has been used to locate where specific information is encoded in a network. For example, Meng et al. (2022) used a causal tracing procedure to find which MLP layer in GPT stored a factual association: they ran a corrupted prompt (with a fact changed) and patched in the correct fact’s hidden representation at various layers to see where it fixes the output ([PDF] Locating and Editing Factual Associations in GPT - arXiv) (Causal Tracing (ROME) — pyvene 0.1.2 documentation). This method identified certain middle layers as key-value memory for factual knowledge (But is it really in Rome? An investigation of the ROME model editing …). In general, activation patching gives strong causal evidence: if replacing component ’s activation causes a specific change in output, then was sufficient to carry the information for that change (Attribution Patching: Activation Patching At Industrial Scale — Neel Nanda). Iterating this over many components yields a map of important pieces of the model for a task (How to use and interpret activation patching) (How to use and interpret activation patching).
Interpretability use-case: In Circuit Tracing, interventions serve to verify circuits. For instance, if the attribution graph claims that a “six-related” feature causes an addition output, researchers can intervene to knock out that feature and see if the addition answer is disrupted. If yes, it confirms the feature was necessary for that part of the computation. If not, it may indicate either redundancy (another feature can fill in) or that the replacement model’s graph wasn’t fully faithful. This leads to a notion of mechanistic faithfulness: how reliably does the replacement model’s circuit reflect the true model? They measure this by the alignment of intervention effects with graph predictions (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). In quantitative terms, one could compute a causal score per edge or subgraph, e.g. the correlation between predicted effect (edge weight) and actual effect (change in activation or logit when source is perturbed). A high correspondence means the graph is mechanistically faithful, not just correlational (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). This rigorous validation step is crucial in mechanistic interpretability to avoid mistaking an explanatory story for the model’s actual workings.
Other Mechanistic Interpretability Techniques and Concepts
Beyond the specific methods highlighted in the Circuit Tracing blog, there is a rich toolbox of mechanistic interpretability techniques. We now survey major techniques not explicitly covered in the blog, each with its theoretical underpinnings and use-cases in analyzing transformer models (like GPT-3, LLaMA, etc.). We focus on the methodology and how each helps us understand model internals, including pointers to original papers or key references.
Sparse Autoencoders (SAEs) for Feature Extraction
Sparse Autoencoders are an unsupervised learning approach to identify interpretable features in neural activations. As discussed, an SAE is a type of autoencoder neural network trained to reconstruct input vectors while keeping the hidden representation sparse ([2309.08600] Sparse Autoencoders Find Highly Interpretable Features in Language Models) ([2309.08600] Sparse Autoencoders Find Highly Interpretable Features in Language Models). For a given activation vector (for example, a residual stream slice or layer’s neuron activations), an SAE with code dimension ( is common) produces
- Encoding: , with often being elementwise nonlinearity like ReLU or identity (if using regularization separately).
- Decoding: , aiming for .
The loss function typically is:
where is a sparsity-inducing penalty on each code activation (such as , or a KL divergence to enforce being zero most of the time). By adjusting , one controls the trade-off between reconstruction fidelity and sparsity of . A common choice is (L1 penalty) or forcing the distribution of to have a low average activation (close to some small ). There are also k-sparse autoencoders that explicitly constrain to have at most nonzero entries per input.
The result is that each hidden dimension (feature) captures a recurring pattern in the inputs, and because of sparsity, each pattern is used in relatively few contexts – ideally corresponding to a semantic concept. Cunningham et al. (2023) applied SAEs to GPT-2 and found that “sparse autoencoders produce interpretable features that are effectively invisible in the neuron basis” (Towards Monosemanticity - Strikingloo) ([2309.08600] Sparse Autoencoders Find Highly Interpretable Features in Language Models). These features were monosemantic to a greater degree, meaning a single feature might detect “the presence of a specific name” or “the end of a sentence,” whereas any single neuron was entangled (polysemantic). The learned features can be examined by looking at which dataset examples strongly activate them or by projecting them into token space (via or ). In transformers, SAEs have been applied to various activation tensors:
- MLP layer outputs (to find features hidden in superposition among neurons).
- Attention patterns or outputs (to find sparse factors explaining attention heads’ behaviors (Circuit Tracing: Revealing Computational Graphs in Language Models)).
- Residual stream vectors (combining both attention and MLP contributions at a position).
Use-case: SAEs are used for discovering hidden features without supervision. In a model like LLaMA, one could take all residual stream activations at a certain layer (across many text inputs) and train an SAE to find basis features. The resulting features might correspond to grammar constructs, topics, factual attributes, etc. Researchers then interpret and validate these features. For example, the SAE might find a feature that activates on sentences about geographical locations; we can verify this by checking the top activated examples or by seeing that this feature, when ablated, causes the model to lose some geographic knowledge. In the IOI (Indirect Object Identification) task from Wang et al. (2022), SAEs helped pinpoint specific features that carry the necessary information to resolve pronoun reference ([2309.08600] Sparse Autoencoders Find Highly Interpretable Features in Language Models). Generally, SAEs address the problem of neurons being a non-orthogonal basis for the network’s internal representations – by switching to a sparsified overcomplete basis, interpretability improves.
References: Key references include the Anthropic papers “Towards Monosemanticity” and “Sparse Autoencoders Find Highly Interpretable Features in Language Models” ([2309.08600] Sparse Autoencoders Find Highly Interpretable Features in Language Models) ([2309.08600] Sparse Autoencoders Find Highly Interpretable Features in Language Models), which demonstrate the efficacy of SAEs on models up to 70B parameters. These works measure feature interpretability via automated metrics (like how well a single feature’s activation correlates with a human-labeled concept) and find large improvements over neuron-level interpretation. SAEs are inspired by classic sparse coding in neuroscience (An Intuitive Explanation of Sparse Autoencoders for Mechanistic Interpretability of LLMs — LessWrong) (An Intuitive Explanation of Sparse Autoencoders for Mechanistic Interpretability of LLMs — LessWrong) and have become a foundational tool for mechanistic interpretability (they are often the first step in building more elaborate interpretability analyses, such as the transcoders in Circuit Tracing which are a refined variant of SAEs).
Transcoders (Per-Layer or Weights-Based Circuit Analysis)
We already introduced transcoders as used in Circuit Tracing, but they deserve mention as a general technique. The original formulation by Dunefsky, Chlenski, and Nanda (2024) is weights-based rather than per-prompt ([2406.11944] Transcoders Find Interpretable LLM Feature Circuits). A per-layer transcoder is trained similarly to an SAE but with the specific goal of linearizing the action of an MLP layer. For one transformer layer’s MLP (viewed as including the GeLU and output projection), a transcoder constructs an approximating function using a wide sparse layer: , with some nonlinearity. Training to minimize over a distribution of (drawn from actual model activations) yields a faithful approximation ([2406.11944] Transcoders Find Interpretable LLM Feature Circuits). The important twist is that is chosen to encourage binary-like sparse activations (e.g. a steep sigmoidal or threshold function, such as JumpReLU). This way, each transcoder “neuron” either fires (essentially taking on responsibility for part of the MLP’s output on that input) or stays inactive. In the ideal limit, a transcoder unit might either exactly imitate one original neuron (if the original neuron was monosemantic) or split an original neuron’s behavior into two units (if that neuron was polysemantic).
Dunefsky et al. further showed that by analyzing the weights of a transcoder, one can perform circuit analysis in weight space ([2406.11944] Transcoders Find Interpretable LLM Feature Circuits). Since each transcoder feature has an encoder vector in the input space and a decoder vector in the output space, the outer product roughly represents a rank-1 component of the MLP’s overall weight matrix. The collection of all active features on some input provides a decomposition of the MLP’s transformation into a sum of sparse, interpretable pieces. If feature is active for input , it means the pattern was recognized, contributing to the output. Thus, one can interpret as detecting a concept and as the effect of that concept on the next-layer residual. By tracing connections between features of successive layers, a feature-level circuit can be assembled that mirrors the network’s computation.
In practice, transcoders have been applied to identify circuits like the greater-than circuit in GPT-2 (which determines when one number is larger than another) ([2406.11944] Transcoders Find Interpretable LLM Feature Circuits). They found that the circuit cleanly factorized into input-dependent terms (specific comparisons) and input-independent terms (general thresholds), which is an insight that wasn’t obvious from neuron-centric analysis ([2406.11944] Transcoders Find Interpretable LLM Feature Circuits) ([2406.11944] Transcoders Find Interpretable LLM Feature Circuits). Transcoders can be seen as bridging the gap between connection weight interpretation and activation interpretation: they yield pseudo-weight matrices ( terms) that are sparse and meaningful.
Use-case: For a model like LLaMA, one might train transcoders for the first few MLP layers to break down their behavior. Suppose layer 3 of LLaMA has a neuron that seems to entangle two concepts (“animal” vs “country”). A transcoder with sufficiently many units could split this into two features: one that triggers on animal-related contexts and one on country-related contexts, each then independently contributing to layer 4. By examining those features, we might discover that the model actually has a mechanism to handle these concepts separately, even though the original basis (neurons) obscured it. Furthermore, transcoders allow global circuit discovery: rather than analyzing a single input, one can analyze which features (and combination of features across layers) are responsible for a capability across many inputs. Dunefsky et al. define “feature circuits” as sets of features connected across layers that realize an algorithm (Transcoders Find Interpretable LLM Feature Circuits - arXiv) (Transcoders find interpretable LLM feature circuits | OpenReview).
References: “Transcoders Find Interpretable LLM Feature Circuits” (NeurIPS 2024) by Dunefsky, Chlenski, and Nanda is the seminal work ([2406.11944] Transcoders Find Interpretable LLM Feature Circuits) ([2406.11944] Transcoders Find Interpretable LLM Feature Circuits). It builds on earlier dictionary learning approaches and demonstrates transcoders on GPT-2 and smaller models, comparing them to SAEs. Another related idea is “cross-coders” (Ge et al., 2023) which similarly aim to find cross-layer sparse features (Circuit Tracing: Revealing Computational Graphs in Language Models). These methods are part of a trend to use learned interpretability tools that directly interface with a model’s weights, as opposed to treating the model as a black box for interventions. By providing an alternate parameterization of a subset of the model (like one MLP matrix) that is more transparent, we get a new window into the model’s algorithms.
Activation Patching (Causal Tracing in Activation Space)
Activation patching is an empirical technique to localize where in a network certain information is stored or computed (Attribution Patching: Activation Patching At Industrial Scale — Neel Nanda) (Attribution Patching: Activation Patching At Industrial Scale — Neel Nanda). The core idea is to take two scenarios (inputs) that lead to different model outputs and then exchange intermediate activations between these runs to see which exchange causes the output difference to flip. This is effectively performing in-silico causal interventions on the computation.
For example, suppose we have two prompts for a language model: A = “The Eiffel Tower is located in Paris.” and B = “The Eiffel Tower is located in Rome.” Prompt A elicits the correct fact (“Paris”) and B an incorrect completion (“Rome”). To find where the model decides this fact, we run the model on both A and B and record all activations. Then, layer by layer (or component by component), we replace B’s activation with A’s activation and see if the output becomes “Paris.” If patching at layer is sufficient to switch the output, it means the information distinguishing Paris vs. Rome was present by layer . This method was described by Vig et al. (2020) in analyzing BERT as causal mediation analysis for attention heads (Advanced Interpretability Techniques for Tracing LLM Activations …), and later by Meng et al. (2022) in GPT knowledge tracing (Causal Tracing (ROME) — pyvene 0.1.2 documentation). Neel Nanda provides a clear description: “by patching in specific activations from the clean run to the corrupted run, we find which activations are sufficient to flip the model output… If a single activation is sufficient to change the entire model output, that’s strong evidence it matters!” (Attribution Patching: Activation Patching At Industrial Scale — Neel Nanda).
Mathematically, one can formalize activation patching as an intervention operator. Let be the hidden state at layer when processing input A. Define a function as “the remainder of the network from layer to output, given hidden state at layer .” Patching layer means we compute the output but within the context of run B’s forward pass. Equivalently, where are the layer transformations, and we used A’s activation at layer and B’s everywhere before that. We then compare to the original outputs and . We can quantify the effect as a logit difference restoration: e.g. does the logit (or probability) of “Paris” in match that in ? A metric called causal effect or influence can be defined as
where is some distance measure like KL divergence or just difference in the probability of the correct token. If is high, patching at layer brings the output closer to A, meaning layer contained crucial info.
Granularity: Activation patching can be done at different granularities: entire layer outputs, attention head outputs, MLP neuron activations, even individual feature subspaces (How to use and interpret activation patching) (How to use and interpret activation patching). Coarse patching (e.g. replacing the whole residual stream) localizes which layer is important for a behavior. Fine patching (e.g. one neuron at a time) can pinpoint which specific unit or subcomponent is carrying the info. For instance, one can patch only a single attention head’s output from A into B – if that restores the answer, that head was a key part of the circuit (How to use and interpret activation patching).
Path Patching: A more advanced variant, as mentioned, is to patch along specific paths. Normally, if you patch a component at layer , it will influence all downstream components. But suppose you have a hypothesis that “Head 5 in layer 3 influences neuron 10 in layer 4 which decides the output.” To test this narrowly, you could try to isolate the path: patch Head 5’s output only into neuron 10’s input, leaving other inputs to layer4 as in run B. Techniques to do this involve setting all other inputs from run A to some neutral baseline for other pathways. This path patching gives evidence for specific links in a circuit hypothesis (How to use and interpret activation patching). It’s commonly used in causal scrubbing (discussed later) to rigorously test hypothesized circuits.
Use-case: Activation patching has been instrumental in many discoveries. In the GPT-2 induction heads analysis (Olsson et al., 2022), researchers took a prompt pair where the model continues a list vs. fails to, and by patching, they found that certain early-layer attention heads were responsible for copying tokens that enabled induction. In knowledge editing, as noted, patching revealed that factual info for “Eiffel Tower -> Paris” was primarily contained in one middle MLP layer’s activation (But is it really in Rome? An investigation of the ROME model editing …). For a model like LLaMA, one might use activation patching to find where a specific trait (say, the model’s politeness vs. toxicity in response) is determined: feed a polite prompt and a toxic prompt, then patch hidden states to locate where the difference in tone originates. This could highlight a cluster of neurons or an attention head that controls tone.
References: Apart from the above-cited, a comprehensive reference is “Towards Best Practices in Activation Patching” by Zhang & Nanda (ICLR 2024) (Towards Best Practices of Activation Patching in Language Models: Metrics and Methods | OpenReview) (Towards Best Practices of Activation Patching in Language Models: Metrics and Methods | OpenReview), which systematically studies how different choices in patching (metrics, corruption method, etc.) affect results. It notes that activation patching is also known as causal tracing or interchange interventions (Towards Best Practices of Activation Patching in Language Models: Metrics and Methods | OpenReview). Additionally, Nanda’s blog “Attribution Patching” provides an accessible description and improvements to scale patching (Attribution Patching: Activation Patching At Industrial Scale — Neel Nanda) (Attribution Patching: Activation Patching At Industrial Scale — Neel Nanda).
Attribution Patching (Gradient-Based Approximation)
While activation patching is powerful, it can be computationally expensive – one needs to run a forward pass for each component patched. Attribution patching is a technique introduced by Nanda (2023) to approximate the effect of patching many components at once using gradient information (Attribution Patching: Activation Patching At Industrial Scale — Neel Nanda). It treats the effect of an activation swap as a first-order perturbation, effectively linearizing the network’s response around the destination run.
The intuition: if replacing with causes the output to change, then by Taylor expansion
where the RHS is a dot product (or tensor contraction) of the output gradient at layer with the difference in activations. Attribution patching computes this attribution score for each candidate component in one backward pass. Concretely, one does a normal forward for A and B to get all and . Then define an objective measuring output difference (for instance, so that is zero for B and some positive value for A’s correct answer). Then compute the gradient for each intermediate activation . The attribution patch score for component at layer is (Attribution Patching: Activation Patching At Industrial Scale — Neel Nanda) (Attribution Patching: Activation Patching At Industrial Scale — Neel Nanda). This score is basically how much increasing that component from its B-value toward its A-value would increase , in the linear approximation. A large positive suggests that patching that component would have a big effect on making the output more like A.
Using two forward passes (for A and B) and one backward pass, one can estimate the causal effects of all individual components at once (Attribution Patching: Activation Patching At Industrial Scale — Neel Nanda) (Attribution Patching: Activation Patching At Industrial Scale — Neel Nanda). The top- scores highlight which activations are likely most important. These can then be tested with actual patching or guide a focused search. Attribution patching thus “industrializes” activation patching by providing a fast heuristic to scan many activations (Attribution Patching: Activation Patching At Industrial Scale — Neel Nanda) (Attribution Patching: Activation Patching At Industrial Scale — Neel Nanda). It’s analogous to how integrated gradients attribute output importance across input features – here we attribute across hidden units between two scenarios.
Use-case: Attribution patching is useful for initial exploration on very large models where exhaustive patching is infeasible. For example, if one wanted to find which neurons in GPT-4 are responsible for it answering a certain trivia question correctly vs. incorrectly, one could use attribution patching between a correct prompt and a corrupted prompt to rank neurons by influence. Nanda found this method works well for “small” activations (e.g. single head outputs or single neuron outputs) but less so for huge vectors like whole residual streams (Attribution Patching: Activation Patching At Industrial Scale — Neel Nanda). In practice, one might first apply attribution patching at the head or neuron granularity to get candidates, then verify those with actual activation patching. It provides a hypothesis generation step that is much faster. The trade-off is that it is an approximation and can miss non-linear interactions (e.g. if two neurons need to be jointly patched, gradient linearization might undervalue them).
References: Nanda’s write-up “Attribution Patching: Activation Patching at Industrial Scale” (Attribution Patching: Activation Patching At Industrial Scale — Neel Nanda) is the primary source. He emphasizes that attribution patching is a heuristic: it doesn’t replace true causal intervention but is a guide to focus attention. Nonetheless, it successfully identified important neurons and heads in GPT-2 in a fraction of the time of exhaustive methods (Attribution Patching: Activation Patching At Industrial Scale — Neel Nanda). This technique builds on ideas from influence functions and Jacobian-based attribution common in interpretability.
Logit Lens (Direct Logit Projections at Each Layer)
The logit lens is a straightforward but illuminating interpretability tool: at each layer of a transformer, apply the final output layer (the linear classifier or unembedding matrix) to the residual stream to see what the model “believes” at that point in computation (Unlocking Visual Insights: Applying the ‘Logit Lens’ to Image Data with Vision Transformers ! | by Achraff Adjileye | Medium) (Unlocking Visual Insights: Applying the ‘Logit Lens’ to Image Data with Vision Transformers ! | by Achraff Adjileye | Medium). In other words, take the hidden state after layers, , and compute where is the unembedding matrix (dimensions ). Then examine the top predicted tokens from the softmax of . This gives a prediction trajectory from the input layer up to the final layer (Unlocking Visual Insights: Applying the ‘Logit Lens’ to Image Data with Vision Transformers ! | by Achraff Adjileye | Medium). Surprisingly, even early in a model, some tokens may be much more likely than others, indicating partial information. As one goes deeper, the distribution typically sharpens around the correct answer if the model is confidently converging to a decision.
Mathematically, let . The logit lens hypothesis is that moves monotonically closer to the final output distribution as increases – if the model is refining its guess. Often one finds that by halfway through the model, the top few choices are already sensible, even if the final answer isn’t decided until later. This can help identify at what depth certain disambiguations happen. For instance, in GPT-2, if you prompt “The capital of France is [MASK]”, by layer 10 perhaps “Paris” is already among the top predictions, but by layer 24 it might become the clear winner.
Tuned lens: A known issue is that applying the raw unembedding to earlier layers can yield nonsense distributions for very early layers (because was trained to work well with final-layer representations, not earlier ones). The tuned lens (Bau et al., 2022) is an improvement where small calibration networks are trained to map to the vocabulary space more accurately ([PDF] Eliciting Latent Predictions from Transformers with the Tuned Lens). Essentially, one fine-tunes a set of linear maps such that (the final logits), using the model’s own data. This yields more interpretable intermediate distributions. Even without tuning, however, the vanilla logit lens often gives insight.
Use-case: The logit lens is useful for understanding stage-wise processing. In a transformer solving a multi-step math problem, the logit lens might show that after a certain layer, the model “believes” the answer is one of a few possibilities (perhaps it has performed some arithmetic by then), and in later layers it narrows it down. If using LLaMA on a prompt with an ambiguous context, one might see the logit lens output bifurcate then resolve once a specific clue is read. Researchers have used logit lens to detect when a model has effectively memorized something by an early layer versus when it genuinely computes it by the end. Also, it helps debug cases of hallucination: if by the penultimate layer the model’s logits are already skewed to a wrong answer, it indicates the mistake happened earlier (and one can combine this with patching to find where).
References: The term “logit lens” was popularized by a blog post “Interpreting GPT: the logit lens” by nostalgebraist (2020) (Unlocking Visual Insights: Applying the ‘Logit Lens’ to Image Data with Vision Transformers ! | by Achraff Adjileye | Medium) (Unlocking Visual Insights: Applying the ‘Logit Lens’ to Image Data with Vision Transformers ! | by Achraff Adjileye | Medium). There, the author demonstrates that GPT-2’s intermediate predictions are often coherent and that the model seems to do a kind of iterative elimination of possibilities (a “vertical” learning process where each layer refines the guess) (Unlocking Visual Insights: Applying the ‘Logit Lens’ to Image Data with Vision Transformers ! | by Achraff Adjileye | Medium). Gears-Level Interpretability discussions also highlight the logit lens as a simple probe of what information has been solidified vs. what remains uncertain (Gears-Level Mental Models of Transformer Interpretability) (transformer_lens.ActivationCache - TransformerLens Documentation). More recently, “Tuned Lens” by Bau et al. (2022) ([PDF] Eliciting Latent Predictions from Transformers with the Tuned Lens) provides a formal study, and “Logit Prism” by Mabardi et al. (2023) extends the idea by decomposing logits by source components (Logit Prisms: Decomposing Transformer Outputs for Mechanistic …).
Feature Visualization (Activation Maximization)
Feature visualization involves synthesizing inputs that strongly activate a particular neuron or feature, in order to reveal what that unit is looking for ([PDF] Visualizing and Understanding Convolutional Networks). This technique was first developed in computer vision (e.g. for CNNs) where one can gradient-ascent in pixel space to maximize a neuron’s output ([PDF] Visualizing and Understanding Convolutional Networks). In language models, direct optimization in the discrete input space is non-differentiable. However, there are a few approaches:
- Optimization in embedding space: Instead of characters or tokens, optimize a continuous embedding vector or a sequence of embedding vectors to maximize an internal unit’s activation. One can then decode these embeddings to the nearest tokens or inspect them. For example, to visualize a neuron in layer 5, we can start with a random input embedding and do gradient ascent on (the neuron of interest) plus some regularizer (to keep the embedding from going out-of-distribution). This might yield an embedding that corresponds to a mix of tokens. Often, the nearest neighbor tokens or a weighted distribution over tokens can be examined. Softmax relaxation is another trick: treat the input as a distribution over tokens (soft one-hot) and optimize that continuous distribution (with gradients flowing through an embedding lookup).
- Dataset-driven visualization: Another approach is to simply feed a large corpus through the model and record which input phrases highly activate the neuron/feature. Then find a pattern among the top- triggers. For example, if a neuron is always highest when the text contains an email address format, that’s a clue. This is effectively how one would label a feature by examples, as the Anthropic blog did (they showed example phrases for each feature) (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). Automated clustering of top activations can help identify multiple themes if the neuron is polysemantic.
- Transformer-specific methods: One can also utilize the model’s own output to guide visualization. For instance, Ernie & Bing (2022) leveraged GPT models to generate sentences that contain a given concept and see if that activates the neuron, or used combinatorial prompts (e.g. varying one word) to map out its triggers.
The result of feature visualization might be a textual description or a set of keywords that summarize the neuron’s role. In some cases, people have built tools (e.g. OpenAI’s Microscope) to browse neurons by their top activating texts.
Mathematically, a simplified formulation for single-token optimization: we seek a one-hot input vector that maximizes . This is (if we consider a linear mapping as first approximation), which is achieved by picking the token with largest weight. In deeper non-linear cases, it’s where is the embedding+forward to that layer. With relaxation, one solves where is a probability distribution over (vocab) and is a regularizer encouraging to be sparse or not too far from uniform to avoid adversarial off-distribution results. This optimization might be done via gradient ascent or evolutionary algorithms.
Use-case: Feature visualization is particularly useful to interpret SAE or transcoder features, which may not correspond to single tokens but to broader concepts. For example, in Scaling Monosemanticity, the team visualized a feature and found it corresponds to “digital electronics” because the top tokens included “digitize”, “digital”, and related terms (Circuit Tracing: Revealing Computational Graphs in Language Models). This confirms the feature’s semantic cohesion. For a transformer like LLaMA, one could pick an interesting neuron (say one identified via patching to be important for some behavior) and visualize it to get a clue: does it fire on harmful language? on quotes? on specific names? This helps build hypotheses about what algorithm the model is implementing. In vision-language models or multimodal transformers, feature visualization could even produce actual images (via optimization in pixel space) to see what a cross-modal neuron attends to.
References: Olah et al.’s Distill articles (2017) on Feature Visualization are canonical in vision. For language, the techniques are discussed in “Multimodal neurons in CLIP” (Goh et al., 2021) where they visualize neurons responding to concepts like “Spider-Man” by generating images. In language-only models, tools like Neuroscope (OpenAI 2020) and Anthropic’s interpretability pipeline have been used to find and label neurons automatically, often by searching for outlier activations and correlating with human-defined concepts. Scaling Monosemanticity (ICML 2023) by Nelsson et al. includes many examples of automatically labeled features in a large LM, using both learned probes and manual verification (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). Those labels often come from feature visualization pipelines.
Polysemanticity Analysis and Superposition
Polysemanticity refers to neurons or features that respond to multiple unrelated concepts (An Intuitive Explanation of Sparse Autoencoders for Mechanistic Interpretability of LLMs — LessWrong) (An Intuitive Explanation of Sparse Autoencoders for Mechanistic Interpretability of LLMs — LessWrong). Understanding and quantifying polysemanticity is crucial because a highly polysemantic unit is hard to interpret (it “means” several things). Superposition is the hypothesized reason: the model has more features it needs to represent than available neurons, so it “superposes” several features into different directions within a neuron’s weight vector ([2309.08600] Sparse Autoencoders Find Highly Interpretable Features in Language Models). The field has developed ways to analyze polysemanticity:
- Dataset clustering method: Take all occurrences where a neuron’s activation is high. Cluster those contexts by semantic similarity (or by another neuron’s values). If the clusters correspond to distinct themes, the neuron is polysemantic. For example, one might find Neuron 123 in GPT-2 fires either on French text or on lines of computer code (two separate clusters). This indicates two different features share that neuron (An Intuitive Explanation of Sparse Autoencoders for Mechanistic Interpretability of LLMs — LessWrong).
- Intervention tests for necessity: One can test each hypothesized feature individually. If you ablate the neuron in contexts of feature A and see an effect, and also in contexts of feature B and see an effect, then the neuron was involved in both – evidence of polysemanticity. However, if an independent sparse feature basis is available (from SAEs), one can directly see that two sparse features both have nonzero projections onto the same neuron.
- Subspace projection: Sometimes a neuron’s activity can be decomposed into orthogonal components that correlate with different concepts. E.g., use SVD/PCA on the neuron’s input-weight matrix or on its activation patterns. If two principal components correspond to distinct triggers, that reveals internal polysemantic structure. Toy models of superposition (Elhage et al. 2022) formalize how multiple features can inhabit one neuron dimension and how they can be recovered by analytic methods (An Intuitive Explanation of Sparse Autoencoders for Mechanistic Interpretability of LLMs — LessWrong).
Anthropic’s Monosemanticity work introduced metrics like the Polysemanticity score, which is essentially how many distinct semantics a feature has. One automated metric was the Interpretable Concept Overlap – measuring if the top- activating dataset chunks for a neuron can be explained by one vs. multiple concepts. If multiple, it’s polysemantic (score 0 on monosemanticity); if one clear concept covers them, it’s monosemantic (score 1) (Towards Monosemanticity - Strikingloo) (EIS XIII: Reflections on Anthropic’s SAE Research Circa May 2024).
Use-case: Analyzing polysemanticity helps decide whether to apply methods like SAEs. For instance, if a particular layer has many polysemantic neurons, that layer likely represents many features in superposition. We might then focus interpretability efforts there, using SAEs or transcoders to disentangle them. It also matters for safety: a polysemantic neuron might unintentionally activate for a harmful input (triggering one of its meanings) even if it usually meant something innocuous. Understanding that a neuron has a secondary role can warn us of such failure modes.
In LLaMA or GPT-3, polysemantic neurons are common due to the vast range of knowledge encoded. For example, a neuron might fire for “virus” in the context of biology papers and also for “virus” in the context of computer security – two meanings. Polysemanticity analysis would note this and ideally find separate features (via an SAE) that correspond to the distinct senses.
References: Chris Olah’s Circuits thread extensively discusses polysemanticity, especially in “A Mathematical Framework for Transformer Circuits” and “Toy Models of Superposition”. In those, they give theoretical examples of how two random features can overlap in one neuron and how one might recover them with techniques like sparse coding (An Intuitive Explanation of Sparse Autoencoders for Mechanistic Interpretability of LLMs — LessWrong). The Anthropic SAE paper also explicitly links superposition to polysemantic neurons and demonstrates that by increasing model size (or using more dimensions in an autoencoder), features become more monosemantic (Extracting Interpretable Features from Claude 3 Sonnet) (Towards Monosemanticity - Strikingloo). Stephen Casper’s commentary (EIS XIII: Reflections on Anthropic’s SAE Research Circa May 2024) additionally critiques how polysemanticity complicates using these features for safety – since you can’t cleanly remove one concept without affecting another if they share neurons.
Causal Scrubbing (Circuit Verification via Abstraction)
While not listed explicitly, it’s worth briefly mentioning Causal Scrubbing, a recent method for rigorously testing whether a hypothesized circuit explains a model’s behavior. Developed by Chan et al. (2023), causal scrubbing uses a causal abstraction framework: you map the model’s internal nodes to variables in a human-understandable causal model, then intervene to check if intervening according to the abstract model’s equivalences preserves the model’s output (Causal Scrubbing: a method for rigorously testing interpretability …). In simpler terms, you propose “the model is computing function with subcomponents ” and then you scramble (randomize) everything except the parts corresponding to that hypothesized computation, to see if the output stays the same. If it does, the hypothesis is validated; if not, the hypothesis is incomplete.
Causal scrubbing involves systematically patching sets of activations. For example, if you think a certain set of heads encodes a certain piece of info, you randomize all other heads across runs such that only those heads share information between the clean and corrupted inputs. This isolates the path of interest. Path patching as described earlier is a building block for causal scrubbing. The end result is usually a score of how well the hypothesized circuit can reproduce the original behavior when all other pathways are “scrubbed” (randomized). A perfect score means the circuit is sufficient.
Use-case: After using attribution and patching to guess a circuit, one can apply causal scrubbing to validate it formally. This was done in the IOI task where they proposed a circuit for how GPT-2 does pronoun resolution and then scrubbed to verify that circuit accounts for GPT-2’s behavior (Causal Scrubbing: a method for rigorously testing interpretability …). For mechanistic interpretability research, causal scrubbing is a key method to turn speculative circuit diagrams into experimentally supported ones.
References: “Causal Scrubbing: Rigorous Testing of Mechanistic Hypotheses” on Alignment Forum (2023) is the main reference. It demonstrates the approach on small models. While powerful, it can be combinatorially expensive for large models, so it works in tandem with methods like those above to simplify and target specific circuits.
Each of these methods contributes to a growing methodological toolkit for reverse-engineering transformer networks. In summary, we use tools like SAEs and transcoders to discover interpretable components; activation and path patching to identify causal roles of those components; attribution graphs and logit lenses to visualize computation flow; and techniques like causal scrubbing to validate our interpretations. By applying these in model-agnostic ways (nothing in the math above is specific to LLaMA vs. GPT-3, etc.), researchers aim to build a coherent understanding of any transformer’s internal algorithms – from smaller models to frontier ones (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). This combination of theory (e.g. linear approximations, sparsity, causal graphs) and empirical probing forms the backbone of modern mechanistic interpretability research.
Sources: The descriptions above are based on the Anthropic Circuit Tracing blog (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models), Neel Nanda’s interpretability writings (Attribution Patching: Activation Patching At Industrial Scale — Neel Nanda) (Attribution Patching: Activation Patching At Industrial Scale — Neel Nanda), and various academic works in the field ([2309.08600] Sparse Autoencoders Find Highly Interpretable Features in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models), as cited throughout. Each technique’s original paper or post is referenced for further reading on implementation details and case studies.
Circuit Tracing Methodology: A Detailed Walkthrough
Introduction
Circuit Tracing is an interpretability method to uncover how a language model’s internal computations lead to specific outputs (Circuit Tracing: Revealing Computational Graphs in Language Models). The key idea is to replace certain complex components of the model (in this case, the multi-layer perceptrons or MLPs in each transformer layer) with a more interpretable replacement model that has been trained to approximate those components (Circuit Tracing: Revealing Computational Graphs in Language Models). This replacement model uses a set of learned features (akin to neurons, but optimized for interpretability) to reconstruct the MLP outputs. By running the language model on a given input prompt with the replacement model in place (and making some adjustments described below), we can trace how each feature activation contributes to others and ultimately to the model’s predicted output. The result is an attribution graph, a directed acyclic graph (DAG) depicting the sequence of computational steps (feature activations and their influences) that lead from the input to the output (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). Each node in this graph represents an active feature (or input/output), and each directed edge is weighted by a quantitative attribution of how much one node directly influences another in the linearized computation (Circuit Tracing: Revealing Computational Graphs in Language Models). The methodology involves several stages: (1) training an interpretable cross-layer transcoder (CLT) as the replacement model, (2) constructing a prompt-specific local replacement model that exactly reproduces the original model’s behavior on that prompt, (3) extracting a causal attribution graph from the local replacement model by computing feature-to-feature influence scores, and (4) validating parts of the graph via causal interventions in the original model (to test whether manipulating a feature causes the predicted changes) (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). We will walk through each of these stages and the corresponding sections of the methodology, providing rigorous mathematical descriptions and formalisms for each concept. Throughout, we assume a transformer-based language model with layers and focus on replacing its MLP sublayers with an interpretable feature-based model.
Building an Interpretable Replacement Model
This stage involves designing and training the cross-layer transcoder (CLT) that will serve as a stand-in for the model’s MLPs. The CLT provides a dictionary of features that aim to sparsely reconstruct the outputs of all the MLP layers in the transformer.
CLT Architecture
A cross-layer transcoder (CLT) is essentially a sparse autoencoder that operates across multiple transformer layers (Circuit Tracing: Revealing Computational Graphs in Language Models). It consists of a set of neurons called features that are organized into the same number of layers as the original model (except that if the transformer has an input embedding “layer 0” with no MLP, the CLT has no features for that layer) (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). Each feature is assigned to a specific layer (its “encoder layer”) and will be active (potentially) at that layer. Importantly, however, a feature in layer can influence all subsequent layers in the model via separate decoder weights for each target layer (Circuit Tracing: Revealing Computational Graphs in Language Models). In this way, features are cross-layer: they persist and have effects over multiple layers, instead of being tied to a single layer’s computation. This design reflects the hypothesis that a single coherent feature might be used or amplified over multiple transformer layers (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models) (in contrast to a per-layer approach where each layer’s features are independent).
Concretely, the CLT replaces each transformer layer’s MLP with the following mechanism:
- Encoding: At layer of the transformer, instead of the MLP, we have learned features. Let be the residual stream activation (the input to the MLP) at layer in the original model. Each CLT feature at layer computes an activation by applying a linear encoder to the residual stream followed by a sparsifying nonlinearity. In formula, for layer we have , where is the encoder weight matrix (of shape if features at layer ) and is the vector of feature activations at that layer (Circuit Tracing: Revealing Computational Graphs in Language Models). Here is a specific nonlinear activation function chosen to encourage sparse, high-magnitude activations (it is a variant of ReLU with a trainable threshold and a straight-through estimator for its gradient, promoting nearly-binary activations) (Circuit Tracing: Revealing Computational Graphs in Language Models). Intuitively, each feature at layer “reads” some direction in the residual stream and fires (activates) only when that direction’s projection exceeds a threshold.
- Decoding: Each feature in layer has multiple decoder vectors, one for each layer to which it can contribute. Denote by the decoder matrix mapping features at layer to the output of layer (this is typically a matrix). The CLT’s goal is to reconstruct the original transformer’s MLP output at each layer using the feature activations from all earlier layers. Formally, let be the original model’s MLP output at layer (a vector in the residual stream). The CLT produces a reconstructed output given by summing contributions from all features in layers through that write to layer (Circuit Tracing: Revealing Computational Graphs in Language Models): Equivalently, each feature in a layer contributes to the residual stream at layer , and all such contributions are summed. Note that a feature only contributes to layers at or after its own layer (no feature feeds back to earlier layers) (Circuit Tracing: Revealing Computational Graphs in Language Models). This feedforward (forward-in-time) structure ensures that if we consider a directed graph of feature influences, it will be acyclic (a feature at layer can only affect features in layers ).
- Joint Training: All CLT features across all layers are trained together to minimize two objectives: (1) a reconstruction loss to ensure the CLT accurately reproduces the original MLP outputs, and (2) a sparsity penalty to encourage that only a small fraction of features activate on any given input (making the computation easier to interpret). The reconstruction loss is typically mean-squared error (MSE) between the CLT’s output and the true MLP output, summed over all layers: . The sparsity penalty is designed to approximate an constraint (penalizing a feature’s activation whenever it is nonzero) in a differentiable way. One approach used is to penalize the product of a feature’s activation magnitude and the norm of its decoder weights (Circuit Tracing: Revealing Computational Graphs in Language Models). For example, the loss can include a term: where denotes the concatenation of all decoder vectors for feature in layer (so is a measure of how strongly feature is used in any layer), and are hyperparameters (Circuit Tracing: Revealing Computational Graphs in Language Models). This penalty is low (near 0) when either the feature’s activation is zero or when its decoder vectors are zero (meaning it doesn’t contribute anywhere), and increases when a feature is both active and has significant downstream influence. By adjusting these hyperparameters, one finds a trade-off between reconstruction accuracy and sparsity of the solution. In practice, the CLT is trained on many examples (e.g. a mixture of prompts) to broadly approximate the MLP behavior; larger CLTs (with more total features) achieve better reconstruction but are harder to interpret, so one seeks a size that balances these aspects (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models).
Interpretation: Each CLT feature can be thought of as a learned “concept” or “aggregate neuron” that captures some recurring pattern in the transformer’s residual stream. The feature’s encoder picks out when that pattern is present, and its decoders describe how that feature, when present, will add to various future layers’ MLP outputs. Because features from early layers can contribute to very late layers, the CLT can capture long-range effects: for example, if the original model’s layer 2 MLP and layer 5 MLP cooperatively amplify the same semantic signal, the CLT might use a single layer-2 feature that has strong decoder weights to both layer 2 and layer 5, instead of treating it as two separate unrelated features. This cross-layer superposition was a motivation for the CLT design (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models), and indeed the authors found evidence of such phenomena (the CLT leads to shorter effective computation chains than a per-layer decomposition, see Attribution Graph Evaluation below). The nonlinearity (JumpReLU) ensures that features are mostly inactive (0) except on the inputs where they are truly needed, making them easier to interpret (a feature’s meaning can be deduced by looking at the few inputs where it activates strongly).
From Transcoder to Replacement Model
Once the CLT is trained, we can use it to create a replacement model that mirrors the original transformer’s forward pass but with MLPs replaced by the CLT. In a forward pass of the replacement model, whenever we reach an MLP layer in the original model, we substitute it with the CLT computation of that layer: we encode features from the residual , then decode their contributions to reconstruct . In practice, this is implemented in two steps (Circuit Tracing: Revealing Computational Graphs in Language Models):
- Feature activation: At the input to layer ’s MLP (i.e. after the attention sublayer), compute all CLT feature activations for that layer (Circuit Tracing: Revealing Computational Graphs in Language Models).
- Output reconstruction: Instead of applying the actual MLP, overwrite the MLP’s output with (summing contributions from features in layer and all earlier layers) (Circuit Tracing: Revealing Computational Graphs in Language Models). In other words, replace by in the residual stream.
All other parts of the transformer (the attention mechanisms, residual skip connections, layer norm, etc.) remain the same as in the original model (Circuit Tracing: Revealing Computational Graphs in Language Models). The attention heads still operate on the residual stream, but note that the residual stream now contains CLT contributions instead of the original MLP outputs. Attention is not “frozen” at this stage; the replacement model simply runs normally except that whenever an MLP would have been computed, we use the CLT’s reconstruction instead. This means the CLT can end up running on slightly different inputs than it saw in training: after the first layer, the residual stream has some reconstruction error, which could propagate. In essence, the replacement model uses the CLT in a closed-loop manner, whereas the CLT was trained open-loop (always on the true transformer activations). This can introduce compounding errors. Nevertheless, we can evaluate how well the replacement model tracks the original model’s outputs. Empirically, larger CLTs (with more features) do better. For example, in an 18-layer transformer tested, a CLT with ~10 million total features reproduced the original model’s top-1 next-token prediction 50% of the time on a test set of prompts (chosen to be non-trivial predictions), whereas much smaller CLTs or baselines like thresholding actual neurons performed significantly worse (Circuit Tracing: Revealing Computational Graphs in Language Models). This gives a sense that the replacement model, while not perfect, often mirrors the original model’s computation on many inputs.
The Local Replacement Model
Even with a large CLT, the replacement model can have non-negligible errors that grow deeper in the network (Circuit Tracing: Revealing Computational Graphs in Language Models). For the purposes of attribution on a specific prompt, the methodology introduces the local replacement model. The local replacement model is essentially the replacement model fine-tuned to a particular prompt so that it exactly matches the original model’s activations on that prompt (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). It does this by incorporating two key adjustments for the given prompt :
- Freezing attention and normalization: We take the attention patterns (the matrices of attention weights) and any layer normalization factors from the original model’s forward pass on prompt and fix them in the replacement model (Circuit Tracing: Revealing Computational Graphs in Language Models). That is, in the local model we do not recompute where each attention head attends – we reuse the same attention distribution as the original model had on this input. Similarly, if layer norm scales depend on the batch statistics or prior tokens, we use the values from the original model’s run. By doing this, we eliminate any discrepancy that might have arisen from the CLT’s altered residual affecting the model’s control flow (e.g. changing what an attention head attends to). Now, any difference between the replacement model and original will only come from the MLP computations, not from divergent attention patterns or norms.
- Error correction: We add a set of error adjustment terms at each layer and position to account for the CLT’s imperfection. Concretely, for each layer and each token position in the prompt, we compute the difference between the original model’s MLP output and the CLT’s reconstructed output when running the replacement model on . We then inject this difference as a fixed additive bias at that layer (and position) in the local model (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). In effect, we say: “Whatever the CLT produced, add the residual error so that the total equals the true MLP output for this prompt.” These bias terms ensure exact agreement with the original model on the prompt .
After making these adjustments, the local replacement model computes precisely the same activations and output logits as the original transformer on the specific prompt (Circuit Tracing: Revealing Computational Graphs in Language Models). We have essentially re-written the original model’s computation in a different basis: instead of using the original MLP neurons, we are using the CLT’s features (plus some fixed biases to handle what the CLT missed). All nonlinear components that could introduce approximation error (the MLP nonlinearity, attention re-weighting, etc.) have been “frozen” or corrected for that prompt. Thus, the local replacement model is a faithful replica of the original model in a neighborhood around the current activation pattern. The authors liken this to taking a first-order Taylor approximation of a function at a point – it matches the function’s value (and some derivatives) at that point exactly, though it may differ if you move far away (Circuit Tracing: Revealing Computational Graphs in Language Models). In other words, the local model and original model have the same local behavior (they agree on the current forward pass), but if you perturbed the input significantly, they might diverge (we’ll quantify this later).
Structure of the Local Model: With the local replacement model defined, we can consider what kind of computational graph it represents. It can be viewed as a very large fully connected neural network (mostly linear) that spans across all token positions and layers (Circuit Tracing: Revealing Computational Graphs in Language Models). Specifically:
- Inputs: The input to this network is the set of one-hot token embeddings for each position in the prompt (Circuit Tracing: Revealing Computational Graphs in Language Models). Think of concatenating all prompt token embeddings as one big input vector (or, equivalently, treat each token embedding as a separate input node).
- Neurons (hidden nodes): The hidden units of this network are the activations of CLT features at each layer and each position in the prompt (Circuit Tracing: Revealing Computational Graphs in Language Models). In other words, for each token position and each CLT feature in layer , we have a neuron representing the activation of that feature when the model is processing token . We also include error adjustment nodes (bias nodes) – one for each layer and position where an error term was added (Circuit Tracing: Revealing Computational Graphs in Language Models). These error nodes can be thought of as special neurons that always have activation 1 and a fixed outgoing weight equal to the error vector; they ensure the local model exactly matches the original.
- Outputs: The output layer of interest consists of the model’s logits (or probabilities) for the next token. In many cases we focus on one particular logit (e.g. the logit for a specific predicted word) or a small set of output token logits, rather than the entire distribution. The attribution graphs will typically include only the logits that had substantial probability (the top predicted tokens) (Circuit Tracing: Revealing Computational Graphs in Language Models).
- Connections (weights): Critically, all connections in this local model are effectively linear. The only nonlinearity remaining is the feature activation function (JumpReLU) which has been fixed by the current input – each feature is either active (acting like a linear unit with slope 1, since ReLU is linear in its active region) or inactive (slope 0) for this prompt. Thus, we can treat the network as linear for purposes of analyzing attributions, because we will not consider how things would change if a currently-inactive feature were activated (that would be a different linear region) (Circuit Tracing: Revealing Computational Graphs in Language Models). Each CLT feature at layer and position connects to (potentially) features at later layers or the output. The effective weight of connection from feature to feature (or to an output logit) is given by summing over all the linear paths between them through the residual stream and attention heads (Circuit Tracing: Revealing Computational Graphs in Language Models). But since attention patterns and normalization are fixed, these paths behave like fixed linear transformations. We can therefore compute a single equivalent weight matrix for the whole network. Intuitively, if feature at layer writes some vector into the residual stream, and that vector (possibly after being carried through attention output-value matrices) contributes to feature at layer , then there is a constant matrix mapping to the pre-activation of . By summing contributions of all such paths, we get an overall weight for the influence of on (Circuit Tracing: Revealing Computational Graphs in Language Models). Likewise, each input embedding has some weight into each feature, and each feature has some weight into the final logits. The error bias nodes have outgoing weights equal to the stored error they inject (and no incoming weights, since they are fixed biases). Because no nonlinear re-computation is done in the middle (we “froze” those), the impact of source feature on target is linear in (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). This justifies calling these weights “virtual weights” – they are not single physical parameters of the original model, but the sum of many linear contributions bundled together (Circuit Tracing: Revealing Computational Graphs in Language Models).
In summary, the local replacement model is a linearized version of the original model’s computation on a given prompt, expressed in terms of CLT features. It exactly replicates the forward pass (so it’s faithful for that input), and provides us with a giant directed network (mostly linear connections) that we can analyze using standard tools (like Jacobians, which in a linear network are just constant weights). This network is the substrate from which attribution graphs are extracted (Circuit Tracing: Revealing Computational Graphs in Language Models).
Attribution Graphs
Having constructed the local replacement model for a specific prompt, we now want to interpret it. The goal is to produce a causal graph of feature interactions that explains how the input features lead to the model’s output on this prompt (Circuit Tracing: Revealing Computational Graphs in Language Models). An attribution graph is essentially a pruned, human-interpretable representation of the local replacement model’s computations. Nodes in the graph represent active features (or special inputs/outputs), and edges represent direct causal influences of one node on another, with weights indicating the strength and sign of that influence (Circuit Tracing: Revealing Computational Graphs in Language Models). Crucially, because of the local model’s linearization, we can treat these influences additively and avoid the ambiguities of credit assignment in nonlinear networks (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models).
Nodes: Features, Inputs, Outputs, and Errors
The attribution graph contains four kinds of nodes (Circuit Tracing: Revealing Computational Graphs in Language Models):
- Primary input nodes: These correspond to the token embeddings of the prompt. Each prompt token (at each context position) is represented by a node that injects the embedding vector for that token into the model. Essentially, these nodes are the entry points of information. (Often in visualizations, they may be labeled by the token text itself for clarity, but formally they stand for the embedding vector.)
- Intermediate feature nodes: These are the CLT feature activations at various layers and positions that were active for this prompt. We include each feature that has a nonzero activation in the local model’s forward pass as a node. The node is usually labeled by an interpreted description of the feature (see below on how features are labeled), along with an indication of which layer and position it belongs to. These are the hidden computational nodes that do most of the work.
- Output nodes: These correspond to (a subset of) the model’s output logits for the next token prediction. Typically, we include one node for each of the top predicted tokens (until 95% of the probability mass is covered, up to a maximum of 10 tokens) (Circuit Tracing: Revealing Computational Graphs in Language Models). In many of the case studies, the model’s behavior is essentially about deciding one particular output token, so often a single output logit node (for the correct answer) is highlighted. The output node’s activation value can be thought of as the logit or log-odds for that token (or some transformed probability).
- Error nodes: For completeness, the graph also includes error nodes which account for the portion of each MLP output that the CLT did not explain (Circuit Tracing: Revealing Computational Graphs in Language Models). Recall we added bias terms equal to the CLT’s reconstruction error at each layer. In the graph, each such bias is represented as an “error node” feeding into the features of that layer (and also feeding into any downstream features and logits) (Circuit Tracing: Revealing Computational Graphs in Language Models). These can be seen as analogues of bias terms or unmodeled “dark matter” computation (Circuit Tracing: Revealing Computational Graphs in Language Models). If the CLT perfectly explained everything, these nodes would all be zero. In practice, they often carry some influence, but part of analysis is to check that critical paths are through non-error nodes (if important effects only come via error nodes, that means the CLT missed something important).
In summary, the graph starts with input token nodes at the bottom, flows through intermediate feature nodes layer by layer, and ends at output token logits at the top. Error nodes can be sprinkled in between as additional inputs into various layers.
Edges: Direct Influence and Linear Attribution
An edge from node to node in the attribution graph means that the activation of has a direct causal effect on the activation of in the local replacement model. Because the local model is (piecewise) linear, we quantify this effect by a linear attribution weight. Formally, if is the activation of source node and is the pre-activation (input to nonlinearity) of target node , then the weight is defined as the partial derivative of with respect to , holding fixed the contributions of all other nodes (we “stop-gradient” through any nonlinearities) (Circuit Tracing: Revealing Computational Graphs in Language Models). In a linear network, is an affine function of , so ; here is exactly that coefficient. The edge attribution is then defined as . This equals the actual contribution of node to the pre-activation of (since is linear, is how much of comes from ) (Circuit Tracing: Revealing Computational Graphs in Language Models). Equivalently, you can think of as the amount by which node ’s activation would change if we infinitesimally increase ’s activation by amount (since for small changes, and at the actual activation level , that linear change is ). This linear attribution simplifies in our case because ’s activation function is ReLU (or JumpReLU): for active features, ReLU’s derivative is 1, so (and for inactive features, anyway and we typically won’t have them as nodes). Therefore, also reflects how much contributes to (for active ).
To compute in practice, one can “backpropagate” through the linear parts of the network from to . The authors formalize this using a backward Jacobian with stops on nonlinearities (Circuit Tracing: Revealing Computational Graphs in Language Models). Let be the token position of source and the position of target . Let and be the layer indices of and (if is an input token embedding, we can consider ; if is an output logit, consider beyond the last layer). They define as the Jacobian of the original model’s forward pass from the residual stream at to the residual stream at , with the important modification that gradients are zeroed out whenever they would pass through a nonlinear component (Circuit Tracing: Revealing Computational Graphs in Language Models). “Stop gradient on nonlinearities” means: when computing this partial derivative, treat the transformer’s MLP activation functions as if they were linear functions (so effectively, the MLP becomes its weight matrix composition), treat attention weight computations as constants (so the attention output is linear in the input values), and similarly ignore layer norm’s dependency on inputs. In effect, is the Jacobian of the local replacement model itself (since that is exactly the original model with nonlinearities frozen). Now, using this, one can show that the weight from a source feature to a target feature can be expressed as (Circuit Tracing: Revealing Computational Graphs in Language Models):
In this formula, is the decoder vector (column) by which feature (at layer ) contributes to layer ’s residual, and is the encoder weight (row) by which feature (at layer ) reads from the residual at layer (Circuit Tracing: Revealing Computational Graphs in Language Models). The Jacobian connects the residual at layer to the residual at layer (through attention and skip connections) for the specific positions . Summing from up to accumulates all the paths that start from feature ’s output at some layer between and and end at the input of feature . In simpler terms: all linear paths from to are being added up. This is exactly the “virtual weight” we described in the local model. Then the edge attribution is as before (Circuit Tracing: Revealing Computational Graphs in Language Models).
For example, if is a feature and is the output logit for some token , then would equal , where is the embedding vector of token in the output (unembedding) layer. The edge in the graph would then have weight indicating how much raises or lowers the logit for . If is an input embedding and a feature, the edge weight formula simplifies to (Circuit Tracing: Revealing Computational Graphs in Language Models), i.e. the inner product of the input embedding and the feature’s encoder after transporting the embedding up to layer . Bias/error nodes similarly have outgoing edges equal to the error contribution they supply to each downstream node (with their “activation” being fixed at 1).
Directed Acyclic Graph: Because a feature in layer only connects to features in layer or higher (and typically mainly to later layers), these edges respect a partial order by layer. Furthermore, attention can connect features at earlier positions to later positions, but in an autoregressive language model, information flows from earlier tokens to later tokens (not vice versa) at inference time. Thus, the attribution graph is acyclic: one can topologically sort nodes by (layer, time step) and all edges go from lower to higher in that ordering. This is why we can talk about “upstream” vs “downstream” nodes unambiguously. The causal interpretation of an edge is that if we perturbed the source node’s activation slightly, the immediate linear effect on the target node would be given by the edge weight. If there is no path (no edge) from to , then has no direct linear influence on (though it could still influence via a chain of intermediate nodes).
Constructing the Graph
To build the attribution graph for a prompt, one follows these steps (which are conceptually similar to the method of Dunefsky et al. 2022 for single-layer sparse autoencoders, extended here to multiple layers (Circuit Tracing: Revealing Computational Graphs in Language Models)):
- Run the local replacement model on the prompt: Compute all feature activations for each feature , layer , and position in the prompt. Identify which features are active (significantly nonzero). These will form the intermediate nodes. Also record the input embeddings and the output logits of interest.
- Calculate edge weights: Using the formula above (or an equivalent efficient method), compute the linear coefficients for each pair of active nodes (including input and error nodes as potential sources and including output nodes as targets). In practice, one can do this by backpropagating from each target node to identify what inputs affect it. The authors mention computing these efficiently via backwards Jacobians and summing paths (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). Because the number of active features can be large (hundreds or thousands), there will be many possible connections.
- Form edges for significant attributions: Multiply by source activations to get . This is the actual contribution of to . We typically include an edge in the graph if is above some threshold or if it ranks highly among contributions to . Very tiny influences are pruned away to keep the graph readable (the authors indeed perform graph pruning using heuristics to drop weak edges) (Circuit Tracing: Revealing Computational Graphs in Language Models). We ensure the graph is directed: even though in a linear model one could in theory also compute how influences , we stick to the forward direction of computation (from input towards output).
- Group and label nodes for interpretability (optional): Often, many features have similar roles. The initial graph may be too “busy” to interpret directly (hundreds of nodes, tens of thousands of edges) (Circuit Tracing: Revealing Computational Graphs in Language Models). So, as an aid to understanding, the authors provide tools to group nodes into “supernodes” (explained below) and to label each feature with a human-interpretable description (Circuit Tracing: Revealing Computational Graphs in Language Models). These steps don’t change the underlying graph computation but simplify the presentation. We will discuss them shortly.
After these steps, we have an attribution graph that shows, for this one prompt, which features were active and how they passed information to each other and to the output. Importantly, the graph is local to that prompt. It is not a global circuit diagram for the model in general – other prompts might activate different features or connections. However, by studying many such graphs or particularly interesting ones, we can hypothesize general mechanisms.
Example (Acronym case study): The blog gives an example where the model is prompted with “The National Digital Analytics Group (N” and it outputs “DAG”. The attribution graph (simplified) shows three main chains of features, each starting from one of the words “Digital”, “Analytics”, “Group” (which start with D, A, G respectively) (Circuit Tracing: Revealing Computational Graphs in Language Models). Those features feed into higher-layer features described as “say D”, “say _A”, “say _G” (meaning features that cause the model to say the first letter of a word) (Circuit Tracing: Revealing Computational Graphs in Language Models), which then converge on a feature “say DAG” that directly boosts the output token “DAG”. Simultaneously, features recognizing that the text is “in an acronym context” contribute positively to outputting an acronym (Circuit Tracing: Revealing Computational Graphs in Language Models). Each arrow in that diagram corresponds to a positive edge $A{s\to t}$ between features. There are also direct edges from some early features straight to the output token (via attention heads) (Circuit Tracing: Revealing Computational Graphs in Language Models). This illustrative graph was obtained by the above process and then grouping similar features (all features that essentially detect “word begins with D” were grouped into one supernode for “Digital/D”) (Circuit Tracing: Revealing Computational Graphs in Language Models).
Learning from Attribution Graphs
In practice, a raw attribution graph can be extremely rich in information – often too rich. After pruning small edges, one might still have hundreds of nodes and tens of thousands of edges (Circuit Tracing: Revealing Computational Graphs in Language Models). To make sense of it, the authors used interactive visualization tools (Circuit Tracing: Revealing Computational Graphs in Language Models). This allowed them to trace specific pathways step by step: one can start from an output node of interest, see which features have the largest incoming edges to that node, click on one of those features to then see what its strongest inputs are, and so on backward toward the input. This is akin to following a chain of reasoning in the model. The interface also allowed them to filter or collapse certain parts of the graph (for instance, focusing on a subset of features or grouping features) (Circuit Tracing: Revealing Computational Graphs in Language Models).
Key tasks in interpreting a graph include: identifying which features or paths are most important for the output, understanding what each feature represents, and seeing how features compose. The linear nature of the graph means that if you sum up all incoming edge attributions to the output node, you should get the total logit (relative to baseline) – so the graph is a complete attribution of the output. One can quantify, for example, how much of the logit came from certain groups of features vs. others. It’s also useful for identifying surprising contributors: e.g., is there an edge from an unrelated token that nonetheless has a large weight? That could indicate an indirect effect or a spurious correlation. By interacting with the graph, an analyst can build a narrative of what the model appears to be doing internally to arrive at its answer.
Understanding and Labeling Features
A critical part of making attribution graphs intelligible is giving each feature node a semantic label or description. The CLT features are learned in an unsupervised way, so we don’t initially know what each one means. To label them, the authors employed techniques from feature visualization (Circuit Tracing: Revealing Computational Graphs in Language Models). For each feature, one can look at a set of text samples where that feature activates strongly. This is analogous to how one might interpret a neuron by looking at the top examples that fire it. Additionally, because we know each feature’s decoder vectors, we can see which output tokens it directly influences (for late-layer features) or which input embeddings activate it (for early features). By examining these, a human can guess the feature’s role.
They report that many features fall into recognizable categories:
- Input features: Often found in early layers, these respond to very specific tokens or a small set of related tokens (Circuit Tracing: Revealing Computational Graphs in Language Models). For example, a feature might fire whenever the word “digital” appears (regardless of context) – that would be labeled as a “digital” feature. Input features essentially detect the presence of certain words or character patterns.
- Output features: Often in later layers, these have a strong direct effect on a particular token or set of tokens being output (Circuit Tracing: Revealing Computational Graphs in Language Models). For example, a feature might directly increase the probability of the token “dag” whenever it’s active; such a feature is labeled “say ‘dag’” (Circuit Tracing: Revealing Computational Graphs in Language Models). Output features typically gather evidence from earlier in the prompt and, if active, push the model to produce a specific word or category of word.
- Functional features: In middle layers, one finds features that represent more abstract concepts or perform some transformation. For example, the authors mention a feature that appears to implement an “add 9” operation in an addition problem (taking a number and effectively adding 9 to it) (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). These are neither tied to a single word nor a single output, but instead encode some relation or operation (like a fact, a rule, a relation between parts of the text).
- Polysemantic features: Especially in earlier layers, some features respond to multiple unrelated triggers (a phenomenon known as polysemanticity) (Circuit Tracing: Revealing Computational Graphs in Language Models). For example, a feature might fire on the word “rhythm” and also on the name “Michael Jordan” and a few other things with no obvious common theme (Circuit Tracing: Revealing Computational Graphs in Language Models). These are hard to label with one meaning; sometimes they represent a coincidental mixture of roles. The authors tried to group or break these down when possible (since a polysemantic feature can complicate the interpretation – it’s doing two different things in different contexts).
The labeling process was done manually for the most part, with some automated suggestions. For instance, they had an automated pipeline from earlier work that could propose labels, but human review was necessary because subtle differences matter (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). An example given: a feature strongly activates on tokens followed by “dag” (hence it clearly is about producing “dag”), so they label it “say ‘dag’” (Circuit Tracing: Revealing Computational Graphs in Language Models). Another feature fires on contexts like “(A”, “(B” etc. (first letters of an acronym after a parenthesis), so they label it as a feature for “continuing an acronym” (Circuit Tracing: Revealing Computational Graphs in Language Models). This interpretability work provides confidence that features correspond to meaningful parts of the model’s knowledge or strategies.
Grouping Features into Supernodes
When multiple features play a very similar role in the computation, it can be helpful to group them together in the graph visualization. The authors introduce the concept of a supernode (Circuit Tracing: Revealing Computational Graphs in Language Models): essentially a cluster of feature nodes that can be treated as one for analysis purposes. For example, in the acronym task, there were three separate features in the model that all responded to the word “Digital” in different subtle contexts (perhaps one triggers on uppercase “Digital”, one on lowercase “digital”, etc.) (Circuit Tracing: Revealing Computational Graphs in Language Models). But for explaining this particular prompt, all that matters is that “Digital” contributes the letter D – each of those features was contributing to the same downstream “say D” behavior (Circuit Tracing: Revealing Computational Graphs in Language Models). So they grouped them into one supernode labeled “Digital (D) features”. In the simplified diagrams, these supernodes are drawn as single boxes containing those features (Circuit Tracing: Revealing Computational Graphs in Language Models). An edge out of a supernode means that each feature in that group had an edge to the target, and collectively we consider their influence.
The grouping strategy is somewhat ad-hoc and done post-hoc. They consider features to be grouped if:
- They activate in similar contexts (e.g., all fire on the word “digital” or related tokens).
- They have similar effects on other nodes (e.g., all point to the same downstream “say X” feature with positive effect, and maybe all have the same sign of influence on outputs) (Circuit Tracing: Revealing Computational Graphs in Language Models).
- Ideally, they also promote each other (meaning if one feature in the group activates, it may help activate the others, indicating they might be partial fragments of one broader concept) (Circuit Tracing: Revealing Computational Graphs in Language Models).
In practice, they did some clustering (e.g., by comparing decoder vectors or adjacency in the graph) but found automated clustering not sufficient; human judgment was used to decide the meaningful groupings (Circuit Tracing: Revealing Computational Graphs in Language Models). The reason is that features can share some weights but differ in others, and one might choose to group them based on the facet relevant to the current analysis. Grouping is a way of simplifying the circuit diagram to focus on the conceptual units (like “the group of features that all detect something about the word Digital”).
Using supernodes does not alter the underlying quantitative graph; it’s a presentation layer. But it can highlight higher-level modules in the circuit. If a set of features are grouped, one might then describe the circuit in terms of interactions between these groups. For instance, “The ‘Analytics’ supernode (features that detect the word Analytics) activates a ‘say A’ feature, which then helps activate the ‘say DAG’ feature”, etc., which is easier to say than enumerating three separate features doing similar things. Supernodes also help in designing causal tests: one may decide to intervene on all features in a supernode together (to see what happens if that whole concept is shut off).
Validating Attribution Graphs with Interventions
An attribution graph is a hypothesis about the model’s internal mechanism on a given input. To increase confidence in this hypothesis, the authors perform causal intervention experiments on the original model. The idea is to manipulate certain features and see if the downstream effects match what the graph predicts (Circuit Tracing: Revealing Computational Graphs in Language Models). If the graph says node has a positive edge to node , then if we somehow force to be higher in the real model, we expect ’s activation (and possibly the output logit) to increase accordingly. Conversely, if we suppress , we expect (and the output) to drop. These interventions serve as tests of whether these features and edges correspond to real causal influences in the actual network. This is necessary because the attribution graph is based on the local replacement model, which is an approximation; we need to check if the real model behaves similarly (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models).
The challenge is how to intervene on a “feature” in the real model, since features are constructs in the CLT, not explicit in the original transformer. However, by design, the CLT feature at layer is a linear function of the residual stream at layer . We can compute ’s activation on a given prompt easily (via the transcoder’s encoder). To intervene, we can modify the residual stream in the original model in a way that mimics changing . Specifically, recall that feature would normally contribute to layer ’s residual (for each ). If we want to add some amount to , we can add to the residual stream at layer ; if we want to suppress , we can subtract its original contribution. In essence, to turn a feature off, we subtract ; to double a feature, add another . This technique is known as feature patching or steering in the residual stream (Circuit Tracing: Revealing Computational Graphs in Language Models).
One complication is that CLT features are cross-layer – feature writes to multiple layers. So what does it mean to “turn off feature ”? Ideally, we should remove all of its contributions throughout the model. Thus, we might need to patch multiple residual streams (from layer up to some end layer). The attribution graph edges represent the cumulative effect of ’s contributions across all layers (Circuit Tracing: Revealing Computational Graphs in Language Models). If we only intervened at one layer (say immediately after by removing ’s output at that layer), some of ’s influence that comes in at later layers would remain. So typically we choose a range of layers [] over which to apply the intervention (Circuit Tracing: Revealing Computational Graphs in Language Models). Often is the feature’s own layer, and is the last layer we think it has significant effect on.
The authors introduce constrained patching as their method for interventions (Circuit Tracing: Revealing Computational Graphs in Language Models). The idea is to replace the feature’s effect with a modified version, without letting the rest of the network readjust within the patched range. Here’s how it works, in precise terms:
- Select target features and layer range: Decide which feature(s) (or supernode) to intervene on, and from which layer to which layer to apply the intervention. For example, “suppress the Group supernode from layer 1 through layer 12” would mean we plan to zero out those features’ contributions in every layer 1–12.
- Compute original activations: Run a forward pass on the original model (or ensure we have recorded it) to know for each target feature , and the residual stream values.
- Modify MLP outputs in the range: For each layer in the chosen range, adjust the MLP output post hoc to reflect the feature intervention. Concretely, if feature (at layer ) normally contributes to layer , we will remove or scale that contribution. Suppose we want to set ’s activation to instead of its original . Then we compute the difference . We then add to the residual stream after the MLP at layer . If is negative (like setting gives ), this subtracts out the feature’s influence. We do this for every target feature that has a decoder into layer , and sum all such modifications. Crucially, we do not recalculate the feature activations within this range after making the change (Circuit Tracing: Revealing Computational Graphs in Language Models). We are essentially clamping the MLP outputs in layers through to new values that incorporate our patch, and then proceeding forward.
- Resume forward pass after : Once we reach the end of the patching range, we continue the model’s forward computation normally from layer onward, using the modified residual stream as input to layer . Outside the patched range, the model sees the effect of the intervention as a changed input, and can propagate it normally.
- Freeze attention patterns: Just as with the local model, to isolate the effect, they keep the same attention pattern as in the unmodified run (Circuit Tracing: Revealing Computational Graphs in Language Models). That is, even if the residual content changes, they do not allow the attention re-weighting to change. This way, any effect on later features or outputs comes only from the changed values in the residual, not from heads attending differently. This matches the limitation of the attribution graph (which also assumed fixed attention). In practice, they compute attention weights once on the original forward pass and reuse them during the patched forward pass (Circuit Tracing: Revealing Computational Graphs in Language Models).
This procedure – computing perturbed MLP outputs in advance and clamping them through the range – is what they call constrained patching (Circuit Tracing: Revealing Computational Graphs in Language Models). It constrains the network such that no new causal effects can start inside the patch range, only the ones we explicitly injected are present. In other words, it prevents second-order effects within the patch range (Circuit Tracing: Revealing Computational Graphs in Language Models). For example, if feature at layer 5 normally would activate feature at layer 6, and we remove ’s output at layer 5, then in a normal forward pass feature ’s input would change and might not activate. But in constrained patching, we do not recompute ’s pre-activation from the new input; we keep ’s activation at whatever it was originally (unless itself is being patched). Effectively, other features in layers 5–6 are oblivious to the change in ; only the direct presence of is gone. This isolates the direct causal chain from to outputs without feedback loops. It avoids double-counting issues that would arise if we naively added a perturbation at every layer (Circuit Tracing: Revealing Computational Graphs in Language Models). (Double-counting example: if influences itself in a later layer, adding its effect in every layer could amplify it multiple times. Constrained patching avoids that by computing the net effect once and clamping.) In summary, constrained patching answers the counterfactual: “What if feature ’s value had been throughout these layers, but everything else in those layers remained as in the original run?”
Mathematically, suppose we patch a set of features from layer to . Let be the original residual after MLP , and the decoder of feature . If we choose new activations for each , then for each we set
Now, how do we interpret the results? If our attribution graph is correct, then making a feature’s activation negative (i.e. inverting it, ) should cancel out its downstream effects. For example, if feature was hypothesized to contribute +5 to logit , then flipping to should reduce the logit for accordingly (we often use a -100% change to see a big effect) (Circuit Tracing: Revealing Computational Graphs in Language Models). The authors often invert features (multiply by -1) to see the effect of removing and reversing that feature’s influence (Circuit Tracing: Revealing Computational Graphs in Language Models). This is more controlled than setting to zero, because setting to zero only removes the positive contribution but if the feature had a suppressive effect on something, zero might not fully test that. Inversion actively turns promotions into suppressions. They note that they choose a negative intervention (rather than ablating to 0) in order to better separate the effect from other compensatory effects (Circuit Tracing: Revealing Computational Graphs in Language Models). If you just ablate, sometimes other features or biases fill in the gap; a negative push is a clearer opposite signal.
Causal interpretation: Constrained patching, by eliminating in-range feedback, attempts to measure the direct causal effect of a feature on outputs (or on other features) as predicted by the linear attribution. If the model truly works as the graph suggests, then removing a parent node should reduce its children’s activations and the output accordingly. If we see a mismatch – for instance, patching feature has little effect on output when the graph said it was important – that might indicate either the graph mis-allocated credit (maybe because of an approximation) or that other redundant paths compensate in the real model. On the other hand, a strong correspondence (patching causes the predicted change) adds confidence that these features are indeed part of a causal chain.
For example, in the acronym graph, they suppressed the “Group (G)” supernode of features (the ones that detect the word “Group” and contribute to saying ‘G’) and observed that the downstream “say G” features and ultimately the “DAG” logit were greatly reduced (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). They did similar patches for other nodes and found the effects matched the graph structure (e.g., turning off the ‘Analytics (A)’ features diminished the ‘say A’ chain) (Circuit Tracing: Revealing Computational Graphs in Language Models). This kind of intervention allows them to validate the hypothesized causal paths: if inhibiting node significantly lowers the activation of node and the output, and those were downstream in the graph, then the graph’s arrows are likely capturing a real mechanism. They also checked for lack of effect on unrelated parts of the graph (patching one path shouldn’t affect another disjoint path’s nodes). In practice, they saw that patching, say, the “sport” supernode in a factual recall example affected the sports-related output logit but not the separate path about a person’s name (Circuit Tracing: Revealing Computational Graphs in Language Models), confirming parallel paths.
One caveat: because constrained patching prevents new within-range activations, if we patch too large a range (say from layer 1 to the final layer), we might artificially prevent the model from responding. For instance, if feature A leads to feature B and we patch from A’s layer through B’s layer, B will not turn on at all (because we didn’t allow it to recompute with A gone) (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). So sometimes they vary the end layer to see where the effect comes in. In Localizing Important Layers below, they use this trick: extend the patch range gradually and see when the output effect saturates (Circuit Tracing: Revealing Computational Graphs in Language Models). The point at which including more layers doesn’t change the outcome presumably is where the causal chain ended.
In summary, constrained patching is a controlled experiment that confirms the directionality and magnitude of influences in the attribution graph while avoiding complications of non-linear interactions. It provides evidence of causal links, supporting the claim that the attribution graph nodes and edges correspond to real mechanisms in the model (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models).
Localizing Important Layers
Given a particular feature or output, one may ask: at what layer does most of the “work” happen? Since features can propagate their influence over many layers, it might be that the crucial contribution to the output happens early and is just carried through, or perhaps things accumulate gradually. The attribution graph helps identify this by showing where strong intermediate nodes are. Additionally, by using the patching method with different end layers, one can see at which layer adding more of the network stops mattering.
For example, in the acronym case, the graph suggested that the “Analytics (A)” features (from the word “Analytics”) feed into higher-layer “say A” features only around layer 13 (since those “say A” nodes were in layer 13+) (Circuit Tracing: Revealing Computational Graphs in Language Models). So one would expect that if we patch out “Analytics” features up through layer 12, we have already removed their main effect on the output; patching beyond layer 13 shouldn’t reduce the output much more (because by layer 13 the damage is done, and including layer 13 in the patch would actually stop the chain _within layer 13 due to constrained patching blocking the “say A” activation) (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). Indeed, they observed that extending the patch to include layer 13 caused a plateau or drop-off in additional effect, confirming that layers ≥13 are where that path’s influence manifests fully (Circuit Tracing: Revealing Computational Graphs in Language Models). In contrast, for something like a directly contributing feature, patching only up to an earlier layer might already capture its effect. This way, by sweeping the end layer of a patch, one can map out where the influence of a node enters the computation.
This technique can also reveal if a feature’s influence is mostly direct vs. through many steps. If patching up to the feature’s own layer already kills the output effect, that means the feature was only important via a chain that immediately affected output (perhaps via direct residual connections or attention) (Circuit Tracing: Revealing Computational Graphs in Language Models). If the effect keeps growing as you include more layers in the patch, it indicates a longer cascade of mediating features.
Case Study: Factual Recall
In one case study, they examine how the model recalls a factual association (e.g. “Michael Jordan plays the sport of ” with the answer “basketball”) (Circuit Tracing: Revealing Computational Graphs in Language Models). The attribution graph for the prompt “Fact: Michael Jordan plays the sport of”_ shows two main pathways (Circuit Tracing: Revealing Computational Graphs in Language Models):
- One path originates from the words “plays” and “sport” in the prompt, which activate features related to sports in general and an abstract feature like “say a sport” (which encourages some sport name as output) (Circuit Tracing: Revealing Computational Graphs in Language Models). This path leads to the output logits for various sports (basketball, football, etc.) being elevated. Essentially, the model knows a sport should come next, but hasn’t decided which.
- Another path originates from “Michael Jordan” (and possibly other associated context). Features fire that recognize “Michael Jordan” as a famous person and connect to features about basketball (since Michael Jordan is strongly associated with basketball) (Circuit Tracing: Revealing Computational Graphs in Language Models). These features in turn specifically boost the logit for “basketball” and suppress “football” (since Jordan is not associated with football) (Circuit Tracing: Revealing Computational Graphs in Language Models).
There are also some direct edges from the “Michael Jordan” features straight to the “basketball” logit, representing an effect mediated purely by attention (the model might directly copy “basketball” from seeing “Michael Jordan” due to training distribution) (Circuit Tracing: Revealing Computational Graphs in Language Models). This aligns with prior findings by Batson et al. that certain token pairs can directly raise a related output via attention OV channels (Circuit Tracing: Revealing Computational Graphs in Language Models).
The combined effect is that “basketball” becomes the highest logit. They grouped features into supernodes like “sport/game of” (for the general sport context) and “Michael Jordan” (for those dealing with the name) (Circuit Tracing: Revealing Computational Graphs in Language Models). The graph essentially highlighted a parallel circuit: one chain for context “a sport” and another injecting the specific sport via the name.
They then validated this by interventions: ablating the “sport” supernode greatly reduced the probability of all sports (the model might then not strongly predict any particular sport) but interestingly had a smaller effect on the “Michael Jordan” pathway’s contribution to basketball (Circuit Tracing: Revealing Computational Graphs in Language Models). Conversely, ablating the “Michael Jordan” supernode dropped the basketball logit significantly but didn’t much raise or lower the other path’s output (it still tried to predict some sport, but without Jordan’s influence it might hedge or pick another) (Circuit Tracing: Revealing Computational Graphs in Language Models). This confirmed that these two paths were somewhat independent and additive (one providing the knowledge that “it should be a sport”, the other biasing which sport). Additionally, they found an intermediate “basketball discussion” supernode (features bridging general sports to specifically basketball context) whose removal also harmed the basketball logit (Circuit Tracing: Revealing Computational Graphs in Language Models). All these patch results matched the graph’s implication of how information flowed.
The graph also revealed a bunch of features related to “Michael” as a first name and other celebrities, some even polysemantic ones that weren’t purely about Michael Jordan (Circuit Tracing: Revealing Computational Graphs in Language Models). They noted you sometimes have to include even polysemantic features in supernodes if they happen to be part of this prompt’s mechanism (e.g., a feature that fires on “Michael Jordan” but also “synergy” – it’s polysemantic, but here it’s serving the Jordan pathway so they included it) (Circuit Tracing: Revealing Computational Graphs in Language Models). This underscores that attribution graphs focus on the facet of a feature relevant to the prompt.
Overall, the factual recall case study shows the method identifying a split circuit: one general and one specific, combining to yield the final answer. This is intuitively plausible (the model first thinks “it should be [some sport]”, then “Michael Jordan -> basketball”).
Case Study: Addition
Another case study was on a simple arithmetic prompt, e.g. “calc: 36+59=” and expecting the answer “95”. Addition in language models is an algorithmic task, and they wanted to see if features learn something like addition operation. They focused on a larger model (Claude 3.5 “Haiku”) for clearer patterns (Circuit Tracing: Revealing Computational Graphs in Language Models), but also compare to the smaller 18L model.
They used specialized visualizations for this domain: they plotted each feature’s activation on a grid of all possible two-digit addition inputs (Circuit Tracing: Revealing Computational Graphs in Language Models), as well as how the feature’s activation influences output numbers (Circuit Tracing: Revealing Computational Graphs in Language Models). These plots allowed them to categorize features by their behavior. They found that the features on the ’=’ token (just before answering) fell into distinct types (Circuit Tracing: Revealing Computational Graphs in Language Models):
- “Sum” features: These have activation patterns forming a diagonal line on the input grid, meaning they activate only when (the sum) satisfies a certain condition (like the sum is in a certain range or congruent to something). They essentially encode constraints on the sum (Circuit Tracing: Revealing Computational Graphs in Language Models).
- “Lookup table” features: These have grid patterns (like a multiplication table shape) meaning they activate on combinations of and that independently satisfy two conditions (e.g., ends in 3 and ends in 2, etc.) (Circuit Tracing: Revealing Computational Graphs in Language Models). They look like they check specific combinations of digits (thus like memorized lookup entries).
- “Add function” features: These have horizontal or vertical stripes, meaning they depend on just one of the addends (like is in a certain range, irrespective of ) (Circuit Tracing: Revealing Computational Graphs in Language Models). They might represent partial computations or OR combinations of conditions on one number.
- Mostly active features: Features that are on for most inputs (maybe sanity-check or carry features) (Circuit Tracing: Revealing Computational Graphs in Language Models).
- Miscellaneous/Hybrid features: Some features defy simple classification or combine patterns (Circuit Tracing: Revealing Computational Graphs in Language Models), often less influential.
The attribution graph for the addition problem showed a structure where the model seems to break the problem into parts (Circuit Tracing: Revealing Computational Graphs in Language Models). Specifically, they identified at least three major sub-calculations:
- A final-digit (mod 10) path – handling the addition of the last digits of 36 and 59 to get 5 (with a carry of 1). This is like computing . Some features were specifically sensitive to final digit patterns (e.g., if result’s final digit = 5).
- A low-precision path – computing a rough sum ignoring some part, maybe just adding tens (30+50=80) or similar coarse estimate (the “left” dark brown path) (Circuit Tracing: Revealing Computational Graphs in Language Models).
- A moderate precision path – computing with more precision than the coarse one but not fully exact (the middle path) (Circuit Tracing: Revealing Computational Graphs in Language Models).
These paths then “constructively interfere” to produce the final answer (Circuit Tracing: Revealing Computational Graphs in Language Models). In other words, one feature might give “sum is around 90”, another gives “plus 5”, and together they yield 95. Indeed, they mention that one path plus final-digit path combine to get mod 100 result (Circuit Tracing: Revealing Computational Graphs in Language Models).
This indicates the model didn’t have a single neuron doing addition, but rather a small circuit of features that together compute it piecewise (some handle the units place, some the tens place, some ensures carries). The attribution graph and the special plots allowed them to see this clearly. For example, “final-digit” features correspond to those stripe patterns focusing only on last digits (mod 10 arithmetic), whereas “lookup” features might be handling carries (like if one number ends in 6 and the other in 9, that triggers something).
They provided an interactive graph for the addition case and noted that it suggests a natural taxonomy of features (as described above) (Circuit Tracing: Revealing Computational Graphs in Language Models). They manually labeled features along two axes: (a) computational role (sum vs lookup vs etc.) and (b) condition type (like what kind of condition on inputs each feature had – they mention “condition properties” after L870 which likely describes whether a feature’s condition is on final digits, on magnitudes, etc., possibly distinguishing features by whether they care about carries or certain ranges).
In summary, the addition case study demonstrates that even a simple arithmetic operation is solved by the model through an internal circuit with multiple features each handling a part of the problem (like a human might separate units and tens). Attribution graphs helped reverse-engineer this by making the hidden features interpretable (via grid visualizations and seeing how they connect). This kind of insight is valuable: it shows the model learned an algorithm-like approach (not just one big neuron memorizing 36+59=95, but a procedure that could generalize).
Global Weights and Broader Patterns
While attribution graphs focus on a single prompt (local interactions), the authors also consider global weights – a way to summarize how features interact in general, across all contexts (Circuit Tracing: Revealing Computational Graphs in Language Models). In a standard multilayer perceptron, the “global” interaction between neurons is just given by the weight matrices. But here, because features can connect via the residual stream and attention in various ways, the “effective weight” between two features can be context-dependent (especially if mediated by attention patterns). They decompose interactions into a context-independent part and a context-dependent part (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models).
They identify three kinds of paths by which a source feature can influence a target on any prompt (Circuit Tracing: Revealing Computational Graphs in Language Models):
- Residual-direct paths: writes directly into the residual stream and reads it at a later layer, without any attention in between. This is like a straight pipeline through the residual connection (or series of them) from to . The strength of this connection is basically independent of the prompt; it’s determined by ’s decoder and ’s encoder overlap.
- Attention-mediated (OV) paths: ’s output goes into the residual, then is carried via one or more attention head output-value (OV) transformations (where an attention head takes from one position and delivers to another), and eventually that information is read by ’s encoder. This path’s existence is fixed (through decoder and OV and encoder weights), but its usage depends on the attention pattern (the queries/keys that decide if that head actually connects those positions). So the strength of influence along this path is scaled by attention scores, which vary by prompt (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models).
- Indirect paths: influences some intermediate feature , which then influences . In other words, multi-hop via other features (which themselves are non-linear units). These are highly context-dependent because whether activates or not depends on prompt, etc. In the fully linearized local model these become many-step linear chains, but globally you can’t assign one fixed weight to them.
The context-independent component of interaction can be captured by the first two kinds (if we ignore whether attention heads fire strongly or not). They define virtual weight between two features as a kind of inner product of encoder/decoder that sums across all direct residual connections (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). Specifically, if feature is at layer and feature at , consider all layers with where could write and could read. Sum up ’s decoder vectors for those layers, and take the inner product with ’s encoder vector (Circuit Tracing: Revealing Computational Graphs in Language Models): Vst=⟨∑ℓ=ℓsℓt−1Wdecs, ℓ, Wenct⟩.V{s t} = \Big\langle \sum{\ell=\ells}^{\ell_t-1} W{\text{dec}}^{s,;\ell},;; W{\text{enc}}^t \Big\rangle. This $V{st}$ is essentially the net “residual stream coupling” between and . If is large, it means whenever fires, it tends to send a direction in the residual that aligns well with what looks for. That would be a strong potential influence. Indeed, in the local graph, the residual-direct part of would be (the attention-mediated parts are separate) (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models).
They note that attention-mediated influences can also be expressed in a similar form, but you have to include the product of the OV matrices of the heads. For example, if feature at pos A influences pos B via head and then is read by , you’d have something like as a term. But these are scaled by actual attention probabilities which depend on content (the QK circuit). So purely context-independent “strength” can be defined, but whether it’s realized depends on attention. Thus they call (and analogous multi-head terms) virtual weights (Circuit Tracing: Revealing Computational Graphs in Language Models).
Virtual weights have been studied in other interpretability work (they cite examples: between attention heads, or between neurons in sparse autoencoders, etc.) – essentially it’s a way to linearize interactions (Circuit Tracing: Revealing Computational Graphs in Language Models). For CLT features, as given above is one natural definition.
However, a big issue with using as a global weight is interference (Circuit Tracing: Revealing Computational Graphs in Language Models). Because there are so many features (potentially millions) and they exist in a high-dimensional space (the residual stream dimension), any two features will have some nonzero inner product of decoders and encoders. By chance, many pairs of features that never actually activate together can still have a large . This doesn’t mean ever actually influences in practice, because and might be specialized to totally different contexts that don’t co-occur. The presence of “millions of features interacting via residual stream” means the virtual weight graph is a complete graph with weights – not all meaningful. High might be just “coincidental alignment” rather than a real circuit. They call such terms interference – large weights with no causal effect on distribution because the features don’t coactivate (Circuit Tracing: Revealing Computational Graphs in Language Models).
To mitigate this, one approach is to incorporate co-activation statistics: essentially weight by how often and are active together. One could compute, for example, over distribution and use that to filter edges. In the paper, they mention using co-activation statistics to handle interference (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). Possibly they subtract out or ignore connections between features that never co-occur.
In the Global Weights in Addition section, they illustrate using data-independent virtual weights to reveal structure (Circuit Tracing: Revealing Computational Graphs in Language Models). For the addition circuit, presumably, if you compute for all feature pairs, you might find clusters: features that belong to the same pathway have strong mutual connections. For example, all features that deal with the final-digit might have strong between each other (since they likely share similar decoders or targets). Indeed, they likely found that the features grouped in the addition graph also cluster by . This shows that some circuits are visible even without a specific prompt: the weights themselves (plus knowledge of which features fire together) indicate modules. The text suggests “clear structure between features” was seen (Circuit Tracing: Revealing Computational Graphs in Language Models), likely corresponding to the final-digit vs tens pathways.
In general, defining a set of global weights that capture both the consistent linear effect and actual usage is challenging. The authors treat the virtual weight as a starting point (context-independent “could influence”) and note the interference issue. They don’t finalize a single metric, but propose that some subset of those virtual connections correspond to meaningful global circuits, especially if filtering by activation patterns.
In sum, global weights analysis attempts to step back from one example and ask: which features in principle influence which others strongly? And which of those actually matter in practice? This is a step toward a global circuit diagram of the model (which is very complex). They demonstrate in the addition case that even with a complex model, using virtual weights one can identify groups of features that form something like a lookup table for addition, etc., without focusing on one prompt. This could be useful for finding circuits that weren’t explicitly prompted.
Evaluations of the Method
The paper evaluates both the quality of the CLT itself and the faithfulness of attribution graphs.
Cross-Layer Transcoder Evaluation
They evaluate the CLT (the replacement model) along a few dimensions:
- Reconstruction fidelity: How well does the CLT approximate the original MLP outputs and predictions? This was partially addressed earlier: e.g., measuring the fraction of cases where the replacement model’s top prediction matches the original model’s top prediction (Circuit Tracing: Revealing Computational Graphs in Language Models). Larger CLTs had higher match rates. They may also measure per-layer MSE, etc. The largest CLT for the 18L model got ~50% agreement on chosen test prompts (Circuit Tracing: Revealing Computational Graphs in Language Models), which is a significant but not perfect overlap.
- Interpretability of features: This is more qualitative. They sample features and examine what they do. They report that many features are indeed interpretable (as discussed in labeling). They even show random samples of feature visualizations to avoid cherry-picking (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). They categorize these random features: input features, output features, abstract, functional, polysemantic, etc., as we described (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). They find that higher activation features are more interpretable, similar to previous observations with neurons (very faint activations might be polysemantic noise) (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). They also note differences between the small 18L model and the larger Haiku model: Haiku’s features are “richer” (capturing more complex abstractions) (Circuit Tracing: Revealing Computational Graphs in Language Models). This makes sense: a larger model may form more complex features.
- Comparison to baselines: They compare CLT with per-layer transcoders (PLT) and thresholded neurons. A per-layer transcoder means each layer separately gets a sparse autoencoder (like features that only reconstruct that layer’s MLP, not cross-layer). Thresholded neurons means just take the original neurons but zero out those below a threshold to induce sparsity. They found CLT outperforms these in the trade-off of sparsity vs fidelity (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). Specifically, for equal total number of features, CLT achieved higher next-token match than PLT, indicating some advantage of cross-layer features (Circuit Tracing: Revealing Computational Graphs in Language Models). And thresholding neurons at a level where they become as interpretable as CLT features (according to an automated metric) harmed the model’s performance much more than using CLT features (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). This implies learned features are more efficient carriers of information when forced to be sparse than pruning existing neurons.
One metric they define is the replacement score, which appears to measure how much of the output probability mass is preserved by the replacement model. It might be something like the total logit influence from embeddings in the unpruned graph (which equals that from the original model if fully accurate, but will be less if CLT misses some, with error nodes filling the rest) (Circuit Tracing: Revealing Computational Graphs in Language Models). Possibly replacement score = (influence of non-error nodes on output) / (total influence). A higher replacement score means the CLT explains more of the model’s computation. They likely track this as dictionary size grows, etc.
They also evaluate whether features “live in multiple layers” or just local (Circuit Tracing: Revealing Computational Graphs in Language Models). They found a range: some features primarily only decode strongly to one layer (meaning they do a job and then fade), while others have outputs all the way to final layer (like a feature that is consistently contributing up to the end) (Circuit Tracing: Revealing Computational Graphs in Language Models). This suggests some features correspond to transient local computations, others to persistent latent variables.
Attribution Graph Evaluation
For attribution graphs themselves, they devise some graph metrics and compare different methods (CLT vs PLT vs neurons) (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). They caution these metrics are not absolute “ground truth” but useful for comparing. Some metrics mentioned:
- Node influence score: For each node, how much does it ultimately influence the output logits? They compute this by using the indirect influence matrix for the adjacency matrix of the graph (here is weighted, directed, with maybe absolute weights or normalized) (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). Essentially, gives the total strength of all paths from node to node . Then for each feature node , they look at from that node to the output nodes (logits). If you weight each output by its probability, you get a single score per feature indicating how strongly it influences the prediction (Circuit Tracing: Revealing Computational Graphs in Language Models). This is like “impact on output considering multi-hop”. They found this more predictive than simpler measures for actual causal effect (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). They also examine what fraction of total influence comes from error nodes vs normal features (to see how much CLT missed) (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models).
- Path length metrics: They measure how much of the output influence comes from short vs long chains (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). Using the series , one can see, for example, the fraction of embedding-to-output influence achieved by paths of length (Circuit Tracing: Revealing Computational Graphs in Language Models). If shorter paths account for most of it, the graph is “flatter”. They compare cross-layer vs per-layer vs neurons: cross-layer transcoders tend to produce shorter paths (because they can create direct connections across layers rather than forcing a chain of small steps) (Circuit Tracing: Revealing Computational Graphs in Language Models). Indeed, they note one key advantage of CLT is reducing path length (Circuit Tracing: Revealing Computational Graphs in Language Models). In experiments, CLT graphs had more influence concentrated in 1-2 hop paths, whereas neuron-based graphs required longer chains (since a concept might be carried by sequential neuron activations across many layers) (Circuit Tracing: Revealing Computational Graphs in Language Models).
By these metrics, CLT-based graphs had favorable properties: e.g., shorter average path lengths for the same amount of explained influence, meaning they are simpler to interpret (Circuit Tracing: Revealing Computational Graphs in Language Models). They likely also measure something like number of nodes or edges needed after pruning – CLT might allow more aggressive pruning if edges are stronger direct.
They also ensure these metrics correlate with interpretability: e.g., path length reduction was an intended outcome of cross-layer features, confirming their hypothesis of “cross-layer superposition collapse” (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models).
Mechanistic Faithfulness
A crucial question: even if the local replacement model exactly matches outputs on the given prompt, does it use the same mechanisms as the real model? Or could it be achieving the same result differently (e.g., a linear approximation that coincidentally matches)? They define mechanistic faithfulness as the degree to which interventions in the local model have the same effects as corresponding interventions in the original model (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). We already described one test: do feature influence scores predict actual causal effects? They found a strong correlation of 0.72 between the graph’s feature-to-feature influence and actual ablation effects in the real model (Circuit Tracing: Revealing Computational Graphs in Language Models). Also, node influence on logit was more predictive of output change than just that node’s direct logit connection or its activation magnitude (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). This validates that the graph isn’t hallucinating relationships – it reflects real causal links better than naive measures.
However, they also did a broader test: take a bunch of random perturbations in the local replacement model and apply them in the original model, compare results. They observed that over a single layer’s distance, the replacement model’s predictions are fairly faithful (~0.8 cosine similarity in effect vectors between local vs original, meaning the direction of change is similar) (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). But as you propagate further, discrepancies grow (“compound over layers”) (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). By the time you get many layers away, the magnitude of effects can differ a lot, even if the direction (sign of influence) remains somewhat correlated. In fact, they saw that for large interventions the local model might severely over or under-estimate the effect on final output (magnitudes deviate), especially for bigger CLTs (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). They suspect this is because the local model does not include layer norm’s normalization effects – in the real model, if you inject a big change, layer norm might dampen it, whereas the local model would just linearly add it up (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). The absence of certain nonlinear stabilizers means the linear approximation can overshoot for large perturbations (though for small ones it’s fine).
So, while attribution graphs are good at qualitative mechanism (who influences whom positively/negatively), one should be cautious about using them for precise quantitative predictions of large changes. The method is like a first-order linearization: accurate for infinitesimal or small changes, and capturing directional influence, but not higher-order feedback. The authors emphasize the need to validate with real model interventions (which they did) to be sure.
They also note that increasing the number of features (a bigger CLT) did not significantly improve faithfulness of directions (which were already ~0.8 cos sim) but did worsen magnitudes possibly (Circuit Tracing: Revealing Computational Graphs in Language Models). That suggests diminishing returns – once the CLT fits the output well, adding more features might just capture more fine nuances that don’t translate linearly.
In summary, the method is mechanistically faithful in local linear terms (graph edges correlate with real causal effects), but not a perfect simulator of the model under large changes (nonlinear divergence beyond local region). This is acceptable because the aim is to explain, not to replace the model in all regimes.
Limitations
Despite its successes, the methodology has several limitations (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models):
- Missing QK attention circuits: The method freezes attention patterns and thus does not attribute how those patterns come about (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). If a model’s behavior crucially depends on which tokens attend to which, this method won’t explain that. For example, the famous induction head mechanism (where a head learns to attend to previous occurrences of a token sequence) is a QK-mediated effect. The authors explicitly mention that applying their method to an induction scenario would yield a trivial graph (“the model copied ‘Sally’ because ‘Sally’ was earlier”) which misses the true reason (the matching “Aunt” prefix causing attention) (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). So the method currently assumes that the interesting mechanism is in the pattern of feature activations given a fixed attention, which is not always true. They acknowledge we need complementary analysis for the QK circuits (the Query-Key part of attention), which they did not tackle here (Circuit Tracing: Revealing Computational Graphs in Language Models).
- Reconstruction errors and “dark matter”: The CLT does not perfectly reconstruct everything. Some fraction of the network’s activity might be in the error nodes, or not captured by sparse features (Circuit Tracing: Revealing Computational Graphs in Language Models). If a vital part of the logic is not captured, the attribution graph may be missing critical nodes or edges (“dark matter” circuits that we don’t see). In such cases, the graph might be incomplete or even misleading. They caution that when the method fails to explain something (e.g., a node has huge unexplained effect via error), then the graph should be taken as incomplete (Circuit Tracing: Revealing Computational Graphs in Language Models).
- Inactive features and inhibitory effects: The method naturally focuses on active features (since the graph nodes are those with activations). But sometimes a feature not activating is important: an inhibitory circuit might require a feature’s absence. Or two features might counteract each other, and only one activates. In an attribution graph, you’d only see the one that did activate, not the one that “would have” but got suppressed. So there’s a risk of missing inhibitory circuits (Circuit Tracing: Revealing Computational Graphs in Language Models). A feature that prevents something might only be evident by its absence. Addressing this might require considering alternate activations or including negative evidence in the analysis, which is not straightforward in the current pipeline.
- Graph complexity: The resultant graphs can be very complex and hard to interpret if not pruned or grouped (Circuit Tracing: Revealing Computational Graphs in Language Models). This is a practicality issue: making sense of a thousand nodes graph is challenging. They did a lot of manual intervention (grouping, interactive filtering) to handle this. It’s a limitation in terms of automation – currently, human insight is needed to condense the graph. If one aims for a fully automated understanding, further work is needed to simplify or cluster the graph meaningfully.
- Features not at ideal abstraction level: The learned features might sometimes split a single concept into pieces or merge multiple concepts. For instance, instead of one “digit sum carry” feature, the CLT might have two half-carry features that together do it, or one feature might inadvertently combine an unrelated thing. This means the graph’s primitives might not always align with what a human considers a concept (Circuit Tracing: Revealing Computational Graphs in Language Models). They call it “feature at wrong level of abstraction” (Circuit Tracing: Revealing Computational Graphs in Language Models) – making the circuit harder to explain. This is partly due to how the CLT is trained (just for MSE and sparsity, not explicitly for monosemanticity or align with human concepts). There’s ongoing work to improve feature learning criteria to get cleaner features.
- Difficulty of global understanding: As noted, this method is per-example. Understanding global behavior would require merging many graphs or finding common patterns, which is a challenge (Circuit Tracing: Revealing Computational Graphs in Language Models). They provide some tools (global weights, etc.), but a true global circuit diagram that holds across all inputs is elusive. The model might implement one logic in one context and another elsewhere (superposition), so one graph can’t capture that.
- Mechanistic faithfulness concerns: Replacing MLPs with CLT features assumes those features mirror the actual neurons’ mechanism. It’s possible the CLT finds a solution that mimics outputs but uses different intermediate variables than the actual network. If so, the graph would explain the CLT’s mechanism, not the real model’s. They tried to minimize this (with local corrections and tests), but it’s a philosophical limitation: we are interpreting an approximation (Circuit Tracing: Revealing Computational Graphs in Language Models). The validation experiments help, but one must always be vigilant that the real model might have hidden states not captured.
These limitations highlight areas for future improvement. For instance, developing ways to handle QK circuits (e.g., build a similar graph for attention patterns), training the CLT with additional objectives to yield more interpretable features (monosemantic, or explicitly encourage known algorithmic behavior), and methods to integrate inactive feature logic. The authors provide concrete counterexamples (like the induction example for the attention issue) as proof that currently their method can “miss the story” in certain cases (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). This transparency about limitations is important for users of the method: it works best when the interesting computation is in the MLP pathways (OV circuits) rather than in dynamic attention routing.
Discussion and Future Directions
In the discussion, the authors frame their approach in the broader context of reverse-engineering neural networks (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). They break the process into four steps: decomposition, description, interaction, and validation (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). In their case:
- Decomposition: replacing MLPs with CLT features (i.e., choosing a different basis for internal computation).
- Description: interpreting what each feature represents (via examples/visualizations).
- Interaction: building attribution graphs of how features connect on a specific task.
- Validation: using causal interventions (patching) to test those connections.
They argue that some of their choices in this pipeline are robust and likely necessary in any such attempt (Circuit Tracing: Revealing Computational Graphs in Language Models):
- Using learned features instead of raw neurons (Circuit Tracing: Revealing Computational Graphs in Language Models), because neurons are fixed and many are not interpretable at moderate activations. Thresholding neurons to make them sparse enough to interpret was much more damaging to the model than learning sparse features (they view the CLT as a kind of optimized thresholding that retains performance) (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models).
- Using transcoder features that explicitly correspond to model components (MLPs) rather than features that live in the continuous residual space (like principal components or sparse autoencoders on the residual) (Circuit Tracing: Revealing Computational Graphs in Language Models). If one did a Sparse Autoencoder on the residual stream alone, one could find features that reconstruct activations, but those wouldn’t cleanly map to “computation steps” because between any two residual stream SAEs, there’s a nonlinear transform (the MLP). Their choice to tie features to MLP inputs/outputs means that between features interactions are linear via residual, making attribution graphs much clearer. In contrast, if features had to pass through unknown nonlinear MLP transformations to influence each other, it would be harder to interpret (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models).
- Using cross-layer features vs per-layer (Circuit Tracing: Revealing Computational Graphs in Language Models) as discussed – this collapses repeated amplification of a concept across layers into one unit. They saw evidence that indeed some high-level features spanned many layers (the model just kept amplifying the same pattern), and CLT captured that as one feature that persists, thereby shortening path length (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models).
- Using linear direct effect attribution rather than complex nonlinear attributions like integrated gradients or Shapley on the full model (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). They freeze certain components to make the interactions linear and therefore unambiguous. This is a philosophical stance: attempting to allocate credit in a nonlinear network inevitably faces ambiguity or requires arbitrary baselines. By linearizing (freezing attention and norm), they isolate a part of the network where attribution is straightforward (just linear weights) (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). The trade-off is that what they freeze is analyzed separately (like attention QK circuits elsewhere). They acknowledge this partitions the problem – part is solved (the OV circuits in a linear way), part remains (QK circuits). But this is a conscious design to tackle one piece at a time in a principled manner.
They note that even with these choices, the complexity hasn’t vanished – it’s been transferred to different places (Circuit Tracing: Revealing Computational Graphs in Language Models). Nonlinear interactions either become multi-step linear paths (which are easier to reason about incrementally), or they sit in the frozen components (like attention pattern formation, which is “factored out” to another problem), or possibly the CLT itself might not be perfectly faithful (if it took a shortcut linear approximation) (Circuit Tracing: Revealing Computational Graphs in Language Models). In the best case, the nonlinear complexity becomes explicit multi-hop paths we can interpret (which is what we want). In the worst case, the CLT might be faking it (taking a linear combination that fits outputs but not matching actual intermediate computations) – that’s the mechanistic faithfulness issue, which they attempt to monitor.
They mention other choices for convenience or first-step that could be improved (Circuit Tracing: Revealing Computational Graphs in Language Models):
- They collapse attention heads’ contributions into single edges (Circuit Tracing: Revealing Computational Graphs in Language Models). They do not label which attention head carried a given interaction. Knowing “feature A influences feature B through head 5 vs head 7” could be insightful (like distinguishing an induction head vs a different head). Currently, they sum it all up per pair of features. Future work might incorporate identifying specific heads or splitting edges by head. They hypothesize certain heads implement distinct functions (like an induction head that uniformly shifts certain features). If we could include those as separate edges or features themselves, the story might be richer (Circuit Tracing: Revealing Computational Graphs in Language Models).
- They ignore QK circuits entirely (Circuit Tracing: Revealing Computational Graphs in Language Models) (as said). They see their work as focusing on OV-circuits (how information moves if you assume a certain attention pattern), and leaving the why of attention unanswered. They follow the “Framework” paper approach: first interpret OV circuits conditional on attention, then separately figure out QK. They did the first, not the second in this paper.
- They only used a combination of sparsity and MSE loss to train the CLT, not directly optimizing for things like monosemanticity or alignment with known human-understandable functions (Circuit Tracing: Revealing Computational Graphs in Language Models). They suspect one could add losses that encourage features to correspond to, say, known algorithmic subtasks or to have less “interference”. They note they didn’t explicitly train for mechanistic faithfulness or sparse edges; they only trained for sparse activation and output reconstruction (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). So there’s room to include additional objectives (maybe based on causal validation results) to improve the quality of the learned features and the graph.
Finally, despite these shortcomings, the approach yielded a lot of interesting insights (as shown by the companion paper’s case studies: planning, multilingual, refusals, etc.) (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). They expect that continuing in this paradigm of trained interpretable replacement models will yield better and better results, both quantitatively (more of model explained, shorter paths, etc.) and qualitatively (deeper mechanisms discovered) (Circuit Tracing: Revealing Computational Graphs in Language Models).
In conclusion, Circuit Tracing using a cross-layer transcoder and attribution graphs is a powerful new method to peel back the layers of a language model’s computation. It translates the model’s forward pass into a graph of feature interactions, providing a interpretable, math-grounded explanation of “which internal features caused what” for a given output. This method blends neural network approximation, sparse coding, and causal analysis to bridge the gap between the inscrutable billions of weights and a human-understandable computational graph. It is not without limitations – notably, attention routing is treated as exogenous, and the method gives a linearized view – but it marks a significant step toward theoretical understanding of deep network behavior. For theoretical statisticians, one can view this as identifying latent variables (features) and estimating the local causal structure among them. The Jacobian-based edge weights are analogous to partial regression coefficients in a local linear model approximation of the network’s function. Validating those with interventions is akin to a causal inference check for each edge. Thus, the work provides a framework to talk about the model’s internal mechanism in a rigorous way: as a directed acyclic graph with nodes as latent features and weighted edges as linear causal effects on a specific input. This opens the door to analyzing neural networks with the rich toolkit of graphical models and causal analysis, bridging deep learning and interpretable statistical modeling.
Part 1: Deriving Attribution Graph Edge Weights in Circuit Tracing
1.1 Forward Computation of the Local Replacement Model
Cross-Layer Transcoder (CLT) Features: In the Circuit Tracing framework (Ameisen et al., 2025), the MLP modules of a transformer are replaced by an interpretable cross-layer transcoder (CLT) that operates in terms of human-interpretable features (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). A CLT “feature” is a vector direction in the residual stream that represents a specific concept or neuron-like activation. Each feature has an encoder vector (to detect that feature in a layer’s input) and decoder vectors (to contribute that feature’s effect to various layers’ outputs) (Circuit Tracing: Revealing Computational Graphs in Language Models). The CLT is trained such that at each transformer layer ℓ, the MLP output is approximated by summing contributions from all CLT features whose encoders are at or before layer ℓ (plus a small error term to correct any approximation gap) (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models).
Local Replacement Model: For a given prompt p, a local replacement model is constructed which uses the CLT in place of each MLP, but is exactly aligned with the original model on that prompt (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). This is achieved by (1) freezing the attention patterns and layer-normalization statistics to those from the original model’s forward pass on p, and (2) adding an error correction at each layer equal to the difference between the true MLP output and the CLT’s reconstructed output (Circuit Tracing: Revealing Computational Graphs in Language Models). Thus, on prompt p the local replacement model produces identical residual activations as the original model at every position and layer, but it expresses those activations as a linear combination of feature contributions plus explicit error terms. In effect, the local model provides a linearized computation graph of how active features contribute to later features or outputs.
Concretely, let denote the residual stream at layer and position . In the original transformer, after the attention sublayer at layer , we have (ignoring layernorm for simplicity):
- (the residual plus attention-head outputs, where are the fixed attention weights and the value-projection) (Circuit Tracing: Revealing Computational Graphs in Language Models).
- The MLP output is , which is non-linear (typically for some activation ).
- The post-MLP residual: .
In the replacement model, this is reconstructed as:
- Feature encoding: For each CLT feature with encoder at layer ℓ, compute its activation . (Intuitively, projects the residual into the feature’s direction to detect how strongly feature is present at this layer.)
- Feature decoding: At the MLP output of layer ℓ, replace the MLP’s output with the sum of decoder contributions from all relevant features: xcℓ,out = xcℓ,mid + ∑i: ℓi≤ℓWdec,iℓi→ℓ ai + ecℓ.x^{\ell,\text{out}}c ;=; x^{\ell,\text{mid}}_c ;+; \sum{i:,\elli \le \ell} W{\text{dec},i}^{\elli \to \ell}; a_i ;+; e^{\ell}_c. Here $W{\text{dec},i}^{\ell_i \to \ell}$ is feature ’s decoder vector for layer (defined for all layers at or after the feature’s origin layer ), and is the error-correction vector (which ensures the sum perfectly matches the true MLP output for this prompt) (Circuit Tracing: Revealing Computational Graphs in Language Models).
Because the attention patterns and layernorm factors are fixed from the original run (no “QK” feedback; see §1.3), the only nonlinearities in this local model are the feature encoders/decoders themselves. However, if we “stop-gradient” through those nonlinear steps, the entire local model becomes a linear graph of feature influences: each feature’s pre-activation (the input to its nonlinearity, often equal to if we treat encoder detection as linear) is a linear combination of other features’ outputs. In practice, we do exactly that: we treat the feature activations as fixed inputs and do not propagate gradients through any activation functions (or through attention softmax or norm normalization) (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). This yields a linear approximation where each feature node’s preactivation equals the sum of its incoming weighted contributions (Circuit Tracing: Revealing Computational Graphs in Language Models).
In summary, the forward pass of the local replacement model induces a directed acyclic graph where nodes are active features (and special input or error nodes), and an edge from node to node exists if feature ’s output contributes linearly to feature ’s input. The goal is to compute the edge weight , which quantifies how a small change in ’s activation would affect .
1.2 Linearized Computation Graph and Feature Activations
Under the stop-gradient linearization, we can write the pre-activation of a target feature (at its encoder layer and position ) as the sum of contributions from all source nodes at earlier layers/positions:
ht = ∑s∈Stas ws→t,with as the activation of source feature s.ht ;=; \sum{s\in St} a_s, w{s\to t}, \qquad \text{with } a_s \text{ the activation of source feature }s.
Here is the set of all nodes (features, embedding inputs, or error corrections) at layers (or equal layer but earlier sequence position) that have an edge into (Circuit Tracing: Revealing Computational Graphs in Language Models). By definition, is the linear weight connecting ’s activation to ’s preactivation in this local model. Importantly, can be interpreted as the partial derivative of with respect to , holding all else fixed (thanks to the linearization) (Circuit Tracing: Revealing Computational Graphs in Language Models). This aligns with the idea that attribution graph edges are the derivatives of later activations with respect to earlier feature activations (Circuit Tracing: Revealing Computational Graphs in Language Models).
Feature Activation vs. Preactivation: In this context, a feature node’s activation is the value after its nonlinear encoder (e.g. after a threshold or compression, analogous to a neuron’s output), while its preactivation might refer to the linear detector output before nonlinearity. However, because we add stop-gradients at nonlinearities, the distinction blurs: effectively we treat the feature’s activation as a linear function of its input. For simplicity, one can think of in the linear graph (since we aren’t backpropagating through any nonlinearity that produces ). Each feature’s presence contributes additively to other features’ inputs.
Induced Linear Graph: The linear graph consists of feature nodes (with layer and position), embedding nodes (token embeddings at layer 0), error nodes (one per layer and position, injecting the reconstruction error), and output nodes (logit directions for output tokens) (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). Edges connect these nodes wherever a direct linear contribution exists. For example:
- If feature at layer contributes to the residual stream at some later layer via its decoder, that creates edges for any node whose encoder at layer picks up that contribution.
- Embedding nodes contribute to features in layer 1 by providing initial residual content.
- Error nodes have outgoing edges (they add to residual) but no incoming edges (they are exogenous corrections) (Circuit Tracing: Revealing Computational Graphs in Language Models).
Because the model is linearized, the weight on each edge is constant for that prompt and the feature activations multiply these weights to produce downstream effects. We can now derive formally using the chain of linear transformations from to .
1.3 Derivation of the Edge Weight Formula
Consider a source feature node at layer (position ) and a target feature node at layer (position ), with . In the local model, ’s preactivation depends linearly on ’s activation . We define the attribution weight . By the linearization, (treating other inputs fixed) (Circuit Tracing: Revealing Computational Graphs in Language Models). Our goal is to compute in terms of the underlying model’s parameters.
Chain of Contributions: In the forward computation, feature ’s activation enters the residual stream at layer and then propagates through the transformer to layer . Specifically, causes an injection of the vector into the residual stream at every layer from up to (since the CLT adds the feature’s decoder at each layer ≤ ) (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). We can treat each such injection at layer as a separate linear influence on the residual. That injection then travels to layer and position via the transformer’s fixed linear dynamics (residual connections + frozen attention). Finally, at layer , the target feature ’s encoder reads out the component along ’s direction.
By linearity, the total effect is the sum of contributions from each intermediate layer where injects. Thus we can decompose as a sum over paths through intermediate layers (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models):