Paper deep dive
APP: Accelerated Path Patching with Task-Specific Pruning
Frauke Andersen, William Rudman, Ruochen Zhang, Carsten Eickhoff
Models: GPT-2 Medium, GPT-2 Small
Intelligence
Status: succeeded | Model: google/gemini-3.1-flash-lite-preview | Prompt: intel-v1 | Confidence: 96%
Last extracted: 3/11/2026, 12:43:50 AM
Summary
Accelerated Path Patching (APP) is a hybrid method for mechanistic interpretability that combines Contrastive-FLAP pruning with traditional Path Patching. By using pruning to reduce the search space of attention heads by approximately 56%, APP achieves significant computational speedups (up to 93%) while maintaining the minimality and performance of circuits discovered by standard Path Patching.
Entities (5)
Relation Signals (3)
Accelerated Path Patching â uses â Contrastive-FLAP
confidence 100% ¡ APP first applies Contrastive-FLAP to reduce the search space on required for circuit discovery algorithms
Path Patching â identifies â Circuits
confidence 95% ¡ Path patching is one of the most widely used techniques for circuit discovery
Contrastive-FLAP â improves â Path Patching
confidence 95% ¡ APP, applies traditional Path Patching on the remaining attention heads, leading to a speed up of 59.63%-93.27%
Cypher Suggestions (0)
No Cypher suggestions yet.
Abstract
Abstract:Circuit discovery is a key step in many mechanistic interpretability pipelines. Current methods, such as Path Patching, are computationally expensive and have limited in-depth circuit analysis for smaller models. In this study, we propose Accelerated Path Patching (APP), a hybrid approach leveraging our novel contrastive attention head pruning method to drastically reduce the search space of circuit discovery methods. Our Contrastive-FLAP pruning algorithm uses techniques from causal mediation analysis to assign higher pruning scores to task-specific attention heads, leading to higher performing sparse models compared to traditional pruning techniques. Although Contrastive-FLAP is successful at preserving task-specific heads that existing pruning algorithms remove at low sparsity ratios, the circuits found by Contrastive-FLAP alone are too large to satisfy the minimality constraint required in circuit analysis. APP first applies Contrastive-FLAP to reduce the search space on required for circuit discovery algorithms by, on average, 56\%. Next, APP, applies traditional Path Patching on the remaining attention heads, leading to a speed up of 59.63\%-93.27\% compared to Path Patching applied to the dense model. Despite the substantial computational saving that APP provides, circuits obtained from APP exhibit substantial overlap and similar performance to previously established Path Patching circuits
Tags
Links
Trouble viewing inline? Open PDF directly â
Full Text
67,223 characters extracted from source content.
Expand or collapse full text
APP: Accelerated Path Patching with Task-Specific Pruning Frauke Andersen â1 , William Rudman â2 , Ruochen Zhang â3 , Carsten Eickhoff 1 1 University of TĂźbingen, 2 The University of Texas at Austin, 3 Brown University william.rudman@utexas.edu Abstract Circuit discovery is a key step in many mecha- nistic interpretability pipelines. Current meth- ods, such as Path Patching, are computation- ally expensive and have limited in-depth circuit analysis for smaller models. In this study, we propose Accelerated Path Patching (APP), a hy- brid approach leveraging our novel contrastive attention head pruning method to drastically re- duce the search space of circuit discovery meth- ods. Our Contrastive-FLAP pruning algorithm uses techniques from causal mediation analysis to assign higher pruning scores to task-specific attention heads, leading to higher performing sparse models compared to traditional pruning techniques. Although Contrastive-FLAP is suc- cessful at preserving task-specific heads that existing pruning algorithms remove at low spar- sity ratios, the circuits found by Contrastive- FLAP alone are too large to satisfy the mini- mality constraint required in circuit analysis. APP first applies Contrastive-FLAP to reduce the search space on required for circuit discov- ery algorithms by, on average, 56%. Next, APP, applies traditional Path Patching on the remain- ing attention heads, leading to a speed up of 59.63%-93.27% compared to Path Patching ap- plied to the dense model. Despite the substan- tial computational saving that APP provides, circuits obtained from APP exhibit substantial overlap and similar performance to previously established Path Patching circuits. 1 2 1 Introduction A central focus of mechanistic interpretability re- search (Elhage et al., 2021; Olah, 2022) is the study of minimal subgraphs, or circuits, within Large Language Models (LLMs) to identify the inter- nal mechanisms responsible for particular func- tions (Elhage et al., 2021; Olah, 2022). Circuits consist of subsets of model components, such as 1 Equal contribution. Order determined by coin flip. 2 Code:https://github.com/Frau- Ke/AcceleratedPathPatching attention heads or feed-forward layers, that can largely account for a modelâs performance on cer- tain tasks (Vig et al., 2020; Wang et al., 2022; Hanna et al., 2023). Locating these components within a highly overparameterized LLM is compu- tationally expensive. To verify whether a particular component belongs to a circuit, recent studies em- ploy techniques such as Path Patching (Goldowsky- Dill et al., 2023a; Wang et al., 2022), which re- quires multiple model runs to measure the causal effects of individual components. Since this pro- cess must be repeated for every component to fully outline a circuit, it quickly becomes prohibitively costly as we increase the number of parameters in a model. The objective of identifying a minimal, well- performing subnetwork aligns with pruning (Fran- kle and Carbin, 2018), which seeks to improve model efficiency by removing uninformative model components. Unlike circuit discovery methods, many pruning algorithms are computationally ef- ficient, requiring only a few forward passes and using weight- or activation-based heuristics (Zhu et al., 2024; Sun et al., 2024) to remove unim- portant model components. In this paper, we ex- plore the connection between Path Patching and unstructured pruning (Frantar and Alistarh, 2023; Sun et al., 2024; An et al., 2024) that are adapted to preserve full-attention heads, rather than fo- cusing on algorithms that target individual model weights (Zhu et al., 2024). Specifically, we em- ploy FLAP (An et al., 2024) to investigate whether pruning alone can recover minimal circuits. We demonstrate that, under the same performance bud- get, circuits obtained through pruning are signifi- cantly larger than those identified via path patching. Namely, pruning cannot truly recover minimal cir- cuits. By comparing FLAP-generated circuits to those produced by Path Patching, we observe that FLAP often removes task-specific heads that are critical 1 arXiv:2511.05442v1 [cs.LG] 7 Nov 2025 for subnetwork performance. These task-specific heads only activate when exposed to a particu- lar input and often implement specialized, inter- pretable functions. Although pruning alone can- not reduce an LLM to its minimal subnetwork, it can serve as an effective preprocessing step that substantially reduces the search space for circuit discovery. Building on this insight, we propose Accelerated Path Patching (APP), which incorpo- rates pruning our novel Contrastive-FLAP pruning algorithm as a preliminary stage of the patching process. Contrastive-FLAP utilizes the contrastive minimal-pair setup commonly used in causal me- diation analysis to target task-specific heads found by Path Patching. Using APP for circuit discovery recovers minimal circuits with comparable perfor- mance to Path Patching while reduces computa- tional costs by up to 93%. Our main contributions are as follows: ⢠We provide a detailed analysis of the differ- ences between path patching and the most closely related attention-head pruning algo- rithm, FLAP, showing that pruning alone fails to recover minimal circuits. â˘We propose Contrastive-FLAP to better pre- serve task-specific attention heads that are oth- erwise pruned at low sparsity ratios. â˘We replace the original Path Patching search space with the union set identified by Contrastive-FLAP and FLAP. By incorporat- ing pruning as a prior step, we introduce APP, which significantly reduces search cost while faithfully recovering minimal circuits. 2 Related Work 2.1 Circuits In transformer models, circuits refer to compu- tational subgraphs that implement specific, often human-interpretable, behaviors (Olah et al., 2020). Depending on the level of granularity, nodes in these graphs may correspond to attention heads, MLPs, or even individual query, key, and value activations (Conmy et al., 2023). Edges typically represent residual connections, linear projections on the residual stream, or interactions within atten- tion and MLP blocks (Elhage et al., 2021). Path patching is one of the most widely used techniques for circuit discovery (Vig et al., 2020; Geiger et al., 2021; Wang et al., 2022; Hanna et al., 2023). The method localizes model components that causally influence the output by contrasting clean and corrupted input pairs. It involves caching activations for both inputs and selectively replac- ing the activations of individual components (e.g., heads) in the clean run with those from the cor- rupted run. This process identifies components whose intervention most significantly alters the fi- nal logits. When combined with logit attribution techniques (Nostalgebraist, 2020; Yu et al., 2023; Zhang et al., 2024; Golovanevsky et al., 2025), path patching enables fine-grained functional interpre- tations of model behavior. For instance, in the IOI (Indirect Object Identification) task, Wang et al. (2022) identify interpretable head types such as previous token heads and name mover heads. However, circuit discovery still remains com- putationally expensive.Recent methods like ACDC (Conmy et al., 2023) aim to automate this process by iteratively applying activation patch- ing while pruning components with sub-threshold effects. However, circuits discovered via such auto- mated approaches can be noisy and may omit com- ponents whose contributions to the logits negatively impact model performance. Other works (Syed et al., 2023; Hanna et al., 2024) explore related automated techniques focusing on edge-level lo- calization rather than component-level discovery, which is a complementary but distinct research fo- cus from this paper. 2.2 Pruning Pruning refers to the process of reducing a modelâs size or computational complexity while preserv- ing overall performance. It can be broadly cate- gorized as unstructured, semi-structured, or struc- tured (Zhu et al., 2024). Unstructured pruning (Sun et al., 2024; Frantar and Alistarh, 2023) removes individual parameters, resulting in irregular sparse connectivity that often requires retraining or spe- cialized sparse kernels when applied at high spar- sity. Structured pruning, in contrast, removes en- tire model components, such as attention heads (An et al., 2024), channels (Ma et al., 2023), or even full layers (Fan et al., 2019), yielding more hardware- efficient architectures. Semi-structured pruning combines aspects of both approaches. Since our goal is to compare pruning methods that operate at the attention-head level, similar to circuit discovery via path patching, we focus on structured, one-shot pruning techniques, specifi- cally Fluctuation-based Adaptive Structured Prun- 2 Figure 1: Depiction of the Accelerated Path Patching (APP) Algorithm. APP reduces the search space of circuit discovery methods by successfully pruning task-irrelevant heads while preserving task-critical attention heads. APP then runs Path Patching on the remaining sparse model. TaskPromptCorrupted PromptLD = L(correct) - L (wrong) IOI When John and Mary went to the store, John bought a drink for ... When John and Mary went to the store, Alex bought a drink for ... L(Mary) - L(John) Greater ThanThe war lasted from 1873 to 18...The war lasted from 1801 to 18...L(x|(x > 73)â§ (x⤠98)) - L(x|x⤠73) Gendered PronounsSo Emily is such a good friend, isnât ...That Person is such a good friend, isnât ...L(she) - L(he) InductionToday, Claire visited the library. There Cl...Today, Claire visited the library. There Tr...L(aire) - L(istan) Docstring def old(self, first, page, names, size, files, read): """sector gap population :param page: message tree :param names: detail mine :param ... def old(self, first, project, target, new, files, read): """sector gap population :param image: message tree :param update: detail mine :param Wrong Variables = first, page, names, files, read, project, target, new L(size)âarg max xâWrong Variables L(x) Table 1: Example prompts and the logit differences for all five tasks used in this work. Logit Difference (LD) is defined by the difference between the logits of the correct and wrong answer. ing (FLAP) (An et al., 2024). FLAP eliminates the need for retraining by computing an impor- tance score for each attention head, which inte- grates both weight magnitude and activation statis- tics (Sun et al., 2024). Heads with the lowest scores are pruned iteratively until a target sparsity ratio is reached. Finally, FLAP introduces a bias correc- tion term to each layer to mitigate pruning-induced errors. In this work, we omit this final correction step, as our objective is to use the pruning deci- sions themselves to identify functionally important components for circuit discovery. 3 Methodology 3.1 Experimental Setup Models & Tasks In this paper, we conduct all patching experiments using four models: GPT-2 Small, GPT-2 Large, Qwen2.5-0.5B, and Qwen2.5- 7B. We include the GPT-2 family (Radford et al., 2019) since it has been extensively used in prior mechanistic interpretability research, and well- characterized circuits have been identified in GPT-2 Small. The Qwen2.5 models (Yang et al., 2024) are selected for their strong performance across a range of downstream tasks. We evaluate these models on five benchmark tasks commonly used in mechanis- tic interpretability: Indirect Object Identification (IOI) (Wang et al., 2022), Greater Than (Hanna et al., 2023), Gendered Pronouns (Mathwin et al., 2023), Induction (Goldowsky-Dill et al., 2023b), and Docstring (Heimersheim and Janiak). Each of these tasks contains a paired clean setD clean and a corrupted setD corr , which is identical except that the task-relevant information is removed. See Table 1 for a brief description and A for a long description of the individual tasks. Metrics We quantify patching effects using the average logit difference (LD) over all samples for a given task. LetX clean denote the correct answer for the clean input and letX corr be the correct answer for the corrupted input. LetL(X clean ,X corr ) = Logit(X clean ) - Logit(X corr ) . Logit difference is then defined asL â (X clean ,X corr )-L Ⲡ(X clean ,X corr ) whereL â andL Ⲡdenote logits from the patched and the corrupted runs. A positive score means that the model predicts the correct answer with a higher probability than the incorrect answer. Dif- ferent LD implementations for various tasks are discussed in the Appendix A. In addition to using LD as our measure for circuit inclusion, we use 3 (a) clean: Previous Token Head (b) corrupted: Previous Token Head (c) contrastive: Previous Token Head (d) clean: Induction Head(e) corrupted: Induction Head(f) contrastive: Induction Head Figure 2: Activation Patterns of context-insensitive (top) and context-senstive (bottom) heads. Left: clean activations, middle: corrupted activations, right: contrastive activations. Figure 3: Performance and TP over a sparsity of 0 to 1 for vanilla and contrastive FLAP. Points are the fixed sparsity used in Table 2, dotted lines are the sparsity ratios found via cliff points. average LD to measure the patching effect during P and circuit performance. To evaluate circuit performance, all heads in the model, except for the ones included in the circuit are set to the corrupted activations. Performance is measured by the per- centage of the original, average LD restored by the patched model. 3.2 Circuit Discovery with Path Patching Activation patching and causal mediation analy- sis using contrastive minimal pairs form the basis for many circuit discovery methods. Activation patching measures the causal influence of model components by replacing their activations with cor- rupted ones and comparing the resulting output. Path Patching (P) (Wang et al., 2022; Goldowsky- Dill et al., 2023a) extends this idea by tracing in- formation flow along specific computational paths. A path is defined by a sender nodepand a re- ceiver noder. During a forward pass on the clean dataset,D clean , activations atpare replaced with those from the corrupt dataset,D corr . A large logit difference between the patched and unpatched runs indicates thatpcausally affectsr. P is applied iteratively, starting from the final logits as receivers and all attention heads as senders. Heads with a causal effect become the new receivers, and ear- lier heads become senders. In this study, we apply P only to attention heads and exclude MLPs. To reduce the manual effort required for circuit dis- covery, we use an iterative version of P proposed by Zhang and Nanda (2024), which determines in- clusion criteria based on the standard deviation of the average patching effect, referred to as Auto- matic P. We further adapt this procedure using two thresholding criteria to determine circuit inclu- sion: the importance threshold and the maximum value threshold. First, the importance threshold is evaluated over each logit difference score x i,j |x i,j |â| Ě X| > Kâ SD(X) where Ě X andSD(X)denote the mean and stan- dard deviation calculated over all logit differences 4 respectively, andKis a predefined constant. At early layers in the model, the constant is adjusted to K Ⲡ= K + 2 â l s â H whereK Ⲡincreases asl s decreases. The adjusted constantK Ⲡis evaluated for each sender layerl s . This adjustment ensures that path patching focuses on sequential influence: components that are more distant from the receiver must meet stricter sig- nificance criteria to be included. For evaluation, K is set to[1, 1.5, 2, 2.5]. The second criterion, maximum value thresholds, ensures that at least one scorex i,j is above a chosen valueÎľ. Other- wise, no head for the current receiver will be in- cluded in the circuit. This prevents the inclusion of spurious or weakly contributing components in the constructed circuit. Values chosen forÎľare [0.01, 0.001, 0.02, 0.002] Heads that exceed both threshold are considered significant contributors to the modelâs behavior and are selected as receivers in subsequent iterations of the algorithm. Further details on automated path patching and comparisons between manual and automatic P are provided in Appendix C. Circuits discovered by Automatic P serve as the ground truth for pruning comparisons. 3.3 Contrastive FLAP Preserving context-sensitive, task-critical heads is necessary for discovering high-performing, mini- mal circuits. As discussed in Section B, context- sensitive heads produce different activations across clean and corrupted data, while context-insensitive heads remain constant. Figure 2 illustrates the ac- tivation patterns of an induction head in GPT-2 under clean and corrupted inputs, as well as the corresponding contrastive activations (clean - cor- rupted). Since FLAP is based purely on the weight and activation patterns, it is not guaranteed to pre- serve task-specific heads. In Appendix D.1.2, we show empirically that vanilla FLAP prunes task- specific, context-sensitive heads at higher sparsity ratios, leading to poor task performance. In order to preserve task-specific, context-sensitive heads, we propose Contrastive-FLAP. Contrastive-FLAP computes activation scores for both clean and cor- rupted inputs and derives final scores on the con- trastive activations (cleanâcorrupted). This pro- cedure effectively isolates task-specific heads, as context-insensitive heads exhibit near-identical ac- tivation patterns across clean and corrupted condi- tions, yielding negligible importance scores. Formally, letX clean âR (BĂS)ĂC in , be the input activation under the clean dataset, whereBis the batch size,Sis the sequence length andC in is the dimension of the input channel. Likewise, the input activations obtained by the corrupted dataset isX corr âR (BĂS)ĂC in andW âR (C out ĂC in ) is the weight matrix. Then, the importance scores for Contrastive FLAP Ě S are calculated by Ě S =|W i,j |â||X clean â X corr || 2 . Figure 2 (c) and (f) visualize that contrastive ac- tivations allow us to retain context-sensitive heads while excluding context-insensitive ones. In Ap- pendix D.1.2, we find that Contrastive FLAP in- deed excludes task-critical heads only at higher sparsity compared to vanilla FLAP. Determining Sparsity Ratios with Cliff Points In typical pruning scenarios, a sparsity ratio is pre- defined by the user. To determine the appropriate level of sparsity for contrastive pruning, we auto- matically select the sparsity ratio based on identi- fied cliff points. Cliff points indicate the removal of task-critical heads that are crucial for maintain- ing high-performance. Selecting a sparsity level just before the drop ensures these components re- main in the circuit. Additionally, a minimal sparsity level is set to 0.6 for both circuits. Using 0.6 as the minimum, we then consider three different cliff points are considered for evaluation: the first drop after 0.6, the biggest drop in performance after 0.6, and a fixed maximal sparsity value of 0.75. In Fig- ure 3, the first drop is visualized for vanilla and Contrastive-FLAP. 3.4 Can Pruning find Circuit Components? To investigate whether pruning can find circuit com- ponents, we first need to discover ground truth cir- cuits. In this section, we focus on only GPT-2 small since circuits are well studied with this model. Au- tomated P is evaluated over 100 random samples per task. Two hyperparameters are tested and from all resulting circuit, the smallest circuit with a per- formance of at least 75% accuracy is selected. If no circuit achieves 75% accuracy, we select the circuit that maximizes performance, while mini- mizing circuit size. Vanilla and contrastive FLAP are computed over 200 samples per task. Instead of fixing a specific sparsity value, sparsity is varied 5 between 0 and 1 in increments of 0.1. The small- est pruning circuit matching the performance of the path patching circuit is selected. Table 2 re- ports the performance, size, and the sparsity ratio of the vanilla and Contrastive FLAP. Circuit size is defined as the total amount of included attention heads, while sparsity ratio is defined as the percent- age of the model excluded from the circuit. If the circuit matches in size and a high TPR value is reported, FLAP circuits are similar to P circuits. Table 2 shows that P circuits are smaller than pruning circuits when performance is matched. The P circuits are at least 47.62% smaller than the vanilla FLAP circuits and at least 4.17% smaller than constrative FLAP. On average, vanilla FLAP retains 86.61% of the ground truth heads discov- ered with Path Patching while maintaining an av- erage sparsity of 0.45, while contrastive FLAP re- tains 86.17% of the ground truth heads with an av- erage sparsity of 0.68, indicating that Contrastive FLAP is better able to identify task-critical heads and remove task-irrelevant heads when compare to vanilla FLAP. For the Gendered Pronouns task, vanilla FLAP produces a much larger circuit (87 heads) than the ground truth, whereas Contrastive FLAP preserves only 38 heads while achieving higher accuracy (74.78% vs. 72.98% for vanilla FLAP). In this case, Contrastive FLAP maintains 100% of the heads contained in the ground truth, P circuit. Interestingly, for the Docstring task, Contrastive FLAP yields a circuit that outperforms the Path Patching (P) circuit in task performance despite having a lower TPR. This suggests that TPR alone is an insufficient metric for evaluating circuit overlap quality. Moreover, it indicates that the P circuit may not represent a unique or min- imal âgold-standardâ circuit since alternative sub- networks can achieve comparable or even superior task performance. Pruning cannot be used as an alternative for circuit discovery since the resulting circuits are too large and fail to satisfy the minimality constraint. More importantly, vanilla pruning identifies statis- tically important rather than causally relevant com- ponents, often removing context-dependent heads. While Table 2 demonstrates that Contrastive FLAP is better suited for identifying smaller circuits com- pared to FLAP, it still produces circuits that are too large compared to Path Patching. Further, the failure of pruning to replace path patching can be linked to how pruning overlooks the compositional structure of circuits and does not consider how Figure 4: Comparison of attention head types identified by Contrastive FLAP and Automatic Path Patching for the IOI task in GPT-2 small. multiple heads interact, whereas Path Patching ex- plicitly isolates these causal pathways. Pruning can approximate task performance but cannot re- cover the causal and functionally minimal circuits revealed by mechanistic discovery methods. In- stead of using pruning to replace Path Patching, we use both vanilla and Contrastive FLAP in tan- dem with circuit discovery methods to improve the efficiency of finding circuits. 4 Accelerated Path Patching (APP) Despite the improvements of Contrastive FLAP, Figure 3 shows that while successfully preserv- ing context-sensitive heads, some circuits depend on task-critical, yet context-insensitive heads that vanilla FLAP preserves. Further, in order to main- tain similar performance to Path Patching, both vanilla FLAP and Contrastive-FLAP produce cir- cuit sizes significantly larger than Path Patching, indicating that pruning does not satisfy the mini- mality constraint required for circuit analysis. Al- though pruning cannot be substituted for Path Patching since the resulting circuits, it can be used to Accelerate Path Patching by reducing the search space of circuit discovery algorithms. Specifically, Accelerated Path Patching (APP) follows a four- step process (See Figure 1): 1.Obtain a vanilla FLAP circuit using cliff points. 2.Obtain a Contrastive FLAP circuit using cliff points. 3.Merge the circuits found by the vanilla and Contrastive FLAP. 4. Apply Automated Path Patching on heads in- cluded in the merged FLAP circuit. 6 ModelMethodIOIGreaterThanGenderedPronounsInductionDocstring Perf. (%)Size (Sparsity)TPRPerf. (%)Size (Sparsity)TPRPerf. (%)Size (Sparsity)TPRPerf. (%)Size (Sparsity)TPRPerf. (%)Size (Sparsity)TPR GPT-2 SmallPath Patching96.9521 (0.85)â79.658 (0.94)â74.745 (0.97)â93.3522 (0.83)â64.6146 (0.68)â GPT-2 SmallFLAP93.5149 (0.66)80.957.6316 (0.89)37.5033.4135 (0.76)60.0048.959 (0.94)13.6436.3323 (0.84)36.33 GPT-2 SmallContrastive FLAP67.3422 (0.84)76.1969.3831 (0.78)87.5032.4429 (0.80)80.0089.3945 (0.69)90.9169.3952 (0.64)71.73 GPT-2 SmallMerged 92.6054 (0.63)90.4873.0837 (0.74)87.5069.3648 (0.67)100.0088.6947 (0.67)90.9176.3660 (0.58)76.09 GPT-2 LargePath Patching92.60193 (0.73)â75.7127 (0.96)â73.9473 (0.89)â90.9067 (0.91)â73.19122 (0.83)â GPT-2 LargeFLAP69.97186 (0.74)46.11106.90186 (0.74)74.0768.15244 (0.66)67.1241.57107 (0.85)35.8275.27201 (0.72)56.56 GPT-2 LargeContrastive FLAP51.40107 (0.85)35.7598.51150 (0.79)77.7898.17179 (0.75)67.1296.77121 (0.83)64.1845.1871 (0.90)27.87 GPT-2 LargeMerged86.85220 (0.69)53.37105.28237 (0.67)85.1996.20310 (0.57)82.1999.25186 (0.74)71.1684.05221 (0.69)61.48 Qwen2.5-0.5BPath Patching76.3362 (0.82)â75.1420 (0.94)â86.8425 (0.93)â76.0818 (0.95)â36.0434 (0.90)â Qwen2.5-0.5BFLAP17.7219 (0.94)20.9734.4553 (0.84)60.0062.2470 (0.79)56.0058.5883 (0.75)55.5635.0919 (0.94)19.05 Qwen2.5-0.5BContrastive FLAP82.84113 (0.66)67.7487.01130 (0.61)95.0055.2759 (0.82)40.0093.12127 (0.62)100.0072.13133 (0.60)85.71 Qwen2.5-0.5BMerged82.54114 (0.66)67.7487.53138 (0.59)95.0069.9089 (0.74)69.9094.86149 (0.56)100.0072.13133 (0.60)85.71 Qwen2.5-7BPath Patching73.25221 (0.72)â79.3334 (0.95)â68.69125 (0.84)â67.9010 (0.99)â64.79150 (0.81)â Qwen2.5-7BFLAP9.38195 (0.75)41.1730.29195 (0.75)52.942.02195 (0.75)41.6077.46148 (0.81)50.0036.45195 (0.75)47.33 Qwen2.5-7BContrastive FLAP71.23219 (0.72)55.2084.37132 (0.83)47.0621.27250 (0.68)56.0061.61101 (0.87)50.0070.58258 (0.67)70.66 Qwen2.5-7BMerged82.09303 (0.61)74.3888.03232 (0.70)67.6570.92317 (0.59)61.6093.03206 (0.74)60.0073.57336 (0.57)79.33 Table 2: Comparison of performance, size, and true positive rate (TPR) between Path Patching, FLAP, Contrastive FLAP, and the merged circuits (FLAP + Contrastive FLAP). By merging circuits from vanilla FLAP and Con- trastive FLAP, we are able to find task-critical heads that are both context-sensitive and context- insensitive heads in order to preserve highly faithful circuits. Merging the circuits from Step 3 of APP still yields an average 56% reduction in attention heads and significantly reduces the overall runtime of circuit discovery algorithms. Note that while we apply automated Path Patching as the circuit discov- ery algorithm in Step 4 of APP, alternative circuit discovery methods that target attention heads as circuit components can be utilized with APP. 4.1 Efficient Circuit Discovery with APP To demonstrate that APP scales to larger mod- els, P and APP are compared across the GPT-2 small, GPT-2 large, Qwen2.5-0.5B and Qwen2.5- 7B model. If available, the smallest circuits with a performance of at least 75% is chosen in both cases. Both algorithms are executed on 100 ran- dom samples from all five tasks. In a preliminary experiment across all five tasks and four models (see Table 5), circuits for vanilla and Contrastive FLAP are identified via cliff points and merged to form Hybrid FLAP circuits. The resulting Hybrid FLAP circuit maintains a relatively high amount of ground truth heads across all models and tasks. The hybrid circuit reduces the search space by at least 56%. APP and automated P are evaluated on two dimensions: accuracy and efficiency. For accuracy, we report performance, circuit size, sparsity, TPR, and precision (P). High TPR and precision indicate close alignment with the P circuit. Efficiency is measured by required GFLOPs and computation time. We first analyze the computational efficiency gains of APP over P. Figure 5 visualizes the ef- ficiency gains of APP (orange) compared to P (blue) in terms of GFLOPs. For the large models (GPT-2 large and Qwen2.5-7B) APP requires 4.11- 14.87x less GFLOPs than P and GPT2-small and Qwen2.5-0.5B require 2.45-8.33 times less GFLOPs. A similar pattern emerges for the re- quired computation time (see Figure 8). The doc- string task consistently requires the most FLOPs for both APP and P, due to its larger discovered hy- brid FLAP circuits, resulting in more P iterations, and its longer input sequence length (52 tokens, compared to 21 for IOI, the second longest). Despite the improved efficiency, Table 3 shows that APP circuits achieve an average performance of 70.42 with a sparsity ratio of 0.9, whereas P produces circuits with higher performance (76.00) and a slightly lower sparsity ratio of 0.87. When comparing models, the highest average TPR (77.53%) is obtained with GPT-2 small and the highest average precision (86.22%) with the GPT-2 large model. The chosen set of hyperparameters is not optimal for GPT-2 large. For the IOI and in- duction task, APP misses some heads, therefor P results in non-minimal circuits for the other tasks. 5 Conclusion and Discussion Circuit discovery and pruning share the common goal of identifying subnetworks that replicate the full modelâs behavior on downstream tasks. In this study, we first examine whether highly efficient pruning can provide a faster, more computationally efficient alternative to Path Patching. We find that circuits identified through pruning are substantially larger than those obtained via Path Patching, sug- gesting that pruning alone is insufficient for circuit discovery, as it fails to satisfy the minimality con- straints required by circuit analysis. The inability to find minimal circuits is reflected in the limita- tions of current pruning algorithms at high sparsity 7 Figure 5: Difference of required GFLOPs across all models and tasks ModelMethodIOIGreaterThanGenderedPronounsInductionDocstring Perf. (%)SizeTPRPPerf. (%)SizeTPRPPerf. (%)SizeTPRPPerf. (%)SizeTPRPPerf. (%)SizeTPRP GPT-2 smallPP96.9521 (0.85)--79.658 (0.94)--74.745 (0.97)--93.3522 (0.83)--60.0036 (0.75)-- GPT-2 smallAPP82.4719 (0.87)85.7194.7376.7118 (0.88)87.538.8974.615 (0.97)80.080.090.3516 (0.88)68.1893.3556.2126 (0.82)66.6792.31 GPT-2 largePP92.60193 (0.73)--75.7127 (0.96)--73.9473 (0.89)--90.9067 (0.91)--68.0495 (0.87)-- GPT-2 largeAPP68.3392 (0.87)47.66100.076.8923 (0.97)77.7891.3079.6523 (0.97)34.24100.084.1487 (0.88)58.2144.8254.3650 (0.93)51.0498.0 Qwen2.5-0.5BPP76.3362 (0.82)--75.1420 (0.94)--86.8425 (0.93)--76.0818 (0.95)--36.0434 (0.90)-- Qwen2.5-0.5BAPP 76.2636 (0.89)56.4597.2275.0528 (0.92)80.057.1460.8333 (0.90)44.033.3384.2021 (0.94)83.3371.4336.6332 (0.91)64.7168.75 Qwen2.5-7BPP61.06121 (0.85)--79.3334 (0.95)--68.69125 (0.84)--67.9010 (0.99)--58.77101 (0.87)-- Qwen2.5-7BAPP61.87137 (0.83)74.3853.5779.4362 (0.92)67.6537.1076.88126 (0.84)48.047.6264.986 (0.99)40.066.6748.6879 (0.89)60.4072.49 AveragePP84.780.78--77.460.95--76.050.91--82.060.92--59.660.81-- AverageAPP72.230.8766.0686.3877.020.9278.2356.1172.990.9251.5665.2480.920.9262.4369.0748.960.8960.7182.89 Table 3: Compare the APP and P method based on their performance (Perf), size (and sparsity), recall (TPR) and precision (P). levels, with models often experiencing catastrophic performance degradation when pruned beyond 70% (Beck et al., 2025). Further, we find that even at lower sparsity ratios, methods such as FLAP of- ten prune critical context-sensitive attention heads, such as induction heads that are required for tasks such as IOI. We posit that this is largely due to the pruning decision in FLAP being based solely on weights and activations. A high importance score for an attention head does not necessarily imply that the head is critical for solving the task. For instance, Liu and Liu (2025) claims that the position of an attention head is an important factor to identify crit- ical attention heads, not only the attention score. In order to better preserve context-sensitive heads, we propose Contrastive FLAP, which calculates impor- tance scores on the activation differences of con- trastive pairs. Contrastive FLAP is able to achieve a significantly sparser model for the same perfor- mance as vanilla FLAP, indicating that Contrastive FLAP is a promising standalone pruning method. Figure 4 demonstrates that Contrastive FLAP iden- tifies all head types but also includes undefined, task-agnostic heads, indicating that, despite its im- provements, Contrastive FLAP alone cannot serve as a replacement for circuit discovery methods. Although pruning alone cannot replace Path Patching due to the large circuits it produces, Ta- ble 2 shows that it achieves a high recall of Path Patching circuits.Building on this, we intro- duce Accelerated Path Patching (APP), which uses Contrastive-FLAP to reduce the search space be- fore applying any circuit discovery algorithm. APP maintains high task performance while substan- tially improving efficiency, enabling circuit discov- ery methods to scale to larger models. Table 3 il- lustrates that APP can achieve high precision even 8 when TPR is low, indicating that it successfully removes redundant heads and identifies more com- pact circuits. In other cases, high TPR with lower precision suggests that minimal circuits remain elusive. Overall, despite the significant gains in computational efficiency, APP often produces cir- cuits of similar size and performance compared to Path Patching. By serving as a general preprocess- ing step, APP makes any circuit discovery method faster and more practical, offering a scalable path toward efficient mechanistic interpretability. 6 Limitations Table 3 shows that neither automated P nor APP consistently yields optimal circuits in terms of min- imality and performance. One reason is that the hy- perparamter search is limited by the computational cost of P on large models like Qwen2.5-7B. Ex- ploring a wider range of hyperparameters solely on APP could find better circuits across all models and tasks. Another challenge is deciding the best trade- off between circuit size and performance. While curve fitting or Pareto analysis can help, the final de- cision remains the responsibility of the researcher. Furthermore, the ability of APP to retrieve the same circuits as P is capped by the TPR of hybrid FLAP. If the hybrid FLAP circuit is too small, APP will not recover all heads. Our work focuses on cir- cuit discovery and not circuit analysis. To the best of our knowledge, except for GPT-2 small, path patching has not been applied to the here tested large models, and thus comparison to other work is not possible. Studying whether circuits discov- ered in GPT-2 small translate to larger models, or if new behavior arises, would be very interesting. APP, as proposed here, focuses on attention heads, since various related works in mechanistic inter- pretability make the same choice. Nonetheless, some natural language tasks, such as factual associ- ation (Meng et al., 2022a), rely heavily on the MLP components. Since FLAP supports MLP patching, these components could be incorporated into the automated path patching method if desired. The heuristic of reducing the search space via pruning is not limited to P. Other algorithms, such as ACDC could be enhanced in the same way, but this is left for future work. 7 Acknowledgments This work was supported by the National Sci- ence Foundation under Cooperative Agreement 2421782 and the Simons Foundation award MPS- AI-00010515 (NSF-Simons AI Institute for Cosmic Origins - CosmicAI, https://w.cosmicai.org/ References Yongqi An, Xu Zhao, Tao Yu, Ming Tang, and Jinqiao Wang. 2024. Fluctuation-based adaptive structured pruning for large language models. Proceedings of the AAAI Conference on Artificial Intelligence, 38(10):10865â10873. Florentin Beck, William Rudman, and Carsten Eick- hoff. 2025. Trim: Achieving extreme sparsity with targeted row-wise iterative metric-driven pruning. Preprint, arXiv:2505.16743. Arthur Conmy, Augustine N. Mavor-Parker, Aengus Lynch, Stefan Heimersheim, and AdriĂ Garriga- Alonso. 2023.Towards automated circuit dis- covery for mechanistic interpretability. Preprint, arXiv:2304.14997. Nelson Elhage, Neel Nanda, Catherine Olsson, Tom Henighan, Nicholas Joseph, Ben Mann, Amanda Askell, Yuntao Bai, Anna Chen, Tom Conerly, and 1 others. 2021.A mathematical framework for transformer circuits. Transformer Circuits Thread, 1(1):12. Angela Fan, Edouard Grave, and Armand Joulin. 2019. Reducing transformer depth on demand with struc- tured dropout. Preprint, arXiv:1909.11556. Jonathan Frankle and Michael Carbin. 2018. The lottery ticket hypothesis: Finding sparse, trainable neural networks. arXiv: Learning. Elias Frantar and Dan Alistarh. 2023. SparseGPT: Mas- sive language models can be accurately pruned in one-shot. In Proceedings of the 40th International Conference on Machine Learning, volume 202 of Proceedings of Machine Learning Research, pages 10323â10337. PMLR. Atticus Geiger, Hanson Lu, Thomas F. Icard, and Christopher Potts. 2021. Causal abstractions of neu- ral networks. In Neural Information Processing Sys- tems. Nicholas Goldowsky-Dill, Chris MacLeod, Lucas Sato, and Aryaman Arora. 2023a. Localizing model behav- ior with path patching. Preprint, arXiv:2304.05969. Nicholas Goldowsky-Dill, Chris MacLeod, Lucas Sato, and Aryaman Arora. 2023b. Localizing model behav- ior with path patching. Preprint, arXiv:2304.05969. Michal Golovanevsky, William Rudman, Vedant Palit, Ritambhara Singh, and Carsten Eickhoff. 2025. What do vlms notice? a mechanistic interpretability pipeline for gaussian-noise-free text-image corrup- tion and evaluation. Preprint, arXiv:2406.16320. 9 Michael Hanna, Ollie Liu, and Alexandre Variengien. 2023. How does gpt-2 compute greater-than?: In- terpreting mathematical abilities in a pre-trained lan- guage model. In Advances in Neural Information Processing Systems, volume 36, pages 76033â76060. Curran Associates, Inc. Michael Hanna, Sandro Pezzelle, and Yonatan Belinkov. 2024. Have faith in faithfulness: Going beyond cir- cuit overlap when finding model mechanisms. In ICML 2024 Workshop on Mechanistic Interpretabil- ity. Stefan Heimersheim and Jett Janiak. A circuit for python docstrings in a 4-layer attention-only. Songtao Liu and Peng Liu. 2025. High-layer attention pruning with rescaling. Preprint, arXiv:2507.01900. Xinyin Ma, Gongfan Fang, and Xinchao Wang. 2023. Llm-pruner: On the structural pruning of large lan- guage models. In Advances in Neural Information Processing Systems, volume 36, pages 21702â21720. Curran Associates, Inc. Chris Mathwin, Guillaume Corlouer, Esben Kran, Fazl Barez, and Neel Nanda. 2023.Identi- fying a preliminary circuit for predicting gen- dered pronouns in gpt-2 small. URL: https://itch. io/jam/mechint/rate/1889871. Kevin Meng, David Bau, Alex Andonian, and Yonatan Belinkov. 2022a. Locating and editing factual asso- ciations in gpt. In Advances in Neural Information Processing Systems, volume 35, pages 17359â17372. Curran Associates, Inc. Kevin Meng, David Bau, Alex Andonian, and Yonatan Belinkov. 2022b. Locating and editing factual asso- ciations in GPT. Advances in Neural Information Processing Systems, 36. ArXiv:2202.05262. Nostalgebraist. 2020. Interpreting gpt: the logit lens. Chris Olah. 2022.Mechanistic interpretability, variables, and the importance of interpretable bases.https://w.transformer-circuits. pub/2022/mech-interp-essay.Published June 27, 2022; Accessed: 2025-10-02. Chris Olah, Nick Cammarata, Ludwig Schubert, Gabriel Goh, Michael Petrov, and Shan Carter. 2020. Zoom in: An introduction to circuits.Distill. Https://distill.pub/2020/circuits/zoom-in. Alec Radford, Jeff Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. 2019. Language models are unsupervised multitask learners. E Rutherford. 1905. Xxxvii. slow transformation prod- ucts of radium. The London, Edinburgh, and Dublin Philosophical Magazine and Journal of Science, 10(57):290â306. Mingjie Sun, Zhuang Liu, Anna Bair, and J. Zico Kolter. 2024. A simple and effective pruning approach for large language models. Preprint, arXiv:2306.11695. Aaquib Syed, Can Rager, and Arthur Conmy. 2023. Attribution patching outperforms automated circuit discovery. Preprint, arXiv:2310.10348. Jesse Vig, Sebastian Gehrmann, Yonatan Belinkov, Sharon Qian, Daniel Nevo, Simas Sakenis, Jason Huang, Yaron Singer, and Stuart Shieber. 2020. Causal mediation analysis for interpreting neural nlp: The case of gender bias. Preprint, arXiv:2004.12265. Kevin Wang, Alexandre Variengien, Arthur Conmy, Buck Shlegeris, and Jacob Steinhardt. 2022. In- terpretability in the wild: a circuit for indirect object identification in gpt-2 small.Preprint, arXiv:2211.00593. Qwen An Yang, Baosong Yang, Beichen Zhang, Binyuan Hui, Bo Zheng, Bowen Yu, Chengyuan Li, Dayiheng Liu, Fei Huang, Guanting Dong, Hao- ran Wei, Huan Lin, Jian Yang, Jianhong Tu, Jianwei Zhang, Jianxin Yang, Jiaxin Yang, Jingren Zhou, Jun- yang Lin, and 25 others. 2024. Qwen2.5 technical report. ArXiv, abs/2412.15115. Qinan Yu, Jack Merullo, and Ellie Pavlick. 2023. Char- acterizing mechanisms for factual recall in language models. ArXiv, abs/2310.15910. Fred Zhang and Neel Nanda. 2024. Towards best prac- tices of activation patching in language models: Met- rics and methods. Preprint, arXiv:2309.16042. Ruochen Zhang, Qinan Yu, Matianyu Zang, Carsten Eickhoff, and Ellie Pavlick. 2024. The same but dif- ferent: Structural similarities and differences in mul- tilingual language modeling. ArXiv, abs/2410.09223. Xunyu Zhu, Jian Li, Yong Liu, Can Ma, and Weiping Wang. 2024. A survey on model compression for large language models. Transactions of the Associa- tion for Computational Linguistics, 12:1556â1577. A Tasks A.1 IOI Task The IOI task (Wang et al., 2022) evaluates whether a model can correctly predict the indirect object in a sentence. For example, a clean prompt is âWhen John and Mary went to the store, John bought a drink for...â. John is the subject of the sentence and the correct continuation; âMaryâ is the indirect object. A corrupted prompt removes the semantic cue from the indirect object, for example, âWhen John and Mary went to the store, Alex bought a drink for...â. Task performance is measured using the logit difference, defined as the logit of the indirect ob- ject minus the logit of the subject. In the example above: LD = Logit(Mary) - Logit(John) 10 We use the implementation of the IOI dataset from the ARENA tutorial repository 3 . The cor- rupted dataset is generated using the âABBâXYZ, BABâXYZâ command. A.2 GreaterThan Task The objective of the GreaterThan task (Hanna et al., 2023) is to evaluate the modelâs ability to predict a number greater than another within a natural lan- guage context. The template is: âThe <NOUN> lasted from XXYY to the year X..â, where Xâ 11,..., 17 and Yâ02,..., 98. The model is supposed to predict a numberâĽY. The corrupted prompt is of the form: âThe <NOUN> lasted from X01 to the year X..â. The tokenizer of the GPT family encodes Y as [Y], and it predicts answervas one token. Thus, the logit difference is as follows. Correct =v|(v > Y Y )â§ (v ⤠98) Wrong =v|v ⤠Y Y LD = Logits(Correct) - Logits(Wrong) The Qwen2.5 tokenizer encodes Y in two to- kens [Y 1 ][Y 2 ]. The predicted answer is tokenized in the same manner [v 1 ][v 2 ]. WithY 1 ,Y 2 ,v1,v2 = 0,... 9 Hence the average logit difference is Correct = v1v2|(v1 > Y 1)⨠(v1 = Y 1â§ v2 > Y 2) Wrong = v1v2|(v1 < Y 1)⨠(v1 = Y 1â§ v2⤠Y 2) LD = Logits(Correct) - Logits(Wrong) The GreaterThan Dataset is downloaded from the original HuggingFace data repo 4 . A.3 GenderedPronouns Task The GenderedPronouns Task (Mathwin et al., 2023) evaluates a modelâs ability to predict the pronoun conventionally associated with a gendered name. While exceptions to these associations exist, we adopt this simplification for clarity. A clean sample from the dataset is âSo Emily is such a good friend, isnât...â with the correct answer she. The corresponding corrupted prompt replaces 3 https://github.com/callummcdougall/ARENA_ 3.0/blob/main/chapter1_transformer_interp/ exercises/part41_indirect_object_identification/ ioi_dataset.py 4 https://huggingface.co/datasets/mwhanna/ greater-than the gendered name with a non-gendered descrip- tion: âThat person is such a good friend, isnât...â. The clean prompt begins with the filler word âSoâ to preserve grammatical cohesion in the corrupted version, while maintaining structural equivalence between the two prompts. Without âSoâ, the cor- rupted prompt would be one token longer, requiring the removal of âThatâ in the corrupted prompt. The average logit difference is calculated by the difference between the correct pronoun and the wrong pronoun for the name. In the given example, that is LD = Logits(she) - Logits(he). A.4 Induction Task The induction task uses token sequences of the form [A][B]...[A], where the modelâs objective is to predict [B] as the next token. Our implementa- tion differs from Goldowsky-Dill et al. (2023b), by focusing on name induction. For example, a clean prompt has the following form: âToday, Claire vis- ited the library. There Cl...â. The correct next pre- diction is âaireâ. The corrupted prompt replaces the repeated name with another, e.g. âToday, Claire visited the library. There Tr...â. It is important that only names that the tokenizer splits into exactly two tokens [Name 1 ][Name 2 ] are used. The average logit difference is defined as the difference between the logits of the second token of the correct name and the second token of the corrupted name: LD = Logits(aire) - Logits(istan). A.5 Docstring Task The docstring task (Heimersheim and Janiak) eval- uates a modelâs ability to complete a Python Doc- string. A clean prompt has the following form: DEF OLD(SELF, FIRST, PAGE, NAMES, SIZE, FILES, READ): """sector gap population :param page: message tree :param names: detail mine :param ...""" The correct next token is SIZE. The correspond- ing corrupted prompt is the following. DEF OLD(SELF, FIRST, PROJECT, TARGET, NEW, FILES, READ): """sector gap population :param image: message tree :param update: detail mine :param ...""" The logit difference is the difference between the logits of the correct answer and max logit of all 11 wrong variables of the clean and corrupted prompt. Wrong = first, page, names, files, read, project, target, new LD = Logits(size)â arg max xâWrong Logits(x) The code for the dataset is taken from this repos- itory 5 . B Context Sensitive vs. Task-Critical Heads Context-Sensitive Attention HeadsMeng et al. (2022b) identify various types of attention heads for the IOI task in the GPT-2 small model. For example, the Previous Token Heads always attend to the token immediately preceding the current one. These heads exhibit the same activation pattern regardless of the provided input and are therefore called context-insensitive. Figure 2 visualizes the activation pattern of a previous token head on the clean (a) and corrupted (b) dataset. Although the token input of the two datasets differs, the observed activation pattern is the same. Conversely, heads that display a distinct activa- tion pattern only when a specific token pattern is present, are context-sensitive. For example, an Induction Head strongly attends to the token [B] when it encounters the token sequence [A][B] ... [A]. By definition, context-sensitive heads should remain inactive on samples from the corrupted dataset, because the token pattern is not detected (see Figure 2, (d) + (e)). Note that context-sensitive heads are activated only by specific token context, whereas task-critical heads are defined as essen- tial for solving a task and are ideally included in the corresponding circuit. Many, but not all, task- critical heads are context-sensitive (e.g. previous token heads). C Automatic Path Patching C.1 Implementation The procedure to automate path patching is sum- marized in Algorithm 1 and is heavily inspired by Zhang and Nanda (2024). PATHPATCHING en- codes the standard path patching mechanism in- troduced by Wang et al. (2022). In the EVALU- ATETHRESHOLD function, two thresholds are de- cided based on a head-wise influence score to de- termine whether an attention head is included in the circuit. 5 https://github.com/jettjaniak/mi_utils_ public/blob/main/prompts.py Algorithm 1: Automatic Path Patching Result: circuit 1 circuitâ 2 influenceScoresâ PathPatching(logits) // influenceScores âR (LĂH) 3 receiverListâ EvaluateThresholds (influenceScores) 4 while receiverList not empty do 5receiverâ pop(receiverList) // layer l, head h 6circuit.add(receiver) 7influenceScoresâ PathPatching (receiver) // influenceScores âR ((lâ1)ĂH) 8senderListâ EvaluateThresholds (influenceScores) 9for s in senderList do 10if s not in receiverList & s not in circuit then 11receiverList.add(s) 12end 13end 14 end To discuss the threshold, we will first provide some notations. Assume that the total number of layers of a model isLand that each layer contains Hattention heads. A receiver headrcan be defined by the tupler = (l r ,h r ), wherel r ⤠Landh r ⤠H. Sender heads are denoted ass = (l s ,h s )and correspond to all heads from earlier layers (l s < l r ) that patch tor. The influence of patching a head from earlier layers is measured by an influence score, typically the average logit difference. The influence scores of all previous heads are collected in the matrix X âR (l r â1)ĂH . First, the importance threshold is evaluated over each importance score x i,j |x i,j |â| Ě X| > Kâ SD(X) , where Ě XandSD(X)denote the mean and stan- dard deviation calculated over all influence scores respectively, andKis a predefined constant. At lower-level layers, the scores become noisier. To account for this, the constant is adjusted to K Ⲡ= K + 2 â l s â H , whereK Ⲡincreases asl s decreases. The adjusted constantK Ⲡis evaluated for each sender layerl s . 12 This adjustment is desirable, since path patching fo- cuses on sequential influence: components that are more distant from the receiver must meet stricter significance criteria to be included. For evaluation, K is set to [1, 1.5, 2, 2.5]. Second, the maximum value thresholds ensure that at least one scorex i,j is above a chosen valueÎľ. Otherwise, no head for the current receiver will be included in the circuit. This prevents the inclusion of spurious or weakly contributing components in the constructed circuit. Values chosen forÎľare [0.01, 0.001, 0.02, 0.002] Heads that exceed both thresholds are considered significant contributors to the modelâs behavior and are selected as receivers in subsequent iterations of the algorithm. D Pruning D.1 Implementation of Vanilla FLAP Since FLAP (An et al., 2024) is a zero-shot pruning algorithm that utilizes head-wise importance scores and does not require retraining it is possible to have a direct comparison with path patching. The influ- ence scores are calculated by passing samples of the datasetD clean to the FLAP algorithm. Based on a sparsity levelp, the1â p% heads with the highest importance score are chosen to be in the circuit. By design, heads that yield in higher im- portance scores have higher weights and/or input activation values during the forward pass. Theo- retically, these higher values translate to a higher influence on the output logits. Thus, these heads are likely to have a stronger influence on the next prediction and are considered to be in the circuit. Since FLAP is computationally very efficient, it can be run on multiple times to evaluate the per- formance of the resulting circuits under different sparsity levels. D.1.1 Implementation of Contrastive FLAP Contrastive FLAP is summarized in Algorithm 4. The method computes FLAP scores for both clean and corrupted inputs, then evaluates the absolute difference between the two. Attention heads are subsequently ranked globally according to their contrastive FLAP scores, and the top s% with the highest ratios are selected and incorporated into the circuit. Algorithm 2: Contrastive FLAP Result: circuit 1 FLAPScoresâ calculateImportanceScore (cleanDataset) 2 corruptedFLAPScoresâ calculateImportanceScore (corruptedDataset) 3 contrastiveFLAPScores â||FLAPScores- corruptedFLAPScores|| 4 circuitâ pruneHeads(contrastiveFLAPScores, sparsityRatio); D.1.2 Does Contrastive FLAP find smaller circuits than vanilla FLAP? Methods Contrastive and Vanilla FLAP are eval- uated on the GPT-2 small model for all five tasks presented in 2. Each task had a clean and corrupted dataset with 200 randomly picked samples. Metric The half-life metric (t 1 2 ), originally used to quantify the exponential nature of radioactive decay (Rutherford, 1905), measures the time required for a quantity to reach half of its initial value. Here, the metric is applied to the total number of true positive heads, with sparsity levels ranging from 0 to 1 in increments of 0.01 serving as the analog of time. A higher half-life value translates to a later exclusion of critical heads and thus an earlier exclusion of task-irrelevant heads. Results Except for the IOI task, the half-life value is reached only at higher sparsity levels for circuits identified by contrastive FLAP (see Table 7). This indicates that 50% of the ground truth heads are removed at higher sparsity levels. Figure 6 visu- alizes the exclusion of ground truth heads across all tested sparsity levels. contrastive FLAP main- tains a plateau longer at lower sparsity compared to Vanilla FLAP. This effect is particularly pro- nounced for the Induction task, where the first ex- clusion of a ground truth head occurs at a sparsity level of 0.57, compared to 0.13 for Vanilla FLAP. A similar trend is observed for the IOI task. On the other hand, the two curves for the GreaterThan task are nearly identical, suggesting that some tasks benefit more 13 IOIGreaterThanGenderedPronounsInductionDocstring ManualAutomaticManualAutomaticManualAutomaticManualAutomaticManualAutomatic Perf. (%)75.5896.9571.6879.6580.1674.7486.3493.3541.0660.36 Size1521887514222336 Intersection-14-6-4-13-22 Difference -7-2-1-9-14 Table 4: Circuits discovered by manual and automatic path patching on GPT-2 small D.1.3 Hybrid FLAP Methods Circuits of all three methods are eval- uated over 200 samples for all five tasks and all three cliff points. See Appendix E to see which circuit was chosen for each task. Since the goal is to scale path patching to larger models, GPT-2 small, GPT-2 large, Qwen2.5-0.5B and Qwen2.5- 7B are evaluated. See Appendix C to see results for the automatic path patching algorithms for all models. Circuits for Hybrid FLAP are chosen by evaluating all possible combinations of cliff points from contrastive and vanilla FLAP. The one with the best trade-off between performance and size is chosen. Results Hybrid FLAP yields in circuits with an average TPR of 82.39% for GPT-2 small, 68.12% for GPT-2 large, 80.07% for Qwen2.5-0.5B and 73.73% for Qwen2.5-7B (see Table 5). With a minimum sparsity ratio of 0.58 for the Docstring task on GPT-2 small, 0.64 for the GreaterThan task for GPT-2 large, 0.56 for the Induction task on Qwen2.5-0.5B and 0.57 for the Docstring task on Qwen2.5-7B. Altough Hybrid FLAP circuits are larger than the ones discovered by Vanilla or con- trastive FLAP, the TPR is higher and performance are generally higher. E Accelerated Path Patching: Efficiency The efficiency gains in terms of computation time paint a similar pattern to the GFLOPs. APP yields a significant speed-up compared to P (see Figure 8). F Hyperparameters Tuning F.1 Automatic Path Patching In Figure 9, 10, 11, and 12, we show the result- ing circuits from Automatic P and model per- formances across tasks and model families under different hyperparameter settings. F.2 Accelerated Path Patching In Figure 13, 14, 15, and 16, we show the resulting circuits from APP and model performances across tasks and model families under different hyperpa- rameter settings. 14 ModelFLAP MethodIOIGreaterThanGenderedPronounsInductionDocstring Perf. (%)Size (Sparsity)TPRPerf. (%)Size (Sparsity)TPRPerf. (%)Size (Sparsity)TPRPerf. (%)Size (Sparsity)TPRPerf. (%)Size (Sparsity)TPR GPT-2 smallPath Patching96.9521 (0.85)-79.658 (0.94)-74.745 (0.97)-93.3522 (0.83)-64.6146 (0.68)- GPT-2 smallClean93.5149 (0.66)80.957.6316 (0.89)37.5033.4135 (0.76)60.0048.959 (0.94)13.6436.3323 (0.84)36.33 GPT-2 smallContrastive67.3422 (0.84)76.1969.3831 (0.78)87.5032.4429 (0.80)80.0089.3945 (0.69)90.9169.3952 (0.64)71.73 GPT-2 smallMerged92.6054 (0.63)90.4873.0837 (0.74)87.5069.3648 (0.67)100.0088.6947 (0.67)90.9176.3660 (0.58)76.09 GPT-2 largePath Patching92.60193 (0.73)-75.7127 (0.96)-73.9473 (0.89)-90.9067 (0.91)-73.19122 (0.83)- GPT-2 largeClean69.97186 (0.74)46.11106.90186 (0.74)74.0768.15244 (0.66)67.1241.57107 (0.85)35.8275.27201 (0.72)56.56 GPT-2 largeContrastive51.40107 (0.85)35.7598.51150 (0.79)77.7898.17179 (0.75)67.1296.77121 (0.83)64.1845.1871 (0.90)27.87 GPT-2 largeMerged86.85220 (0.69)53.37105.28237 (0.67)85.1996.20310 (0.57)82.1999.25186 (0.74)71.1684.05221 (0.69)61.48 Qwen2.5-0.5BPath Patching76.3362 (0.82)-75.1420 (0.94)-86.8425 (0.93)-76.0818 (0.95)-36.0434 (0.90)- Qwen2.5-0.5BClean17.7219 (0.94)20.9734.4553 (0.84)60.0062.2470 (0.79)56.0058.5883 (0.75)55.5635.0919 (0.94)19.05 Qwen2.5-0.5BContrastive82.84113 (0.66)67.7487.01130 (0.61)95.0055.2759 (0.82)40.0093.12127 (0.62)100.0072.13133 (0.60)85.71 Qwen2.5-0.5BMerged 82.54114 (0.66)67.7487.53138 (0.59)95.0069.9089 (0.74)69.9094.86149 (0.56)100.0072.13133 (0.60)85.71 Qwen2.5-7BPath Patching73.25221 (0.72)-79.3334 (0.95)-68.69125 (0.84)-67.9010 (0.99)-64.79150 (0.81)- Qwen2.5-7BClean9.38195 (0.75)41.1730.29195 (0.75)52.942.02195 (0.75)41.6077.46148 (0.81)50.0036.45195 (0.75)47.33 Qwen2.5-7BContrastive71.23219 (0.72)55.2084.37132 (0.83)47.0621.27250 (0.68)56.0061.61101 (0.87)50.0070.58258 (0.67)70.66 Qwen2.5-7BMerged82.09303 (0.61)74.3888.03232 (0.70)67.6570.92317 (0.59)61.6093.03206 (0.74)60.0073.57336 (0.57)79.33 Table 5: Comparing the performance, size and true positive ratio of Path Patching to pruning with vanilla FLAP, Contrastive FLAP and the resulting circuit of merging vanilla and Contrastive FLAP. 15 (a) IOI task(b) GreaterThan task (c) GenderedPronouns task(d) Induction task (e) Docstring task Figure 6: Amount of ground truth heads included by vanilla FLAP (green) and contrastive FLAP (orange). The dotted line shows the sparsity level at which the true positive reaches its half-life value. IOIGreaterThanGenderedPronounsInductionDocstring Vanilla FLAP0.920.880.700.810.74 Contrastive FLAP0.900.920.810.870.79 Figure 7: Half-life values for Vanilla and Contrastive FLAP across all tasks 16 Figure 8: Difference of required computation time across all models and tasks 17 Automatic Path Patching: Hyperparameter testing for GPT-2 small (a) IOI task(b) GreaterThan task (c) GenderedPronouns task(d) Induction task (e) Docstring task Maximum ValueImportance IOIGreaterThanGenderedPronounsInductionDocstring PsizePsizePsizePsizePsize 0.01 1112.86%3483.20%1295.35%2748.95%864.61%46 1.5110.32%3182.67%973.11%1848.95%860.00%36 2104.61%2582.67%960.63%1548.95%853.88%32 2.596.95%2179.65%872.89%1148.95%845.76%21 0.001 1113.51%11590.98%10179.04%10394.70%10771.45%127 1.5112.01%11289.09%9071.77%7688.39%6367.45%94 2110.84%4685.77%2872.29%4890.60%2764.48%75 2.5106.4% 32779.73%1573.88%2393.25%2356.21%41 0.02 194.16%2382.67%996.99%948.95%851.45%34 1.552.50%1982.67%974.74%548.95%847.15%24 241.23%1879.65%868.33%448.95%842.36%19 2.527.37%1379.65%868.33%448.95%840.21%14 0.002 1113.51%11590.98%10178.70%8888.99%4871.64%122 1.5112.01%11289.09%9074.35%6087.09%3267.45%94 2110.84%4685.77%2875.86%3591.10%2564.48%75 2.5106.43%2779.73%1572.29%2193.35%2256.21%41 Figure 9: P on GPT-2 small: Pareto points for each task are marked in bold. 18 Automatic Path Patching: Hyperparameter testing for GPT-2 large (a) IOI task(b) GreaterThan task (c) GenderedPronouns task(d) Induction task (e) Docstring task Maximum ValueImportance IOIGreaterThanGenderedPronounsInductionDocstring PsizePsizePsizePsizePsize 0.01 162.28%17561.97%1481.41%10156.39%2373.19%122 1.543.40%9161.97%1467.74%7156.39%2368.04%95 221.01%6961.97%1466.79%5256.39%2364.04%80 2.524.43%6261.97%1462.55%3656.39%2360.69%75 0.001 1101.06%641101.45%30495.79%46194.18%46767.32%450 1.5104.84%623101.47%14379.58%16292.34%36266.61%427 2100.39%58295.96%6078.29%12494.68%26568.75%255 2.593.91%42289.17%4173.95%7358.78%7467.21%104 0.02 150.53%9761.97%145.33%3956.39%2364.31%89 1.537.72%7061.97%145.01%2656.39%2354.61%69 224.36%5861.97%145.28%2356.39%2350.58%62 2.526.16%5261.97%145.24%1954.50%2537.72%49 0.002 1100.87%63897.06%12199.25%45796.42%23280.04%553 1.592.60%19393.45%6598.91%38789.81%12566.23%363 289.02%38582.74%3793.35%22390.90%6771.93%122 2.540.59%10175.71%2778.70%10563.55%4484.65%572 Figure 10: P om GPT-2 large: Pareto points for each task are marked in bold. 19 Automatic Path Patching: Hyperparameter testing for Qwen2.5-0.5B (a) IOI task(b) GreaterThan task (c) GenderedPronouns task(d) Induction task (e) Docstring task Maximum ValueImportance IOIGreaterThanGenderedPronounsInductionDocstring PsizePsizePsizePsizePsize 0.01 180.62%9342.55%870.29%9166.25%1331.57%88 1.576.33%6242.55%892.46%5266.25%1331.72%65 266.86%4542.55%886.20%3466.25%1331.83%50 2.563.05%4042.55%886.84%2566.25%1339.25%42 0.001 199.85%26087.86%22895.53%25385.99%13033.68%259 1.597.41%24886.98%20888.18%11987.89%7232.24%184 276.63%16981.60%8580.64%7882.38%4831.52%68 2.566.86%11267.66%2666.96%4784.99%3631.42%52 0.02 179.96%8742.55%839.27%2762.15%1236.04%34 1.576.33%6242.55%837.92%1962.15%1229.59%23 266.16%4342.55%833.04%1362.15%1229.59%23 2.554.33%3742.55%832.11%962.15%1229.67%20 0.002 199.19%24882.79%11866.71%15785.66%9734.01%232 1.592.75%19781.66%4572.08%11085.32%4432.03%113 267.79%10375.14%2041.85%7576.08%1831.52%68 2.561.43%7954.76%1358.21%5476.99%2031.42%52 Figure 11: P on Qwen2.5-0.5B Pareto points for each task are marked in bold. 20 Automatic Path Patching: Hyperparameter testing for Qwen2.5-7B (a) IOI task(b) GreaterThan task (c) GenderedPronouns task(d) Induction task (e) Docstring task Maximum ValueImportanceIOIGreaterThanGenderedPronounsInductionDocstring PsizePsizePsizePsizePsize 0.01 173.25%221-39.98%1010.89%7663.71%459.11%117 1.541.39%125-39.98%104.34%4563.71%458.77%101 242.55%97-39.98%102.95%3163.71%438.11%74 2.538.07%87-39.98%103.12%2763.71%436.26%72 0.001 183.48%72187.72%70992.19%39285.97%61484.27%730 1.585.62%70187.88%68990.45%30981.51%47064.79%150 280.53%65287.05%59489.61%24767.90%1061.15%131 2.574.99%60286.45%24868.69%12567.90%1059.66%114 0.02 137.03%92-40.06%82.21%963.71%437.03%46 1.523.74%49-40.06%82.21%963.71%436.75%40 224.23%39-40.06%82.21%963.71%427.68%17 2.528.51%38-40.69%92.21%964.57%533.86%35 0.002 176.08%46288.93%62590.75%61864.57%569.65%706 1.573.43%32685.18%41982.64%56063.71%450.44%138 285.38%44279.33%3463.61%30063.71%448.57%121 2.561.06%12112.08%2933.00%14364.57%559.66%114 Figure 12: P on Qwen2.5-7B: Pareto points for each task are marked in bold. 21 Accelerated Path Patching: Hyperparameter testing for GPT-2 small (a) IOI task(b) GreaterThan task (c) GenderedPronouns task(d) Induction task (e) Docstring task Maximum ValueImportanceIOIGreaterThanGenderedPronounsInductionDocstring PsizePsizePsizePsizePsize 0.01 182.47%1968.86%879.39%1152.03%1556.21%26 1.568.31%1668.86%871.94%952.03%1549.64%19 269.35%1650.81%563.34%648.95%838.79%14 2.564.68%1550.81%566.09%548.95%838.45%12 0.001 192.14%4472.86%3366.61%3084.24%2463.03%49 1.592.47%3176.71%1869.02%2389.89%1758.27%33 266.82%1968.03%874.23%1290.35%1649.33%23 2.554.25%1568.03%874.05%789.64%1943.24%17 0.02 127.37%1353.76%674.61%548.95%854.94%29 1.525.45%1253.76%674.61%548.95%844.48%18 225.45%1250.81%574.61%548.95%841.76%13 2.58.87%1050.81%574.61%548.95%845.70%17 0.002 184.22%2872.86%3378.83%1785.19%2763.15%79 1.578.83%2476.71%1873.02%1393.35%2262.85%67 266.82%1968.03%875.13%990.05%1856.36%46 2.554.25%1568.03%874.05%780.94%1763.58%38 Figure 13: APP on GPT-2 small: Pareto points for each task are marked in bold. In red are the circuits discovered by P. 22 Accelerated Path Patching: Hyperparameter testing for GPT-2 large (a) IOI task(b) GreaterThan task (c) GenderedPronouns task(d) Induction task (e) Docstring task Maximum ValueImportance IOIGreaterThanGenderedPronounsInductionDocstring PsizePsizePsizePsizePsize 0.01 121.535157.331378.223354.301558.6162 1.524.344557.331379.102554.301554.3650 221.813864.041279.652354.301543.3746 2.523.683564.041270.902154.301543.6743 0.001 181.8219398.257092.9424184.148766.83209 1.580.2218086.613494.5719157.533364.80202 267.7011976.892393.5512456.982662.72196 2.552.806067.941988.6712854.85251.4850 0.02 123.944657.33135.522454.301552.4160 1.521.664057.33135.281854.301539.9453 222.263364.04125.251554.301532.1839 2.523.723664.04125.321354.301532.9532 0.002 168.339283.933289.2813956.692065.02161 1.553.6810674.682587.117756.731964.3195 235.836873.262085.825456.681857.0778 2.533.805068.481781.284254.301561.35120 Figure 14: APP on GPT-2 large: Pareto points for each task are marked in bold. 23 Accelerated Path Patching: Hyperparameter testing for Qwen2.5-0.5B (a) IOI task(b) GreaterThan task (c) GenderedPronouns task(d) Induction task (e) Docstring task Maximum ValueImportance IOIGreaterThanGenderedPronounsInductionDocstring PsizePsizePsizePsizePsize 0.01 178.113942.55849.362866.831534.0650 1.569.192742.55842.781966.831536.2441 264.612242.55829.98866.831536.6332 2.551.221442.55834.57566.831533.8629 0.001 161.617486.579263.196182.845938.09107 1.558.654781.795660.833382.885036.3455 262.134375.052833.161784.082233.3948 2.563.793953.671334.061084.122133.6537 0.02 176.263642.55823.71262.851432.6027 1.559.172442.55823.71262.851432.6027 251.702042.55823.71262.851432.7023 2.548.561342.55823.71262.851432.7023 0.002 179.819482.034152.175080.603131.8079 1.566.096070.661550.223283.582428.7051 264.135154.761333.191684.122130.3640 2.564.943552.831034.061067.001739.9640 Figure 15: APP on Qwen2.5-0.5B: Pareto points for each task are marked in bold. 24 Accelerated Path Patching: Hyperparameter testing for Qwen2.5-7B (a) IOI task(b) GreaterThan task(c) GenderedPronouns task (d) Induction task(e) Docstring task Maximum ValueImportance IOIGreaterThanGenderedPronounsInductionDocstring PsizePsizePsizePsizePsize 0.01 119.2783-40.0684.203064.98627.5514 1.521.5862-40.0683.012164.98627.5912 214.4949-40.0683.082064.98627.5912 2.515.4442-40.0683.041744.49327.5912 0.001 167.4826884.2023578.5414590.0719049.83261 1.565.1625182.8621566.8312864.30948.6583 262.2821681.8414445.499064.98642.5566 2.535.9311457.92198.005464.98633.8358 0.02 115.1839-40.0682.19964.98627.5514 1.517.1625-40.0682.19964.98627.5912 217.1621-40.0682.19964.98627.5912 2.513.9217-40.0982.19944.49327.5912 0.002 142.6119779.436276.8812664.98647.79219 1.570.1923615.842466.349864.98648.6879 261.8713712.421722.974564.98642.5566 2.531.4073-40.6997.944544.49333.8358 Figure 16: APP on Qwen2.5-7B: Pareto points for each task are marked in bold. The highlighted row corresponds to the Path Patching configuration. 25