Skip to the content.

Disassembling a transformer’s attention into a catalogued instruction set — lm-sae.

A frozen language model computes in a basis we didn’t choose. lm-sae reads that computation as a small, reused instruction set — names the operators (single attention heads / MLPs), collects the circuits (compositions of operators), validates them causally, surveys both across model families, and asks the harder question: can we decompile it — reconstruct the computation faithfully, not just label the components?

This site is generated from the repo’s tracked result artifacts and stays in sync with them. Source + how-to-run: github.com/jascal/lm-sae. New to the vocabulary? Every technical term is defined — with its canonical reference — in the Glossary.

Mode — natural history, borrowed from biology. A trained model is grown, not designed; we catalog the operators it developed, taxonomize them, and derive generalizable principles by comparing across model species (GPT-2 vs RoPE vs SSM). “Catalog,” not “atlas,” is deliberate — a growing, causally-tested record of what we’ve observed, not a claim of completeness. The edge over wet biology: we can breed synthetic specimens and intervene at high speed — train hosts, swap the mixer to a non-attention recurrence, and ablate / path-patch any component in milliseconds.

Amateur, exploratory home-science. Everything here is a working catalog, not the definitive one — findings are descriptive and provisional, measurements to be checked, not settled results. Where a mechanism is unknown we still list the specimen with what we measured, and say so.

The goal

Exhaustively explore, taxonomize, and collect causal dossiers on all operators and circuits we can find, across all the models we investigate — to the limit of what the tools can find.

Two model families anchor it: the absolute-position GPT-2 family (small / medium / large) and the RoPE family (Gemma-2-2B, Llama-3.2-1B, Qwen-2.5-1.5B), plus SSM (Mamba) for the no-attention control.

The theory

  disassembly (have) decompilation (target)
unit one head / MLP / idiom in isolation the composition — which ops chain into which
coverage % of attention legible % of the forward pass faithfully reconstructable
validation mean-ablation damages the metric recompile the program; KL ≈ host

The instruction set has two classes — MOVE = attention (a QK addressing mode × an OV write op) and COMPUTE = MLP (key–value memories). An operator is one head/MLP class (a family of heads, not a single head); a circuit is a composition — a writer-op feeding a reader-op’s K/Q/V port, chained. Decompilation coverage is 1 − KL(host ‖ recompiled[ops kept]) / KL(host ‖ all-ablated).

The throughline: a model is legible in the right basis even where it is not legible as single SAE features.

The catalogs (generated, kept in sync with results)

Analyses & results (the experiments)

Beyond the catalogs, the deeper experiments — read Cross-model findings for the narrative and Scaling synthesis for the central table.

The methodology & tools

Cross-architecture synthesis

See Cross-model findings for the curated narrative. In brief: the mechanisms are invariant (idioms, induction causal in all six models) and the positional register is absolute-position-family-specific (the sink, the positional-broadcast circuit, the decompilable fraction) — but several things people credit to architecture actually track scale (induction’s single-prev-token-writer key is a GPT-2-small trait that distributes with size; the token-determined MLP “embedding block” widens with scale). The recurring outliers are Gemma (low-sink, distributed key, strongest MLP0 extended-embedding) and Llama (context-determined MLP0, layer-0 induction enablers not inductors). Banked cautions: synthetic probes can manufacture apparent suppression; high causal effect ≠ doing the named operation; present ≠ depended-on. One level deeper, the in-context-copy capability survives a non-attention mixer (Mamba), though the mechanism is unverified.

Future work

Executable decompilation (recompile a validated circuit, KL ≈ host) · circuit-edge SAE-feature content (the operator SAE operands exist; the per-edge version is next) · the outlier follow-ups in Cross-model findings · the pivot to other models / more decompiler research. (Done: the MLP/COMPUTE family + its extended-embedding mechanism test, cross-model circuit discovery, dossiering the discovered candidates, the cross-model deep dossier (identity/causal/channel/redundancy) across all six models, the outlier digs, and per-operator SAE-feature operands on GPT-2 + Gemma — the catalog-depth gap, now filled.)

Sister tracks