Discovering Transformer Circuits via a Hybrid Attribution and Pruning Framework

Hao Gu, Vibhas Nair, Amrithaa Ashok Kumar, Jayvart Sharma, Ryan Lagasse
9/28/2025
cs.LGcs.CL

No official code found. Best implementation: nairvibhas18/HAP_Paper_NeurIPS_2025 (2 stars, last commit 2025-08-23).

Abstract

Interpreting language models often involves circuit analysis, which aims to identify sparse subnetworks, or circuits, that accomplish specific tasks. Existing circuit discovery algorithms face a fundamental trade-off: attribution patching is fast but unfaithful to the full model, while edge pruning is faithful but computationally expensive. This research proposes a hybrid attribution and pruning (HAP) framework that uses attribution patching to identify a high-potential subgraph, then applies edge pruning to extract a faithful circuit from it. We show that HAP is 46\% faster than baseline algorithms without sacrificing circuit faithfulness. Furthermore, we present a case study on the Indirect Object Identification task, showing that our method preserves cooperative circuit components (e.g. S-inhibition heads) that attribution patching methods prune at high sparsity. Our results show that HAP could be an effective approach for improving the scalability of mechanistic interpretability research to larger models. Our code is available at https://anonymous.4open.science/r/HAP-circuit-discovery.

View on arXivView PDF

Code Implementations(1)

Repo contains code from the paper "Discovering Transformer Circuits via a Hybrid Attribution and Pruning Framework" by Hao Gu, Vibhas Nair and Amrithaa Ashok Kumar, mentored by Ryan Lagasse.

22Shell, PythonJun 7, 20251 years ago

Similar Papers

Cite this paper

@article{gu2025discovering,
  title  = {Discovering Transformer Circuits via a Hybrid Attribution and Pruning Framework},
  author = {Hao Gu and Vibhas Nair and Amrithaa Ashok Kumar and Jayvart Sharma and Ryan Lagasse},
  year   = {2025},
  eprint = {2510.03282},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2510.03282v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2510.03282.svg)](https://codeofpaper.com/paper/2510.03282)

Discussion