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.
Figures & tables
Figure 1: Overview of Spectral Circuit Analysis (SCA). SCA converts semantic-preserving paraphrases into instance-level mean gradients, extracts shared low-rank gradient subspaces within layer-type blocks via block-wise SVD, and projects the resulting spectral energy back to attention heads and MLP projections to produce a ranked list of circuit candidates.
Figure 2: Recovery score rA(K) on six GPT-2 Small circuit-discovery tasks. For each method A , attention heads are ranked by importance and the top- K are patched with corrupted activations; rA(K) measures the residual clean–floor gap (Eq. 8 ). Lower is better. Gray shading: Random baseline mean ±1σ over 5 seeds.
Figure 3: Cross-task similarity on 12 GPT-2 tasks. Heatmap (Left): pairwise similarity, diagonal masked; vertical band marks family. Dendrogram (Right): average-linkage on d=1−similarity , branches colored by family when all leaves agree.
Set
∣S∣
GT
GT$
SVA
SVA-Bi
SVA-BLi
CO
CC
PC
IOI
PP
GB
GP
Universal
9
0.99 ‡
0.86 ‡
1.79 ‡
1.74 ‡
1.79 ‡
1.34 *
1.47 ‡
1.25 †
0.86 †
1.11 ‡
4.51 ‡
1.82 ‡
GT spec a
2
0.32 ‡
0.40 ‡
−0.02
−0.03
−0.06
−0.30 *
−0.13‡
−0.05†
−0.50‡
−0.08
−0.06
−0.02
GT broad-4 b
4
0.50
0.45
0.09
0.19
0.15
−0.22
−0.06
−0.03
−0.07
−0.05
−0.70
−0.18
GT all
8
0.51
0.51
−0.24
−0.20
−0.11
−0.70
−0.67
−0.45
−0.69
−0.34
−1.77
−0.41
SVA spec
2
0.00
0.01
0.53 ‡
0.62 ‡
0.80 †
0.07
0.00
0.00
−0.01
−0.01
2.20 ‡
0.95 ‡
SVA broad
3
−0.01
−0.01
0.27 *
0.33 *
0.70 *
−0.11
−0.06
−0.04
−0.05
−0.04
−0.20
−0.06
Table 1: Cross-task subspace lift across candidate component sets. Each row is a candidate set of GPT-2 Small units (attention heads + MLPs); each column is one of 12 evaluation tasks. Values are mean lift in target-token logit difference when the residual stream is restricted to the candidate’s weighted unit-SVD subspace. ∣S∣ is the number of components in the set. Bold indicates positive effect with lift ≥0.25 . Significance vs. size-matched Monte-Carlo null: * ∣z∣≥2 , †∣z∣≥3 , ‡∣z∣≥5 . Task abbreviations: GT = Greater-Than, GT$ = Greater-Than-Price, SVA = Subject–Verb Agreement, SVA-Bi = SVA-Binary, SVA-BLi = SVA-BLiMP, CO = Color–Object, CC = Country–Capital, PC = Person–Country, IOI = Indirect Object Identification, PP = Person–Pronoun, GB = Gender Bias, GP = Gendered Pronoun.
Figure 4: Unit-level cross-task circuit in GPT-2 small. A unit is colored Universal when it ranks among the top-importance units in a majority of tasks; Family-shared when its importance concentrates within one family of related tasks, and task-specific when it is uniquely required by a single task; Task-specific markers carry that task’s abbreviation. A yellow outline marks units that pass causal validation ∣z∣≥3 . Grey dots denote units not assigned to any role at our discovery threshold.
The circuits framework in mechanistic interpretability aims to identify sparse subgraphs of model components that are causally responsible for a behavior, typically evaluated by measuring necessity and sufficiency. But these criteria say little about whether a circuit consistently captures how a model performs a task, or if it is specific to that task. We study these two properties, consistency and specificity, across six tasks and five models, extracting circuits at the component level (attention heads and MLP blocks) and at the level of individual MLP neurons. We find that component-level circuits are highly consistent and causally important for most tasks, but they are not specific: for a given task, ablating its own circuit drops accuracy by about as much as ablating another task's circuit. Neuron-level circuits, on the other hand, exhibit higher specificity across tasks, but far less consistency within tasks. This is explained by circuit overlap: component-level circuits share most of their components across tasks, related or not, while neuron-level circuits overlap only between closely related tasks. In a case study of the components shared by the task circuits of Llama-3.2-3B, we show that they consist mostly of MLP blocks, while the few attention heads within turn out to have general-purpose roles. Overall, our findings raise questions about the degree to which circuits can support targeted understanding of, and intervention on, model behavior.
Michael Li, Nishant Subramani
Northeastern University · Carnegie Mellon University – Language Technologies Institute
A central goal of mechanistic interpretability is to identify which internal components causally drive a language model's behavior. Because these importance estimates serve as the evidence for identifying circuits, systematic errors can lead to the misidentification of the underlying mechanisms. While activation patching provides a gold-standard causal metric, its computational cost is prohibitive at scale. Practitioners instead rely on attribution patching, a gradient-based, first-order approximation whose reliability remains poorly understood. In this work, we characterize the source of this unreliability, demonstrating that the dominant error stems from the non-linearities in the downstream network rather than local curvature at the patched component. This insight yields three practical tools: (i) a reliability score to detect untrustworthy estimates, (ii) error bounds quantifying potential attribution mis-specifications, and (iii) a Hessian-vector-product (HVP) correction that eliminates the leading-order error with only one additional backward pass. In evaluations across five model families (124M--9B parameters) and both random-token and naturalistic (name-swap) perturbations, HVP is the only second-order correction feasible at larger scale, where standard baselines like Integrated Gradients become computationally prohibitive. In comparative experiments, a multi-step HVP variant matches or exceeds the accuracy of Integrated Gradients at significantly lower compute, outperforming prior second-order baselines. These improvements lead to higher-fidelity circuit recovery on standard benchmarks and support a Screen-Flag-Fix workflow that targets computational effort only toward the components flagged as unreliable.
Luyang Zhang, Jialu Wang
Carnegie Mellon University · University of California, Santa Cruz
Understanding how neural networks arrive at their predictions is essential for debugging, auditing, and deployment. Mechanistic interpretability pursues this goal by identifying circuits--minimal subnetworks responsible for specific behaviors. However, existing circuit discovery methods are brittle: circuits depend strongly on the chosen concept dataset and often fail to transfer out-of-distribution, raising doubts whether they capture the concept or merely dataset-specific artifacts. We introduce Certified Circuits, which provide provable stability guarantees for circuit discovery. Our framework wraps any black-box discovery algorithm with randomized data subsampling to certify that inclusion decisions over circuit components--neurons or edges of the model graph, depending on the base algorithm--are invariant to bounded edit-distance perturbations of the concept dataset. Unstable components are abstained from, yielding circuits that are more compact and more accurate. We validate across three architectures (ResNet, ViT, GPT-2) on vision (ImageNet and four OOD datasets) and language (IOI, IOI-Hard, Greater-Than) tasks. Certified circuits achieve up to 56% higher accuracy and up to 80% fewer components, and remain reliable where baselines degrade. Certified Circuits puts circuit discovery on formal ground by producing mechanistic explanations that are provably stable and better aligned with the target concept. Code: https://github.com/AlaaAnani/certified-circuits.
Alaa Anani, Tobias Lorenz, Bernt Schiele +2
Max Planck Institute for Informatics, Saarland Informatics Campus, Saarbrücken, Germany · CISPA Helmholtz Center for Information Security, Saarbrücken, Germany