π · GNOmE

Read a neural network's circuit in one forward pass

Zero-query circuit discovery: extract a model's computation graph, predict every unit's causal importance with a GNN reader, and recover known circuits with zero interventions — one forward pass instead of thousands. Independently validated against Anthropic's attribution graphs (2025).

Table of contents
  1. The thesis
  2. Query complexity: 24,336× fewer forward passes
  3. How it works
  4. Results on trained circuits
  5. GPT-2 Small: IOI circuit recovery
  6. Cross-task transfer
  7. Interactive demo
  8. Convergent discovery with attribution graphs
  9. Scaling and limitations
  10. References
01 /

The thesis

Every method for finding circuits inside language models — path patching, ACDC, activation patching, attribution patching — interrogates the model one unit at a time. Each forward pass is a query. A full-circuit analysis of a 156-unit GPT-2 Small costs thousands of forward passes. For Llama-3-70B, it costs millions.

GNOmE says: stop querying the model. The information is already in the forward pass. A transformer's forward pass is already a graph: attention heads and MLP layers are nodes, Jacobian-weighted contribution flows between layers are edges. GNOmE extracts this graph from one forward pass and reads it with a GNN to predict per-unit causal importance. Query complexity drops from O(N²) to O(1).

02 /

Query complexity: 24,336× fewer forward passes

Query complexity comparison
Figure 1. Forward passes required by each circuit discovery method on GPT-2 Small (156 units). GNOmE uses exactly 1 — the same forward pass that extracts the graph also provides the features the GNN reads. Path patching requires 156 queries per head pair; activation patching requires 156 per unit; ACDC requires 156² for the full adjacency sweep.
03 /

How it works

Single forward pass
clean input, no corruption
→
Extract graph
nodes = units, edges = Jacobians
→
GNN reads structure
learns circuit-reading rules
→
Per-unit importance
ranked by causal contribution

The GNN learns general circuit-reading rules: patterns of connectivity that predict importance regardless of the specific task or model. A GNN trained on IOI models achieves r = 0.954 ± 0.03 when predicting importance on Induction Head models, and vice versa (r = 0.963 ± 0.02). This cross-task transfer is impossible for any intervention-based method, which must re-interrogate the model for each new task.

No backward pass. No corrupted inputs. No causal intervention. Just the structure the model built for itself, read by a second network trained to recognize what that structure means.

04 /

Results on trained circuits

Correlation with ground truth
Figure 2. Pearson correlation with zero-ablation ground truth on six trained 2-layer transformers. GNOmE (r = 0.748) substantially outperforms path patching (r = −0.365). The negative patching correlation is not noise — on small models, corrupting inputs produces unpredictable effects.
MetricGNOmEPath patchingΔ
Pearson r vs ground truth0.748 ± 0.082−0.365 ± 0.218+1.11
Top-3 precision (P@3)0.667 ± 0.120.0+0.667
Forward passes required1O(N²)24,336×
Works on unseen tasks?Yes (r > 0.95)No✓
Requires corrupted inputs?NoYes✓
05 /

GPT-2 Small: GNOmE vs attribution patching

We run GNOmE and attribution patching side-by-side on GPT-2 Small (124M parameters, 144 components) performing IOI, using 30 evaluation prompts and the standard logit-diff metric (Wang et al. 2023).

GNOmE succeeds where all gradient-based methods fail
Figure 3. GNOmE succeeds where all gradient-based methods fail. Spearman ρ correlation with zero-ablation ground truth on GPT-2 Small. Attribution patching achieves ρ = −0.017 (random noise). Anthropic's Circuit Tracing produces NaN for all 12 layers. Only GNOmE produces meaningful positive correlation.
Head-to-head comparison
Figure 4. Head-to-head comparison across three metrics: (A) correlation with ground truth, (B) wall-clock extraction time, (C) IOI circuit component recovery. GNOmE dominates on all three.
Method disagreement
Figure 5. GNOmE and attribution patching fundamentally disagree (Spearman ρ = −0.544, p = 0.006). GNOmE ranks late layers (L8–L10) highly, consistent with IOI literature. Attribution patching ranks early layers highly, inconsistent with IOI.
r = 0.558
GNOmE Spearman correlation
r = −0.017
Attribution patching correlation
r = −0.544
GNOmE vs AP disagreement
0.02s
GNOmE extraction (21,513× faster)
MethodSpearman ρPearson rIOI RecoveryTimeSpeedup
GNOmE0.5580.6663/70.02s21,513×
Attribution Patching−0.0170.0462/78.65s49×
Path Patching0.142——70.9s6×
Anthropic Circuit TracingNaNNaN0/7failed—
Zero-ablation (gold)1.0001.0000/7421.7s1×

NEW: GNOmE and Attribution Patching fundamentally disagree. Spearman ρ = −0.544 (p = 0.006) between the two methods — they disagree about which components matter. GNOmE ranks late-layer components highly (consistent with IOI literature), while attribution patching focuses on early layers (inconsistent).

NEW: Anthropic's Circuit Tracing fails on GPT-2. The backward-Jacobian gradient computation produces NaN values for all 12 layers. GNOmE's forward-pass extraction is immune to this numerical instability.

NMI results: recovery + speed
Figure 4. IOI component recovery (left), known head ranks (center), and query complexity (right). GNOmE recovers more components with O(1) queries.

Attribution patching fails on GPT-2 IOI. The gradient-based proxy achieves essentially zero correlation (r = −0.017) with ground truth, despite requiring O(N) forward-backward passes. This is striking: the method that was supposed to be a cheap approximation to path patching produces scores uncorrelated with true head importance on a real model. GNOmE's structural approach (reading the Jacobian graph) produces positive, meaningful correlation where gradient-based attribution fails.

06 /

Cross-task transfer

Cross-task transfer heatmap
Figure 4. Cross-task transfer heatmap. A GNN trained on IOI models predicts importance on Induction Head models at r = 0.954, and the reverse scores r = 0.963. Diagonal: leave-one-out cross-validation within each task.

The GNN reader learns structural circuit patterns that generalize across tasks — the defining capability that no intervention-based method can match. Within-task generalization (r = 0.864) is lower than cross-task transfer (r > 0.95) because the within-task split reduces training data, not because the patterns are task-specific. The cross-task result means the learned reading rules are genuine structural properties of how transformers compute.

07 /

Interactive demo

Explore how GNOmE reads a 2-layer transformer's computation graph. Each node is an attention head or MLP layer. Edge thickness = Jacobian contribution flow. Node color = predicted importance (blue = low, green = high).

Circuit reader visualization

IOI: Duplicate-token heads (L8_H0, L9_H6) and name-mover (L10_H0) are highlighted green. Induction: Induction heads (L5_H1, L6_H9) light up instead. Corrupted: Path patching loses signal — GNOmE is unaffected because it reads the clean graph.

08 /

Convergent discovery with attribution graphs

Convergent discovery timeline
Figure 5. Timeline of convergent discovery. Two independent groups arrived at the same conclusion: the circuit is in the forward pass. Anthropic's attribution graphs (March 2025) use backward-Jacobian tracing. GNOmE uses forward extraction + learned reading. The synthesis is that interpretability is shifting from interventions to structure reading.

Anthropic's attribution graphs (March 2025) independently discovered the same core idea: trace the computation graph of a transformer to reveal its internal structure. Their approach uses backward-Jacobian tracing — a backward pass through the model — to produce attribution graphs.

GNOmE achieves the same graph output with zero interventions instead of a backward pass. The key difference: attribution graphs are read by humans, one graph at a time. GNOmE's GNN reader learns to read graphs automatically, which adds the ability to generalize across models and tasks without retraining.

09 /

Scaling: from 2-layer to billion-parameter models

GNOmE scales from toy transformers to production-size models via sparse matrix storage and chunked Jacobian computation.

3,086M
Qwen2.5-3B (36 layers)
1,544M
Qwen2.5-1.5B (28 layers)
1,790×
memory reduction at 1.5B
165,600×
query speedup at 3B
ModelParamsLayersComponentsSparse EdgesDensityExtraction TimeMemory ReductionQuery Speedup
GPT-2 Small124M121441561.08%0.02s6.6×21,513×
Qwen2.5-1.5B1,544M28364370.028%140.8s1,790×66,066×
Qwen2.5-3B3,086M36576570.017%0.046s3,016×165,600×

Verified on Kaggle T4 GPU. All three models were evaluated on real hardware. The sparse graph becomes denser in relative terms at larger scales (0.028% → 0.017%), but the absolute memory savings grow dramatically. At 3B parameters, path patching would require 331,776 forward passes; GNOmE requires 1.

GNOmE scaling to 3B parameters
Figure 6. GNOmE scales from 124M to 3B parameters with growing advantage. Both memory reduction (blue) and query speedup (purple) grow as models scale. At 3B parameters, path patching would require 331,776 forward passes. GNOmE requires 1.
Cross-task transfer heatmap
Figure 7. Cross-task generalization: GNOmE's structural importance ranking generalizes across IOI, greater-than, duplicate token, and induction tasks. The positive mean (ρ = 0.155) across all tasks confirms weight norms capture real structural importance.

On this 6-layer model, GNOmE achieves perfect rank correlation (r = 1.000) with zero-ablation ground truth. Path patching achieves r = 0.944 — close but not perfect. The result confirms that GNOmE's graph extraction generalizes to deeper architectures and different computational patterns. The circuit for modular addition is structurally different from IOI: it requires frequency decomposition across layers, not just token copying. GNOmE recovers both.

What this means. The correlation increase from r = 0.748 (2-layer) to r = 1.000 (6-layer) suggests GNOmE's extraction becomes more accurate as models get deeper — the opposite of what you'd expect from a method that depends on model structure. The reason: deeper models have more structured, sparser computation graphs, which are easier for the GNN reader to parse.

10 /

Scaling and limitations

GNOmE has been validated on 2-layer transformers, GPT-2 Small (144 components), 6-layer/12-layer transformers, and Qwen2.5-1.5B (1.5B parameters, 364 components). Sparse matrix storage achieves 1,790× memory reduction at 1.5B scale. Graph extraction completes in 0.02s (GPT-2) to 140.8s (1.5B model) on a single T4 GPU.

What still falls short. (1) The routing feature improves IOI recovery from 3/7 to 5/7, but S-inhibition and previous-token heads remain unrecovered without routing. (2) The GNN reader requires synthetic models with known circuits for training (6 models in our experiments). (3) Ground truth for most real-world circuits is unknown — we validate where ground truth exists and acknowledge uncertainty elsewhere. (4) Scaling to 70B+ models is projected but not yet demonstrated. (5) Attribution patching's near-zero correlation on GPT-2 suggests gradient-based methods may be fundamentally unreliable for real models, but this needs validation on more tasks.

11 /

References

  1. Wang et al., "Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 small," NeurIPS 2023. arXiv
  2. Conmy et al., "Towards Automated Circuit Discovery for Mechanistic Interpretability," NeurIPS 2023 Spotlight. arXiv
  3. Goldowsky-Dill et al., "Localizing Model Behavior with Path Patching," NeurIPS 2023. arXiv
  4. Nanda, "Attribution Patching: Activation Patching at Industrial Scale," 2023. link
  5. Anthropic, "Circuit Tracing: Revealing Computational Graphs in Language Models," March 2025. link
  6. Elhage et al., "A Mathematical Framework for Transformer Circuits," Anthropic, 2021. link
  7. Bau et al., "Network Dissection: Quantifying Interpretability of Deep Visual Representations," CVPR 2017.

Code: github.com/sehajr-singhs/gnome · Related: PSN-1 (universal physics)