Eddie Friedman

AI usage disclaimer: AI was used to create and write most of this website. While much was pushed from our paper, we plan to still rewrite and make more concise in the future.

Circuit – Diff

Factual Edit-based Intervention Method for Localizing Knowledge in Attribution Graphs

NeurIPS 2026 Workshop · Interpretability as a Science
Edward G. Friedman1
Xiangchen Song2
1School of Computer Science · 2Machine Learning Department · Carnegie Mellon University
The five steps of Circuit-Diff. 1, edit one fact: a MEMIT edit on layers 3 to 10 of 26 turns the original model M0, which answers Paris, into the edited model Me, which answers Rome. 2, trace both models: the same frozen CLT T0 builds graph A for the original and graph B for the edited model. 3, diff the graphs: nodes only in A disappeared with delta equal to minus one, nodes only in B appeared with delta equal to plus one. 4, control threshold: keep only nodes whose activation change exceeds the threshold set by neighborhood prompts. 5, rank each side by the score phi, the absolute delta to the power alpha times the change in logit influence. Below: recurrence across edits, where L18/f7269 is top-ranked in 4 of 25 edits, all French facts, and L7/f12622 is top-ranked in 12 of 25 unrelated edits.
The method in five steps. Blue is the original model and its graph A, orange the edited model and its graph B. Features found in only one graph are the candidates. A control threshold from neighborhood prompts removes the small movement every edit causes, and each side is ranked by how much the feature’s pull on the answer changed. Features that recur across unrelated edits track the edit procedure rather than the fact.
Main finding original model · old answeredited model · new answerbaselines

By editing one fact in a model and comparing attribution graphs, one can locate the features that carry it: those that disappear hold the old answer, those that appear hold the new one.

It works: patching these features moves the answer as much as the top-influence features, or more.

Background · Problem

Cross-layer transcoders turn a model’s answer into an attribution graph, but its features come unlabeled


A cross-layer transcoder (CLT) turns a language model’s computation on a prompt into an attribution graph: a sparse circuit of features, with weighted edges running from the prompt into the answer. The graph is a real object. You can inspect it, prune it, and intervene on it.

BackgroundA CLT turns a model’s answer to a prompt into an attribution graph

A language model reads the prompt 'The Eiffel Tower is located in the city of' and answers Paris. A cross-layer transcoder turns the same run into an attribution graph: features over the prompt tokens, joined by edges, leading to the answer.

ProblemBut features are unlabeled, requiring manual analysis

The real attribution graph for the Eiffel Tower prompt: 1,234 nodes stacked by layer over the prompt tokens, with the strongest links drawn faintly. Three nodes are circled and labeled L25/f9331, L20/f9908 and L18/f7269, each followed by a question mark.
The real graph for the Eiffel prompt: 1,234 nodes, the strongest 12% of links drawn.

Reading a graph means cutting it down to the nodes that matter and then working out, one feature at a time, what each surviving node is for, usually by scrolling through the text that makes it fire. Every new prompt, every new question, starts that process over.

Method · Circuit-Diff

Edit one fact, then compare the two graphs


Instead of labeling the graph, change the model and watch what moves. Take a fact the model knows, the Eiffel Tower is in Paris, and overwrite it with a low-rank MEMIT edit so the model now says Rome. Build the attribution graph before and after, through the same transcoder, held frozen. Because the lens does not change, any difference between the two graphs is a difference in the model, not in the dictionary you are reading it through. The five steps are the figure at the top of this page.

Check · The frozen CLT after an edit

Only prompts about the edited fact change


A fair worry: if the edit damages the transcoder’s fit to the model, the diff could be reading noise. We measured. The damage is real and it lands exactly where the edit does. On the edited prompt the graphs disagree most and the replacement score falls. On paraphrases the drop is smaller, and on unrelated prompts nothing moves.

Two box plots over 20 single edits. Left, feature agreement, the cosine between graphs A and B: median 0.41 on the edit prompt, 0.58 on paraphrases, 0.99 on unrelated prompts. Right, replacement score for the original model in blue and the edited model in orange: on the edit prompt it drops from 0.68 to 0.38, on paraphrases from 0.71 to 0.47, on unrelated prompts it stays near 0.69 and 0.67.
20 single edits. Feature agreement is cos(A, B). Replacement score is how well the CLT can replace the model. Fine-tuning the transcoder on the edited model does not recover the fit, so the frozen original is used throughout, which also keeps every feature readable on its released dashboard. This remains the method’s central limitation.
Causal test · 24 CounterFact edits · Gemma-2-2B

Circuit-Diff automatically selects features that move the answer as much as the top-influence features, or more


The selected nodes are patched back into the unedited model. Appeared nodes are scored on whether installing them reproduces the edit, raising the Rome logit. Disappeared nodes are scored on whether suppressing them lowers the Paris logit. Each set is compared against equal-size sets ranked by influence on the answer, ranked by activation, and drawn at random. In short: the features it selects causally carry the fact.

Circuit-Diff top influencetop activationrandom
Suppress the old answer
Box plot of the change in the old-answer logit when the top share q of disappeared features is patched, for q from 0.5% to 25%. Circuit-Diff in blue and top influence in dark gray both reach about minus 40 at 5%, a ratio of 1.0 times. Top activation and random are weaker.
Inject the new answer
Box plot of the change in the new-answer logit when the top share q of appeared features is patched, for q from 0.5% to 25%. Circuit-Diff in orange reaches a median of about 10 at 5%, 1.7 times the top-influence baseline at about 6. Top activation and random are lower still.

Equal-size sets, patched in the original model, with no control threshold applied. Medians at q = 5%: old answer −42.4 versus −41.3 for top influence (1.0×). New answer 9.98 versus 5.90 (1.7×). With the control threshold applied, top influence leads on the old-answer side. Single nodes rarely move the logit alone, since a concept is split across several features, so the group result is the one that matters.

Case study · Eiffel Tower

The features the diff flags are the ones about Paris and Rome, with no labels written by us


“The Eiffel Tower is located in the city of ___”  Paris→Rome

Graph A, original: disappeared in blue

Attribution graph A for the original model, layers 1 to 25 over the prompt tokens. Disappeared features are filled blue, concentrated at the final token and at 'in' and 'the', with one at layer 18 above 'Eiffel'.

Graph B, edited: appeared in orange

Attribution graph B for the edited model. Appeared features are filled orange, many in the edited layers across the whole prompt and again at the final token.

Top 8 features feeding “Paris” directly (graph A, original model)

Table of the top 8 features feeding Paris in graph A, with weight, Circuit-Diff rank, the text where each fires most and the tokens it promotes. Blue-barred rows: L18/f7269 fires on 'Grand Palais at Paris'; L20/f9908 fires on 'The Louvre Museum in Paris'; L25/f9331 fires on 'Supérieure, Paris, France'; L18/f14136 also fires on 'Grand Palais at Paris'; L19/f472 fires on 'the events of 1789'. Gray rows are features present in both graphs.

Top 8 features feeding “Rome” directly (graph B, edited model)

Table of the top 8 features feeding Rome in graph B. Orange-barred rows: L20/f4888 fires on 'Cancer Institute in Rome', ranked 1 by Circuit-Diff; L19/f4224 fires on 'Emperor Trajan' and promotes Caesar and legion, ranked 3. Gray rows are features present in both graphs.

Bar: blue = disappeared, orange = appeared, gray = in both graphs. φ n = rank by Circuit-Diff. Snippets show where each feature fires most, peak token darkest.

These are not detectors of the word Rome. They are the geography, history and associations around the old and new objects: the Grand Palais, the Louvre and 1789 on the Paris side, Rome and Emperor Trajan on the other. The same reading holds on other edits. Moving the Taj Mahal’s religion trades a Shah / Allah feature for Protestant / Christian / churches. Moving the Pentium II from Intel to Microsoft trades Hyper-Threading enabled CPU for a feature that fires inside Transact-SQL documentation.

Limitations

What the method does not measure


Try it

The viewer, with the diff wired in


The demo is the Eiffel Tower edit above, in a forked attribution-graph viewer: orange is appeared, blue is disappeared, gray is unchanged, with the ranked movers list and the feature dashboards wired in.

The Circuit-Diff viewer: an attribution graph with appeared features in orange and disappeared features in blue, the movers list open on the right.
The viewer on the edited prompt, movers list open.

Launch the demo

The library is open source on GitHub and pip-installable, and a precomputed bundle for this edit ships with it, so the viewer runs with no GPU and no model download:

pip install circuit-diff
cs load circuit_diff/examples/bundles/eiffel --serve

Loading, viewing and ranking a bundle needs only pandas. Building new graphs and running the causal patching needs a GPU and circuit-tracer. Two further tools ship alongside: multi-prompt aggregation, and rule-based grouping of features into supernodes. The summary tables behind every figure in the paper are released as a dataset on Hugging Face.