Finding Transformer Circuits With Edge Pruning
Abstract
The path to interpreting a language model often proceeds via analysis of circuits -- sparse computational subgraphs of the model that capture specific aspects of its behavior. Recent work has automated the task of discovering circuits. Yet, these methods have practical limitations, as they rely either on inefficient search algorithms or inaccurate approximations. In this paper, we frame automated circuit discovery as an optimization problem and propose Edge Pruning as an effective and scalable solution. Edge Pruning leverages gradient-based pruning techniques, but instead of removing neurons or components, it prunes the edges between components. Our method finds circuits in GPT-2 that use less than half the number of edges compared to circuits found by previous methods while being equally faithful to the full model predictions on standard circuit-finding tasks. Edge Pruning is efficient even with as many as 100K examples, outperforming previous methods in speed and producing substantially better circuits. It also perfectly recovers the ground-truth circuits in two models compiled with Tracr. Thanks to its efficiency, we scale Edge Pruning to CodeLlama-13B, a model over 100x the scale that prior methods operate on. We use this setting for a case study comparing the mechanisms behind instruction prompting and in-context learning. We find two circuits with more than 99.96% sparsity that match the performance of the full model and reveal that the mechanisms in the two settings overlap substantially. Our case study shows that Edge Pruning is a practical and scalable tool for interpretability and sheds light on behaviors that only emerge in large models.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
30 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Sparse Autoencoders Find Highly Interpretable Features in Language Models cites Towards Automated Circuit Discovery for Mechanistic Interpretability
- Sparse Autoencoders Find Highly Interpretable Features in Language Models cites Investigating Gender Bias in Language Models Using Causal Mediation Analysis
- Optimal ablation for interpretability cites Towards Automated Circuit Discovery for Mechanistic Interpretability
- Optimal ablation for interpretability cites Investigating Gender Bias in Language Models Using Causal Mediation Analysis
- Mechanistic Interpretability as Statistical Estimation: A Variance Analysis cites Towards Automated Circuit Discovery for Mechanistic Interpretability
- Mechanistic Interpretability as Statistical Estimation: A Variance Analysis cites Sheaf Discovery with Joint Computation Graph Pruning and Flexible Granularity
- Sheaf Discovery with Joint Computation Graph Pruning and Flexible Granularity cites Sparse Autoencoders Find Highly Interpretable Features in Language Models
- Sheaf Discovery with Joint Computation Graph Pruning and Flexible Granularity cites Towards Automated Circuit Discovery for Mechanistic Interpretability
- Sheaf Discovery with Joint Computation Graph Pruning and Flexible Granularity cites Investigating Gender Bias in Language Models Using Causal Mediation Analysis
- Rethinking Circuit Completeness in Language Models: AND, OR, and ADDER Gates cites Towards Automated Circuit Discovery for Mechanistic Interpretability
- Rethinking Circuit Completeness in Language Models: AND, OR, and ADDER Gates cites Investigating Gender Bias in Language Models Using Causal Mediation Analysis
- Rethinking Circuit Completeness in Language Models: AND, OR, and ADDER Gates cites Knowledge Circuits in Pretrained Transformers
- Knowledge Circuits in Pretrained Transformers cites Sparse Autoencoders Find Highly Interpretable Features in Language Models
- Knowledge Circuits in Pretrained Transformers cites Towards Automated Circuit Discovery for Mechanistic Interpretability
- Knowledge Circuits in Pretrained Transformers cites Investigating Gender Bias in Language Models Using Causal Mediation Analysis
Cited by top-tier papers30
- Knowledge Circuits in Pretrained TransformersYunzhi Yao, Ningyu Zhang, Zekun Xi, Mengru Wang et al.NeurIPS 2024 · 71 citations
- Optimal ablation for interpretabilityMaximilian Li, Lucas JansonNeurIPS 2024 · 32 citations
- Mechanistic Interpretability as Statistical Estimation: A Variance AnalysisMaxime Méloux, François Portet, Maxime PeyrardICML 2026 · 13 citations
- Sheaf Discovery with Joint Computation Graph Pruning and Flexible GranularityLei Yu, Jingcheng Niu, Zining Zhu, Xi Chen et al.EMNLP 2025 · 11 citations
- Rethinking Circuit Completeness in Language Models: AND, OR, and ADDER GatesHang Chen, Jiaying Zhu, Xinyu Yang, Wenya WangNeurIPS 2025 · 11 citations
Builds on21
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- Sparse Autoencoders Find Highly Interpretable Features in Language ModelsRobert Huben, Hoagy Cunningham, Logan Riggs Smith, Aidan Ewart et al.ICLR 2024 · 1,072 citations
- Towards Automated Circuit Discovery for Mechanistic InterpretabilityArthur Conmy, Augustine N. Mavor-Parker, Aengus Lynch, Stefan Heimersheim et al.NeurIPS 2023 · 861 citations
- Investigating Gender Bias in Language Models Using Causal Mediation AnalysisJesse Vig, Sebastian Gehrmann, Yonatan Belinkov, Sharon Qian et al.NeurIPS 2020 · 851 citations
- Sheared LLaMA: Accelerating Language Model Pre-training via Structured PruningMengzhou Xia, Tianyu Gao, Zhiyuan Zeng, Danqi ChenICLR 2024 · 453 citations
Related papers
- Weight-sparse transformers have interpretable circuitsLeo Gao, Achyuta Rajaram, Jacob Coxon, Soham Govande et al.ICML 2026
- Sparse Feature Circuits: Discovering and Editing Interpretable Causal Graphs in Language ModelsSamuel Marks, Can Rager, Eric J. Michaud, Yonatan Belinkov et al.ICLR 2025
- Efficient Automated Circuit Discovery in Transformers using Contextual DecompositionAliyah R. Hsu, Georgia Zhou, Yeshwanth Cherapanamjeri, Yaxuan Huang et al.ICLR 2025
- EfficientLLM: Unified Pruning-Aware Pretraining for Auto-Designed Compact Language ModelsXingrun Xing, Zheng Liu, Shitao Xiao, Boyan Gao et al.ACL 2026
- Scaling Sparse Feature Circuits For Studying In-Context LearningDmitrii Kharlapenko, Stepan Shabalin, Arthur Conmy, Neel NandaICML 2025
