Part 2: Constrained Patching vs. Other Causal Patching Techniques

Mechanistic interpretability often uses causal patching methods to investigate which internal components or activations in a neural network are responsible for a certain behavior. All such methods involve intervening on the activations of a model (e.g. by replacing or modifying them) and observing the effect on the output. However, there are important differences in purpose, mechanism, assumptions, and applications. Below, we review several common techniques — attention head patching, activation patching, causal tracing, and causal mediation analysis — and contrast them with the constrained patching approach used in Circuit Tracing. We highlight how constrained patching introduces innovations like error correction, stop-gradient linearization, and clamping of MLP outputs to isolate direct effects.

2.1 Activation Patching (Residual or Activation Swapping)

Purpose: Activation patching (also called residual stream patching or model stitching) aims to locate where in the network certain information is encoded and how it influences outcomes (How-to Transformer Mechanistic Interpretability—in 50 lines of code or less! — AI Alignment Forum). By swapping activations between two runs of a model (typically a “clean” input that produces a desired behavior and a “corrupted” input that does not), we can test whether a given layer or neuron contains information critical for the behavior. If replacing the activation at that layer in the corrupted run with the clean one restores the correct behavior, it implies that layer held the key difference.

Mechanism: A classic approach is to run the model on two inputs (one with and one without a property of interest) and then, at a chosen layer, replace the hidden state (or a subset of neurons) from one run with that from the other. The model then continues forward, and we measure the effect on the output. This process can be repeated for each layer or component to find where the intervention most changes the outcome (How-to Transformer Mechanistic Interpretability—in 50 lines of code or less! — AI Alignment Forum) (How-to Transformer Mechanistic Interpretability—in 50 lines of code or less! — AI Alignment Forum).

For example, one might take a prompt where a factual question is answered correctly (“clean”) and a prompt where it’s answered incorrectly (“corrupt”), and try patching in the clean residual stream at various layers during the corrupt run. The layer at which this swap causes the answer to become correct is likely where the factual information was introduced or preserved. Assumptions: Activation patching assumes that transplanting a hidden representation from one context to another will isolate the causal influence of that representation. This works best if the two contexts are identical except for the factor of interest. It also assumes minimal nonlinear knock-on effects: we interpret any change in output as caused by the injected activation, though in practice the subsequent network computation could amplify or dampen the effect in complex ways. Patching typically does not freeze any other part of the computation, so attention patterns and layer norms will respond normally to the new activation.

Applications: This technique is widely used to trace circuits in language models. For instance, Olsson et al. (2022) (“In the Wild: A Circuit for Indirect Object Identification in GPT-2”) applied activation patching to find a circuit for indirect object identification (IOI). By swapping residual streams between sentences with different pronoun antecedents, they identified which layers carry the subject/object distinction () (How-to Transformer Mechanistic Interpretability—in 50 lines of code or less! — AI Alignment Forum). Activation patching can be done at different granularities: entire residual stream, specific neurons, or specific attention heads (see below). It has been used to discover “induction heads” (which copy tokens far apart) by patching early vs. late layer activations () (), to localize factual knowledge in GPT models by patching mid-layer MLP outputs (as in Meng et al., 2022), and generally to test hypotheses about where certain information first appears. The method is conceptually straightforward and provides direct causal evidence for the importance of a component: if swapping in a component’s activation from a reference fixes the output, that component carried information needed for the task.

Example: Suppose we want to know which layer of a transformer remembers that “Alice” refers to person A vs. person B in two different stories. We take one story where “Alice” does X and another where “Alice” does Y. We run both through the model. Then for each layer , we replace the residual stream for the token “Alice” in story2 with that from story1, and see if the model’s prediction of “Alice does ?” in story2 changes to resemble story1’s outcome. If the model’s prediction flips after patching at layer 10, it suggests the identity of “Alice” (or the action associated) is encoded around layer 10 (How-to Transformer Mechanistic Interpretability—in 50 lines of code or less! — AI Alignment Forum) (How-to Transformer Mechanistic Interpretability—in 50 lines of code or less! — AI Alignment Forum). This pinpointing ability is the strength of activation patching. Limitations: Because standard activation patching allows the entire downstream network to re-compute with the patched activation, the effects are not strictly linear or isolatable. The intervention might cause secondary changes (e.g. altering a residual can shift a layernorm mean, or change attention scores at the next layer). Thus, while it tells us that an activation is important, interpreting how that activation’s information flows further can be complicated. It also requires a full forward pass for each patch, which can be computationally expensive if exploring many components (this motivated gradient-based alternatives like attribution patching (Circuit Tracing: Revealing Computational Graphs in Language Models)).

2.2 Attention Head Patching

Purpose: Attention head patching is a specific case of activation patching focusing on individual attention heads’ outputs. The goal is to identify which attention heads are causally responsible for transmitting information (for example, carrying a specific dependency or fact between tokens).

Mechanism: In a transformer, each attention head produces an output (often called the head’s “OV” output). Head patching swaps or modifies this output for a particular head while keeping others the same. A common technique is to run a clean vs. corrupted input and, for each head , replace the result vector of that head in the corrupted run with that from the clean run (How-to Transformer Mechanistic Interpretability—in 50 lines of code or less! — AI Alignment Forum) (How-to Transformer Mechanistic Interpretability—in 50 lines of code or less! — AI Alignment Forum). One then measures the effect on the model’s output (e.g. the logit difference between the correct and incorrect answer). By scanning over heads, one can find which head’s information is crucial. Often this is visualized as a heatmap of head vs. effect on output (How-to Transformer Mechanistic Interpretability—in 50 lines of code or less! — AI Alignment Forum) (How-to Transformer Mechanistic Interpretability—in 50 lines of code or less! — AI Alignment Forum).

Assumptions: It is assumed that heads operate somewhat independently, so swapping one head’s output meaningfully isolates its contribution. In reality heads interact (via residual addition), but if one head carries a distinct piece of information, patching just that head can reveal its role. As with any patching, it assumes that inserting the clean head output doesn’t introduce side-effects beyond carrying the intended info (attention head outputs are linear combinations of values, so this is usually fine, aside from downstream layernorm changes). Applications: This method has been used to identify specific heads that implement known algorithms. For example, in the IOI task, researchers found a particular early-layer head that copies the subject name to an intermediate position, and another head that later uses it (How-to Transformer Mechanistic Interpretability—in 50 lines of code or less! — AI Alignment Forum). By patching heads one at a time, they discovered head 1.6 was highly important for that task (How-to Transformer Mechanistic Interpretability—in 50 lines of code or less! — AI Alignment Forum). Similarly, head patching was instrumental in discovering “induction heads” (heads that learn to attend to previous occurrences of a token to complete sequences) – by patching out or swapping certain heads, researchers saw the model fail to continue repeated sequences, pinpointing those heads as the mechanism (How-to Transformer Mechanistic Interpretability—in 50 lines of code or less! — AI Alignment Forum) (How-to Transformer Mechanistic Interpretability—in 50 lines of code or less! — AI Alignment Forum). Head patching is also used in analyzing factual recall: e.g., if a late transformer layer has an attention head that pulls relevant fact information from earlier context, swapping that head’s output can toggle whether the model recalls the fact.

Example: In a translation model, suppose we suspect a certain head aligns subjects between source and target. We take a sentence pair with a subject and run a correct translation (clean) and a jumbled one (corrupt). For each head, we replace the corrupt model’s head output with the clean model’s at the same position and layer. If doing this for head fixes the translation, that head likely conveys subject alignment. We might find, for instance, that a head in layer 5 is solely responsible for carrying gender information of a pronoun from earlier in the sentence to where it is needed later (patching that head’s output from a sentence with “he” vs “she” could flip the translated pronoun gender). Relation to Activation Patching: Attention head patching is essentially a finer-grained activation patch. Instead of swapping the whole residual stream, we only swap the contribution of one attention head. This provides more targeted insight (which head specifically, rather than which entire layer). However, it requires instrumentation of the model to separate a single head’s output (which tools like TransformerLens provide).

2.3 Causal Tracing (Localized Patching for Tracing Information Flow)

Purpose: Causal tracing (as introduced by Meng et al., 2022 (Locating and Editing Factual Associations in GPT)) is a systematic method to trace the path of specific information through a network. The goal is to find which intermediate states (at which layers and positions) carry a piece of information that eventually influences the output. This is often used to locate where a factual association or feature is stored in a model. Mechanism: Causal tracing runs the model on a corrupted input (one designed to remove the information of interest) and then restores individual activations from the original input to see if the output is “repaired” (Locating and Editing Factual Associations in GPT).

For example, to find where the model stores the fact “Paris is the capital of France,” one might take a prompt “Paris is the capital of [MASK]” and corrupt it to “Paris is the *** of [MASK]” (nonsense input so the model can’t answer). Then for each layer and position, we copy the activation from the clean prompt (with “capital”) into the corrupted run at that layer/position, and check if the output now correctly says “France.” By doing this for all candidate states, we identify a small set of states whose restoration most improves the output (Locating and Editing Factual Associations in GPT). This set is interpreted as the path through which the factual info flows in the model. Meng et al. implemented this by a series of forward passes: one where all states are corrupted (model fails), and many where one state is restored at a time (Locating and Editing Factual Associations in GPT). The difference in output (usually measured as logit or probability of the correct answer) when a given state is restored indicates how much that state causally contributes* to the knowledge (Locating and Editing Factual Associations in GPT). Notably, they found two key locations (“early MLP” and “late attention”) that, when restored, recovered the fact, suggesting the model first stores the fact in an MLP vector then uses an attention head to move it to the output position (Locating and Editing Factual Associations in GPT).

Assumptions: Causal tracing assumes that one can “frustrate” the model’s ability to use a piece of knowledge by corrupting many states, and then that restoring a single state from the clean run will have a meaningful effect if that state was part of the knowledge path (Locating and Editing Factual Associations in GPT). This method isolates direct causal influence under the assumption of roughly linear superposition of effects (if many things are corrupted, adding one piece back helps in proportion to its importance). It also assumes that the corrupted baseline is a reasonable proxy for the model “not having the info.” Designing the corruption carefully (so that the model is indeed missing only that info) is important.

Applications: The original application was to factual recall in GPT-XL (Rome paper) (Locating and Editing Factual Associations in GPT) (Locating and Editing Factual Associations in GPT). They traced factual knowledge and discovered that for factual questions, certain mid-layer MLP neurons encode the fact’s “value,” which is later extracted by attention heads. This was seminal in understanding where factual knowledge resides (e.g. in GPT, around layers 10–12 in certain MLPs for specific facts). Causal tracing can be applied to any multi-step inference – e.g., tracing how a math solution is carried through layers, or how a specific token’s information (like subject-verb number) travels. Another application is debugging: if a model makes a mistake (say a reasoning error), causal tracing can highlight which internal step failed by showing where a correct activation would have fixed the mistake.

Comparison to activation patching: Causal tracing is like an exhaustive, structured form of activation patching. Instead of trying one layer at a time, it corrupts everything and restores one at a time to systematically see the effect of each node. It provides a path-level view: by identifying multiple points that together restore performance, one can infer a chain of causal dependence. Standard activation patching might find “layer 10 matters,” but causal tracing can say “layer 10 neuron N and layer 20 attention head H specifically carry the info.” Essentially, causal tracing yields a step-by-step causal chain rather than just one important layer. Meng et al. validated such chains and even used them to guide model editing (see ROME in that work).

Limitations: Causal tracing requires many forward passes (one per candidate state), which can be expensive. It also relies on having a good corrupted baseline (if the corruption accidentally allows the model to answer correctly via another route, the method might miss the true path). And because all upstream is corrupted, interactions between multiple states are not captured (they restore one at a time, not combinations, although iterative versions can restore multiple sequentially).

2.4 Causal Mediation Analysis (CMA)

Purpose: Causal mediation analysis in neural networks aims to quantify how much of an input’s effect on the output is transmitted via a specific mediator (e.g. a subset of neurons or heads) versus other pathways (Investigating Gender Bias in Language Models Using Causal Mediation Analysis). This is rooted in Pearl’s mediation analysis: given input affects output possibly through mediator , how much of the effect is through (indirect) vs. not through (direct)? In interpretability, the “mediator” is typically an internal component hypothesized to carry some information (like a neuron representing gender).

Mechanism: The classic approach (as in Vig et al., 2020 (Investigating Gender Bias in Language Models Using Causal Mediation Analysis) (Investigating Gender Bias in Language Models Using Causal Mediation Analysis)) is: 1. Do an intervention on the input (e.g. change a word or attribute) and measure the total effect on output . 2. Intervene to fix the mediator so that it doesn’t change between and the altered . This is done by running the model on but overwriting (or forcing it to same values as in run). 3. Measure the output difference in this scenario. This yields the direct effect (effect of on not through ). 4. The difference between total effect and direct effect is the indirect effect via ([2301.04709] Causal Abstraction: A Theoretical Foundation for Mechanistic Interpretability). In practice, one often performs two forward passes: one normal with input and one where, at the layer of , the activation is replaced with that from input (ensuring doesn’t carry the influence of the change) (Investigating Gender Bias in Language Models Using Causal Mediation Analysis). By comparing outputs: - If the output still changes a lot even when is held fixed, then was not the main pathway (effect went outside ). - If the output barely changes when is fixed (compared to total change), then carried most of the influence.

Assumptions: CMA in neural contexts assumes we can isolate a mediator cleanly. It requires that setting to the value from one run breaks any feedback loop properly (no other hidden confounders, akin to a causal graph assumption) ([2301.04709] Causal Abstraction: A Theoretical Foundation for Mechanistic Interpretability). In neural nets, one must also assume that only the mediator changes significantly between the two input conditions, or else holding it fixed is meaningful. Often, researchers identify specific neurons or heads as and assume others form the complementary set. Another assumption is linear additivity of effects so that this partition (direct/indirect) is sensible – though CMA is designed to handle nonlinearity by intervention, in practice neural nets might violate the “no interaction” assumption needed for clean separation (they attempt to mitigate this by careful experimental design).

Applications: Vig et al. (2020) used CMA to study gender bias in language models (Investigating Gender Bias in Language Models Using Causal Mediation Analysis) (Investigating Gender Bias in Language Models Using Causal Mediation Analysis). They treated the presence of a gendered word in input as the causal variable, the model’s output (like a gender-specific pronoun or occupation prediction) as , and tested mediators like specific neurons or attention heads. By fixing those mediators to neutral values, they measured how much gender information flowed through them. They found, for example, that a small subset of neurons mediated a large fraction of the gender bias effect (Investigating Gender Bias in Language Models Using Causal Mediation Analysis). Similarly, CMA has been applied to arithmetic reasoning (e.g. identifying which MLP layers mediate the effect of numbers on the final answer) (A Mechanistic Interpretation of Arithmetic Reasoning in Language Models using Causal Mediation Analysis | OpenReview) (A Mechanistic Interpretation of Arithmetic Reasoning in Language Models using Causal Mediation Analysis | OpenReview). Another use is in model editing or debiasing: CMA can tell us which components to target for intervention by revealing where undesired influences (like bias) concentrate (Investigating Gender Bias in Language Models Using Causal Mediation Analysis).

Interpretation: If mediator is “the set of neurons in layer 5,” CMA might show that, say, 70% of the effect of changing the input’s gender from male to female on the output is carried by those layer-5 neurons (meaning if you lock those neurons, the output doesn’t change much when swapping gender, implying the change traveled through them) (Investigating Gender Bias in Language Models Using Causal Mediation Analysis) (Investigating Gender Bias in Language Models Using Causal Mediation Analysis). The remaining 30% might be direct (through other pathways). This gives a quantitative measure of causal responsibility of that layer or component. It’s a more global/statistical measure than single-instance patching: often CMA is done over a dataset to get average mediated effect.

Comparison to patching: Technically, the act of “holding fixed” in step (2) is a form of patching (inserting the activation from condition into run ). Thus, CMA can be seen as a structured use of patching with a specific causal interpretation framework. While activation patching usually explores many components to find important ones, CMA starts with a candidate mediator and quantifies its contribution to an already observed effect. It’s also typically used to test a hypothesis (“Does this neuron mediate this effect?”) with statistical significance, whereas patching often is exploratory. Limitations: CMA usually needs well-defined binary/intervention scenarios, and it may not easily handle complex interactions among multiple mediators without more advanced analysis. Additionally, doing CMA for many mediators separately can be as expensive as patching all of them one by one. The interpretation of indirect effect can get tricky if mediators interact (there are techniques to handle multiple mediators, but those get complex). Nonetheless, CMA provides a rigorous language for claims like “X% of the effect of concept A on output B is due to component C,” which is very appealing for interpretability analysis (Investigating Gender Bias in Language Models Using Causal Mediation Analysis).

2.5 Constrained Patching in Circuit Tracing

Purpose: Constrained patching is the method used in Circuit Tracing (Ameisen et al., 2025) to test interventions on feature nodes while avoiding “second-order effects” that could obscure interpretation (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). The goal is to steer the model’s computation by altering a feature’s activation within a specified range of layers, without allowing that change to cause additional unintended changes in the same range. This is used to validate the attribution graph: e.g. if a feature strongly influences feature in the graph, then boosting (in a controlled way) should cause a corresponding change in (and ultimately in output) empirically, without side-effects.

Mechanism: Constrained patching works within the local replacement model described in Part 1. The key idea is to modify a feature’s value while clamping the network’s responses in the patched region to prevent feedback. For example, say we want to amplify a feature from layer 3 through layer 5. In a multiplicative constrained patch, we might multiply ’s activation by some factor at its origin (layer 3) (Circuit Tracing: Revealing Computational Graphs in Language Models). Then, for layers 3 through 5 (the patch range), we prevent any other feature from re-reacting to this change within that range. Specifically, the method ensures that the only change in layer 4 and 5 comes directly from ’s increased contribution, not from other features getting differently activated because changed. This is accomplished by using the linear CLT framework: when is boosted, the model’s MLP outputs in layers 3–5 are adjusted by ’s extra decoder contribution, but the encoders of other features are essentially “clamped” so that their activations remain at the original values (stop-gradient is applied so they don’t recompute on the altered residual) (Circuit Tracing: Revealing Computational Graphs in Language Models). Additionally, any error correction that was present is also adjusted so that outside the patched range, the model’s state remains consistent with a valid computation. In simpler terms, constrained patching says: “Inject this change, but do not let the network recalculate anything differently because of it until after layer 5.” From layer 6 onward, the network runs normally, so we can observe the effect of the change on later layers and the output.

By comparing to the unpatched run, we measure the causal effect of that feature within that range. A concrete procedure for constrained patching might be:

  • Pick a feature node (layer ) to intervene on, and pick an end layer for the patch range.
  • In the forward pass on prompt p, when computing ’s activation at , scale it by some factor (or set it to a desired value).
  • For every layer , when the CLT reconstructs the MLP output, use the original values for all other features and error nodes. Essentially, only ’s contribution is changed; the residual contributions of other features in that range are clamped to their original forward-pass values.
  • After layer , allow the model to continue normally (though attention patterns and layernorm are still the original ones as per the local model design). By doing this, we ensure that within [], no new features turn on or off in response to ’s change (no “knock-on” activation changes) (Circuit Tracing: Revealing Computational Graphs in Language Models). The only difference is the direct linear addition from . Thus, any change observed in a downstream feature at layer > or in the output can be attributed to the direct influence of within that patch range.

Error Correction: Importantly, because the local replacement model included error nodes to make the unmodified computation exact, constrained patching must handle them carefully. In practice, since we clamp other features, we likely also fix the error node contributions in the patch range to what they were originally (or adjust them minimally) so that we’re not introducing inconsistencies. The Anthropic team notes that if the patch range includes all features of a certain group, then their activations don’t change – demonstrating the “constrained” nature (Circuit Tracing: Revealing Computational Graphs in Language Models). Essentially, any discrepancy caused by not letting features update is absorbed by the error correction term rather than propagating to confuse the experiment.

Stop-Gradient Usage: Constrained patching leverages the fact that in the local model, nonlinearities are stop-grad. During the patch, they do not recompute feature encoders, effectively freezing them. It also continues to use the fixed attention pattern. This means attention heads do not change whom they attend to when a feature is boosted – they will carry more or less signal from , but along the same connections as before, since queries/keys remain the same. This is crucial to isolate the effect of “more of feature ’s value” without altering why or where it flows. In contrast, an unconstrained patch might boost and then the model might, say, change an attention pattern to focus more/less on (a second-order effect), muddying attribution. Constrained patching avoids that by freezing attention patterns (QK) and normalization in the patched layers (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models).

Applications: In Circuit Tracing, constrained patching is used to validate attribution graph hypotheses. For instance, if the graph suggests feature A strongly causes feature B, they can try inhibiting feature A in the range up to B and see if B’s activation (and the final behavior) drop accordingly (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). They do this for groups of features (“supernodes”) as well: e.g., patching a entire group of related features to zero to see if a certain output is prevented (Circuit Tracing: Revealing Computational Graphs in Language Models). Because constrained patching yields a clean, linear-like effect, they can compare the magnitude of change to what the linear model predicted. They found that patching results generally correlate well with the attribution edge weights, at least for short ranges (for longer ranges, errors accumulate) (Circuit Tracing: Revealing Computational Graphs in Language Models). This provides evidence that their attribution graph edges had causal meaning. Another use is “steering” model behavior. By boosting a feature or set of features in a controlled way, they explored altering the model’s output (for example, amplifying certain addition-carry features in a calculation to see if the sum output changes as predicted). Constrained patching ensures that this steering is focused and doesn’t accidentally trigger unrelated computations.

Differences from Other Methods: Constrained patching is distinct in a few ways: - It operates on the feature-level abstraction (monosemantic features from the CLT) rather than raw neurons or head outputs. This means the interventions are more interpretable (activating a “X is location” feature vs. toggling 117th neuron). - It freezes internal nonlinearities within the patch region. Other methods typically let the model’s internals adjust freely to the patched activation, which can cause interactive effects. Constrained patching explicitly prevents those within the range of interest, yielding a purer cause-effect relationship that matches the linearized graph assumptions (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). - It includes error nodes to absorb any mismatch, ensuring the model’s overall computation outside the patch remains consistent. Standard patching doesn’t have an analogue of error nodes; any mismatch just propagates and could distort results. In constrained patching, if our intervention would have caused, say, an MLP output to deviate in a way that normally would trigger another feature, the error node can fill in the difference so that other features don’t see a changed input. This is a subtle but powerful mechanism to isolate effects. - Because it uses the CLT framework, it naturally ignores QK-circuit effects. Many patching experiments implicitly include QK effects (e.g. changing a residual can change attention weights). Constrained patching’s stop-grad on attention patterns means it strictly measures OV-circuit influence, which aligns with the attribution graph focus on information content rather than control signals (Circuit Tracing: Revealing Computational Graphs in Language Models).

Assumptions: Constrained patching assumes the replacement model is a faithful representation of the real model’s computation for that prompt (which it is by construction, plus error). It also assumes linear additivity of feature contributions within the patch range, which is enforced by how the patch is applied. Essentially, it is assuming the attribution graph’s linear model is locally valid, and then testing interventions under that assumption. There is an assumption that no important dynamics occur from allowing features to re-equilibrate — in other words, by not letting other features respond, we might be excluding some compensatory behaviors the model would normally have. But that’s intentional: the aim is to measure the direct effect of a feature as if it were an independent input.

Example: Suppose in an addition problem, the graph shows a “carry bit” feature at layer 4 influences a “sum tens place” feature at layer 6. To verify this, we can do constrained patching: zero out from layer 4 through 6 (patch range) and see if the model’s predicted sum drops in the tens place. We apply the patch by setting at layer 4 and preventing any other feature from changing in layers 4–6. As a result, when the model reaches layer 6, feature should now be missing the carry input and (if the graph was correct) the final answer’s tens digit should be wrong. Indeed, if we observe the logit for the correct answer’s tens digit falls significantly relative to an unpatched run, that confirms ’s causal role. At the same time, because we did it in a constrained way, the rest of the model’s computation (ones place, etc.) remains as in the original, isolating the effect to the tens logic.

In summary, constrained patching in Circuit Tracing is a refined intervention technique that adds a desired perturbation and uses the linearized, error-corrected model to suppress any side-effects in the region of intervention. This is in contrast to standard causal patching where a change can ripple through nonlinear components. The benefit is that the observed changes can be directly compared to the attribution graph’s linear predictions. The authors report that this yields more interpretable and stable results, at the cost of requiring the CLT machinery and being limited to the features that the CLT has learned (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models).

2.6 Summary of Differences

To highlight the key differences, consider what happens if we want to test a hypothesis “Feature/neuron X causes outcome Y” with each method:

  • Activation Patching: We would run a forward pass with X in normal state and another where we replaced X with an alternate version (from a different context or ablated). We let the network continue and see if Y changes. This is easy to do and directly tests causality, but if Y changes, we know X influenced Y somehow – interpreting the route of influence may require further analysis, since other parts of the network also changed in response. No special precautions are taken to isolate X’s effect; the network can react freely.
  • Causal Tracing: We would design a scenario where normally Y doesn’t happen (because we corrupted input) and then try restoring X to see if Y is rescued. If yes, X is on the path to Y. This is a more systematic search that finds not just X but possibly a sequence {X, Z, …} that together restore Y. It uses many interventions to map a path and gives richer insight, at the cost of more experimentation.
  • Causal Mediation Analysis: We would measure how Y changes when we intervene on the input (say, introduce a factor that should affect Y), then measure again when we neutralize X’s activation during that change. The difference tells us how much of input’s effect on Y went through X. This gives a percentage or importance score to X’s role. It’s quite principled and aggregate, but requires clear definition of input change and mediator.
  • Constrained Patching: We directly set feature X’s value to a different level (or zero) and prevent the network from compensating for this change in the intervened layers. We then observe how Y changes down the line. Because nothing else in those layers changed except X’s contribution, we can attribute the change in Y to X’s influence. This method is deeply tied to the specific feature representation learned by CLT and uses the full replacement model to ensure consistency. It’s particularly useful for additive decompositions like attribution graphs: each edge weight predicted a certain effect, and constrained patching essentially realizes that exact linear effect in practice to confirm it.

From a higher-level perspective:

  • Traditional causal patching techniques (activation/head patching, tracing, CMA) work directly on the original model and often allow or even rely on the model’s natural computations during the intervention. They can be seen as external probes: we poke the model and watch what happens.
  • Constrained patching is more of an embedded intervention: it modifies the model with internal scaffolding in place. By using the replacement model’s linear approximation, it is almost performing the experiment in a hypothetical linear version of the model, then mapping it back to the real outcome. This yields results that are easier to interpret with the linear graph (since the experiment was done under linearized conditions), at the cost of requiring that linearization (the CLT) to be available and accurate for the prompt.

In terms of error correction and clamping:
Constrained patching’s unique strength is that it preserves the validity of other features and the overall computation while making a targeted change. Other methods typically do not correct for the intervention’s side effects. For example, if we zero out a neuron in vanilla activation patching, other neurons in the next layer will see a different input sum and might change their activation in a nonlinear way; we don’t correct for that. In constrained patching, if we zero out a feature’s contribution, the error node ensures the rest of the network at that layer still sees the same total input as before (aside from that feature’s missing piece), preventing a cascade of unintended changes. This leads to more precise attribution of causal effect – essentially measuring exactly what the linear attribution predicted.

Overall, all these techniques share a common idea of intervention to test causality, but they differ in granularity and control:

References: - Ameisen, E., et al. 2025. “Circuit Tracing: Revealing Computational Graphs in Language Models.” (Methods blog) – introduced constrained patching and attribution graphs (Circuit Tracing: Revealing Computational Graphs in Language Models) (Circuit Tracing: Revealing Computational Graphs in Language Models). - Meng, Z., et al. 2022. “Locating and Editing Factual Associations in GPT.” – demonstrated causal tracing to find factual memory paths (Locating and Editing Factual Associations in GPT) (Locating and Editing Factual Associations in GPT). - Vig, J., et al. 2020. “Investigating Gender Bias in Language Models Using Causal Mediation Analysis.” – applied CMA to identify neurons mediating bias (Investigating Gender Bias in Language Models Using Causal Mediation Analysis) (Investigating Gender Bias in Language Models Using Causal Mediation Analysis). - Wang, K., et al. 2023. “Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 Small.” – used activation and head patching to discover an IOI circuit (identifying key attention heads) (How-to Transformer Mechanistic Interpretability—in 50 lines of code or less! — AI Alignment Forum). - Chan, A., et al. 2022. “Causal Scrubbing” – another related approach (not detailed above) using intervention sets to rigorously test hypothesized circuits, highlighting the growing toolkit of causal analysis in interpretability.