Mechanistic Interpretability

Treat transformer circuits as causal hypotheses and examine what activation patching and sparse feature decompositions can establish.

Source
Anbloq
Language
English
Created
Updated
Chapters
3
Reading time
2 min
In this article3 chapters
  1. An intervention makes a circuit claim testable
  2. Necessity and sufficiency are separate tests
  3. Sparse coordinates provide candidate features

An intervention makes a circuit claim testable

Take paired sentences whose subject number differs, and choose a score \(\ell\) equal to the correct verb logit minus the competing logit on the reference task. Run the transformer on the two inputs. Replace a selected activation in the altered run with its counterpart from the reference run and measure

\[ \Delta=\ell(f_{\mathrm{patched}})-\ell(f_{\mathrm{altered}}). \]

A positive recovery across controlled pairs is evidence that changing the activation can affect this behavior in the chosen contexts. Matching positions and controlling other grammatical changes matters. Donor values from unrelated sentences give a useful comparison since a large score change can also reflect disruption of normal processing.

The shape of an activation tensor identifies which position and features an intervention changes. An absolute-value penalty explains in a simple case why a sparse reconstruction may give selected coefficients exactly zero.

Necessity and sufficiency are separate tests

Restoring several edges may recover a computation that no single edge restores on its own. Conversely, removing one pathway can have little effect when a redundant pathway remains. Measure the circuit under both directions of intervention, test on held-out input families and report the score left unexplained by the circuit. An activation patched into a different computation can yield a mixed state far from states normally encountered. Such interventions are causal within the modified model under the specified intervention, with additional evidence needed to generalize.

Sparse coordinates provide candidate features

A sparse autoencoder represents a residual vector by a few active decoder directions. A typical objective balances reconstruction error with a sparsity penalty, for example \(\|h-Dz\|_2^2+\lambda\|z\|_1\), with a suitable decoder normalization. Learned features can supply candidates for surgical interventions. Reconstruction error, feature splitting and overlap can change conclusions. Causal representation learning explains why the feature basis needs identification assumptions. Efficient transformer architectures describes the attention and state that such circuit analyses inspect.[1][2]

References

  1. Arthur Conmy et al., Towards Automated Circuit Discovery for Mechanistic Interpretability ↩
  2. Trenton Bricken et al., Towards Monosemanticity: Decomposing Language Models With Dictionary Learning ↩