Beyond Patching: Consistent Circuit Discovery via Gradient Spectral Analysis
Abstract
Mechanistic interpretability seeks to reverse-engineer neural networks by identifying small, faithful subgraphs--circuits--that implement specific behaviors. The dominant paradigm scores each unit by replacing its clean activation with a corrupted counterpart as causal intervention. While effective, this approach rests on a brittle prerequisite: the structure prompt pairs are task-specific, expensive to engineer, and silently couple the discovered circuit to prompt-design choices. In this work, we propose Spectral Circuit Analysis (SCA), a gradient-spectral pipeline that achieves consistent circuit discovery along both axes: stable across input formulations of the same task, and natively exposing structure shared across tasks. Our contributions are threefold. First, we provide a counterfactual-free reframing of circuit discovery: causally relevant directions are recoverable from the spectral structure of forward gradients across paraphrases, with leading directions concentrating task signal and trailing ones absorbing paraphrase noise, yielding circuits tied to the task rather than the prompt. Second, we introduce SCA, a block-wise SVD pipeline that extracts a task subspace per architectural block and redistributes spectral energy onto constituent units via a consistency-weighted share, producing per-unit rankings competitive with attribution-patching baselines under strictly less supervision. Finally, on twelve circuit-discovery tasks in GPT-2 Small and Pythia-160M, SCA performs comparably or exceeds EAP-family methods under the standard recovery-score protocol and recovers IOI canonical heads with Precision@K = 1.0 in top-10 slices on GPT-2 Small; the same machinery extends to a unified cross-task analysis classifying units as universal, family-shared, or task-specific and exposing compositional structure invisible to per-task analyses.
Create a lesson
Metadata
- Categories
- cs.LG, cs.AI
Related papers
Rewirable Circuits in Transformers with Loom Attention
Shared title terminologycs.LGDa Xiao, Qingye Meng, Shengping Li et al.
Diagnostic Accuracy Is Not Deployment Value: Decision-Aligned Reliability Evaluation for Foundation MLIPs in Materials Discovery
Shared title terminologycs.LGHarry Sevi, Joonatan E. M. Laulainen
Beyond Fixed Prompt Configuration: Alternating Policy Learning for Adaptive Topology-Based Prompting in Few-Shot Graph Learning
Shared title terminologycs.LGYizhuo Ma, Yihong Huang, Rongzheng Wang et al.
Beyond PINNs: Boundary-Enriched Holomorphic Networks for Laplace Problems
Shared title terminologycs.LGAndrei Vlad Nicula, Kalp Shah, Robert-Stefan Sofroni et al.
Vanishing Initialization Turns Diagonal Tensor Gradient Flow into Greedy Matching
Shared title terminologycs.LGDmitry Yarotsky, Eugene Golikov, Yaroslav Gusev
Beyond Accuracy: A Diagnostic Benchmark for Hypothesis-Driven Experiment Planning in LLM Agents
Shared title terminologycs.LGRyo Kuroki, Amin Mansouri, Philippe Schwaller