Attribution graph

Also known as: circuit tracing

On this page 7

An attribution graph is a directed graph of causal feature contributions that traces how interpretable features inside a neural network produce one specific output on one specific input. Its nodes are input tokens, learned features, approximation errors and output logits, and its weighted edges show how strongly each node directly influences the next. In Explainable AI, attribution graphs belong to mechanistic interpretability, and the method of building them is often called circuit tracing.

The technique was popularized in 2025 for large language models, where researchers used it to reveal multi-step reasoning, planning ahead in poetry and the internal paths behind refusals. Unlike a saliency map, which only scores input tokens, an attribution graph exposes the intermediate computation between input and output, making it a prompt-level picture of a model circuit.

How an attribution graph is constructed

An attribution graph is built on a replacement model, an interpretable stand-in for the original network. Researchers first train transcoders, often cross-layer transcoders, that reconstruct the output of each MLP block from a sparse set of features. Each feature ideally represents one human-readable concept, which reduces the polysemanticity of raw neurons.

For a given prompt, the replacement model is made locally linear: attention patterns and normalization terms are frozen at the values the original model computed. In that frozen setting, the direct effect of every active feature on every later feature can be computed exactly as a linear contribution. The difference between the replacement and the real model is kept as error nodes, so the graph never silently hides what the transcoders fail to explain.

The resulting graph is usually far too large to read, so it is pruned to the nodes and edges that carry most of the influence on the chosen output logit. Analysts then group related features into supernodes, such as a cluster that represents the concept of a capital city.

Node typeWhat it representsInterpretive value
Embedding nodeAn input token at a positionAnchors the graph in the actual prompt
Feature nodeAn active transcoder featureCarries a nameable concept or operation
Error nodeUnexplained residual at a layerShows where the approximation is weak
Logit nodeA candidate output tokenDefines the behavior being explained
SupernodeManually grouped related featuresSimplifies the circuit for human reading
Node types in an attribution graph

Validating the graph with interventions

An attribution graph is a hypothesis about the mechanism, so it must be tested on the original model. The standard test is an intervention experiment: suppressing or amplifying a feature in the real network and checking whether downstream features and the output change as the graph predicts. When suppressing a hypothesized intermediate concept removes the answer, the evidence for that path becomes much stronger.

The table below summarizes the measurements researchers use to judge whether a graph is trustworthy.

CheckWhat it measuresWarning sign
Replacement fidelityHow closely the replacement matches outputsLarge divergence on the studied prompt
Error shareInfluence routed through error nodesErrors dominate the key paths
Intervention agreementEffect of steering on the real modelAblations do not change the output
Pruned completenessInfluence kept after pruningImportant paths removed by thresholds
Feature interpretabilityConsistency of feature activationsLabels fit only a few examples
Quality checks for attribution graphs

Comparison with other interpretability methods

Attribution graphs differ from feature attribution methods because they explain internal structure, not only input importance. SHAP, Integrated Gradients and saliency maps assign a score to each input element, whereas an attribution graph shows which intermediate concepts link the inputs to the output. It also differs from activation patching, which tests one component at a time but does not produce a complete map.

MethodUnit of explanationMain output
Attribution graphSparse features across layersWeighted causal graph for one prompt
Saliency mapInput tokens or pixelsImportance score per input element
Activation patchingIndividual heads or neuronsCausal effect of one component
Logit lensResidual stream per layerIntermediate next-token guesses
Probing classifierLayer representationsWhether a property is decodable
Attribution graphs and related techniques

In practice these methods complement one another. A logit lens or probe can suggest where a concept appears, activation patching can confirm a single step, and an attribution graph can show how the steps connect into a circuit.

What attribution graphs have revealed

Published attribution graphs have provided concrete evidence of internal multi-step reasoning in language models. For a prompt asking for the capital of the state containing Dallas, graphs showed a feature for Texas activating before features that promote Austin, indicating a genuine two-hop path rather than a memorized shortcut.

  • Planning in poetry, where features for a rhyme word activate before the line that ends with it is written.
  • Shared multilingual concepts, with language-specific features only at the input and output ends.
  • Arithmetic pathways that combine an approximate magnitude route with a precise last-digit route.
  • Refusal and hallucination circuits, including default can-not-answer features that known entities suppress.
  • Unfaithful chain of thought, where the stated reasoning does not match the traced computation.

Limitations and practical use

Attribution graphs explain one prompt at a time, so a circuit found on one example may not generalize. They also treat attention patterns as fixed, which means they show what information flows through attention but not why the model attends where it does. Significant error nodes indicate that part of the computation remains unexplained.

LimitationConsequenceMitigation
Frozen attentionQuery-key computation stays hiddenAdd separate attention analysis
Transcoder errorGaps in the explained mechanismLarger dictionaries, report error share
Single-prompt scopeFindings may not generalizeCompare graphs across prompt families
Manual labeling effortSlow and subjective interpretationAutomated interpretability for labels
Compute costHard to apply to frontier modelsTrace smaller open models first
Common limitations and mitigations

Open-source tooling now lets researchers generate and browse graphs for open-weight models through interactive interfaces. The method is best suited to auditing specific behaviors, such as a suspicious refusal or a factual error, rather than to routine production explanations for end users.

Understanding it simply

A language model answers a question through many hidden steps. An attribution graph is a map of those steps. It shows which ideas the model activated and how each idea pushed toward the final answer.

Think of tracing how a rumor spread through a town. You note who told whom, and how much each person influenced the next. The map does the same for concepts inside the model. Researchers then test the map by switching off one idea. If the answer changes as predicted, the map is likely correct.

Applied in practice

An interpretability team at a research lab investigates why an open-weight chat model refuses a harmless chemistry question about cleaning products. They generate an attribution graph for the prompt and prune it to the nodes carrying most influence on the refusal token. The graph shows a path from the word bleach through a dangerous-chemicals feature to a general harmful-request feature that promotes the refusal.

The team suppresses the dangerous-chemicals feature in the original model and observes that the refusal disappears and a safe answer appears. Error nodes account for a modest share of influence, so they consider the finding credible. The result guides targeted fine-tuning data that reduces over-refusals on household safety questions without weakening refusals for genuinely harmful requests.