Circuit Tracing Through Recurrent State: Exact Attribution Graphs for Hybrid Linear-Attention Language Models
Attribution graphs trace how a language model computes its answer on a prompt, through sparse transcoder features, and have become a standard tool of mechanistic interpretability. To our knowledge they have so far been limited to pure-attention transformers, while many recent open models are hybrids that interleave a few softmax-attention layers with recurrent linear-attention layers such as Gated DeltaNet (GDN). We show that freezing a GDN layer's queries, keys, write strengths and decays, the exact counterpart of freezing softmax attention patterns, turns each head into a fixed lower-triangular effective attention matrix with a closed form, so the attribution-graph construction applies to hybrids exactly, in the same sense as for transformers. Our engine, statetrace, reproduces the reference implementation edge for edge on a pure-attention model (relative error ≤ 3.1×10⁻⁶) and its graphs add up exactly (largest additivity residual 1.1×10⁻⁶) on Qwen3.5-0.8B. We train transcoders for all 24 Qwen3.5-0.8B layers and, as a matched baseline, for all 28 layers of the pure-attention Qwen3-0.6B with the same recipe. An exact decomposition of every cross-position edge into recurrent-only, attention-only and mixed paths shows that (i) 50% of the hybrid's edge influence crosses token positions, 39% on recurrent-only paths versus 7% on attention-only paths, a 5.6× gap that shrinks to 1.9× when normalised by the 18:6 layer count; (ii) on induction prompts attention layers carry more far-reaching influence per layer, whereas on two-hop prompts recurrent layers do, also after excluding the first two positions; and (iii) on prompts of 100–370 tokens, 21% of the influence on the answer originates in a single "needle" sentence. Cutting each route in the real, unfrozen network, however, shows that exact retrieval and copying need the attention route (cutting it removes the answer from the top-1 position on every such prompt) while the recurrent route is largely redundant: attribution and causal necessity diverge, and the same holds at a larger scale, Qwen3.5-2B. A generated set of 660 prompts per model confirms this and localises the recall to two of the six attention layers. With matched transcoders, the hybrid moves more of its computation across positions than the pure-attention model (50% vs 39%), and across 8,400 single-feature ablations its graphs are at least as faithful to the real model (pooled Spearman 0.32 vs 0.21). Code: https://github.com/Madhav-Bhanushali/statetrace
Authors
- Madhav Bhanushali
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-12-01
- DOI
- https://doi.org/10.5281/zenodo.24715991
- Primary Topic
- Explainable Artificial Intelligence (XAI)
- Type
- preprint