NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

APP: Accelerated Path Patching with Task-Specific Pruning

Frauke Andersen, William Rudman, Ruochen Zhang, Carsten EickhoffarXiv 2025 · OpenReview

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. APP first applies Contrastive-FLAP to reduce the search space 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.

Introduction

Mechanistic interpretability aims to reverse-engineer Large Language Models (LLMs) into human-understandable "circuits"—subgraphs of components (like attention heads or neurons) responsible for specific linguistic tasks. Identifying these circuits is crucial for understanding model behavior and ensuring safety. The current gold standard for circuit discovery is Path Patching, a technique that measures the causal influence of a component by swapping its activations between a "clean" input and a "corrupted" one.

However, Path Patching is computationally prohibitive. It requires exhaustive evaluation of every possible path in the model, making it difficult to scale to modern, large-scale architectures. While standard pruning techniques can reduce model size quickly, they often fail to isolate the minimal circuit required for a specific task and may inadvertently remove critical task-specific components that do not exhibit high average activation levels.

Methodology: Accelerated Path Patching (APP)

To address the scalability bottleneck of Path Patching, we introduce Accelerated Path Patching (APP). APP is a framework that combines the speed of pruning with the precision of causal analysis.

The APP Pipeline

The APP process consists of four primary stages:

  1. Vanilla Pruning: Standard pruning identifies generally important components based on activation magnitudes.
  2. Contrastive Pruning (Contrastive-FLAP): A novel method identifies task-specific components by analyzing activation differences.
  3. Merging: The results from both pruning steps are combined to create a significantly reduced search space (averaging a 56% reduction).
  4. Path Patching: Automated Path Patching is performed only on the remaining subset of components.
The APP pipeline: Pruning reduces the search space before applying causal path patching.

Contrastive-FLAP

The core innovation of APP is Contrastive-FLAP. Unlike traditional pruning, which focuses on absolute weight or activation magnitudes, Contrastive-FLAP calculates importance based on the difference in activations between clean and corrupted inputs. This approach allows the algorithm to isolate "context-sensitive" heads—those that are specifically active during the task of interest.

Contrastive-FLAP isolates task-specific attention patterns by comparing clean and corrupted inputs.

Experimental Setup

We evaluated APP across four models: GPT-2 Small/Large and Qwen2.5-0.5B/7B. The performance was tested on five standard mechanistic interpretability benchmarks:

  • Indirect Object Identification (IOI): Predicting the correct name in a narrative context.
  • Greater Than: Predicting a chronological year.
  • Gendered Pronouns: Resolving pronouns based on names.
  • Induction: Recognizing and repeating sequences.
  • Docstring: Completing Python function documentation.

Key Results

Our experiments demonstrate that APP significantly improves the efficiency of circuit discovery without sacrificing fidelity.

  • Computational Efficiency: APP achieves speedups of 59.6% to 93.3% compared to exhaustive Path Patching on dense models. For larger models like Qwen2.5-7B, APP requires 4.1x to 14.8x fewer GFLOPs.
  • Task-Specific Preservation: Standard pruning often removes critical induction heads because their average activation across general data may be low. Contrastive-FLAP successfully preserves these heads by focusing on task-relevant activation changes.
  • Circuit Fidelity: The circuits discovered via APP show high overlap (True Positive Rate) with established "ground truth" circuits and maintain comparable performance on the target tasks.

Discussion and Limitations

While APP offers a significant leap in scalability, some challenges remain. The method's effectiveness depends on the quality of the "corrupted" dataset; if the corruption does not precisely target the task-relevant information, the contrastive signal may be weakened. Additionally, while the pruning method supports MLP layers, this study focused primarily on attention heads. Future work will explore extending APP to full-model circuit discovery and further automating hyperparameter selection for the path patching phase.

Summary updated

BibTeX
@misc{andersen2025app,
  author = {Frauke Andersen and William Rudman and Ruochen Zhang and Carsten Eickhoff},
  title = {{APP: Accelerated Path Patching with Task-Specific Pruning}},
  year = {2025},
  eprint = {2511.05442},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.05442},
}
Figure