arXiv(opens in a new tab)cs.CLSep 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2609.10210

Through the Looking Glass: Directly Reading and Writing Transformers

Mark Oskin

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

How many of a transformer's components decide a token? Counted the standard way — feed-forward units and attention channels, scored by the absolute value of what each contributes to the logit — one prediction rests on three thousand to two hundred thousand of them. But contributions are signed, and across the eighteen models here the mass pushing away from the predicted token is a median of seven times the mass carrying it. Divide by the net instead and the same attribution on the same predictions returns dozens. On the model this paper is built on, fifty-three components carry ninety percent of a prediction, thirteen it cannot survive losing, and eight suffice to produce it with everything else at that position zeroed. Across twelve models trained by other people, 124 million to seven billion parameters, the sufficient set runs from two components to sixteen, and what a prediction draws on, followed all the way back, is one to three percent of the model, a share that does not grow with size. The rest of the model is neither idle nor holding work for later tokens: three quarters of what a layer adds to the residual is a fixed linear map of the state it received.

Everything here is read from the model's own parameters and activations, with nothing trained and nothing fitted, and it names a component on both sides. What a component writes is named from the predictions it drives, reaching close to half of every model, and the name is a share of the drive that predicts what deleting the component costs. What it reads is decoded from its weights in the frame of its own layer, at 58.9 percent above chance over its eight strongest inputs and below chance once enough of the list is asked for; sorting the remainder by which upstream component supplies it separates it into grammatical categories the embedding cannot see.

A name can be acted on. An association the model does not hold installs into one spare unit, key and value read from the weights, moving the target from rank 578 to rank 1 for a quarter of one percent of held-out loss — a fortieth of what a rank-one update costs to reach the top ten. Where an edit lands is set by the architecture: a write before the second layer keeps a tenth of its direction at the readout, one in the last third up to eight tenths. An attention head installed to mark a token and a unit installed two layers above it to read the mark make an edit fire only where that token occurred earlier in the context, and a unit the model trained for itself is driven from two layers upstream with 86 percent of the effect passing through it. Replacing the activation with an order-preserving one makes a unit's inputs readable at the instrument's ceiling, flat across the list rather than decaying, at the price of turning an install into a two-part edit.

1 Introduction

A transformer produces a token. How, specifically, did it do that? Are there identifiable parts of the model that matter to that particular prediction, and can they be traced — a “circuit” used for that specific token? They can, and the circuit is small. A handful up to a few dozen components do the work behind any one prediction, and most of what a transformer computes at a position is a side effect of the architecture: moving data between layers and keeping its own geometry organized.

That is not what the literature would lead one to expect. In the basis a transformer actually has, individual feed-forward units and attention channels, published counts run to thousands or tens of thousands of components for a single behavior [33], and the accounting in common use reproduces that here: measured the standard way, one prediction in the models below rests on three thousand to two hundred thousand components. A number that size is not an explanation of anything.

It is also wrong. Contributions to a logit are signed, so they cancel, and the mass pushing away from the prediction is a median of seven times the net across the models here and twenty times it on the model this paper is built on. The standard count divides by the absolute total, and so counts that opposing mass as part of the answer. Divide by the net instead and the same attribution on the same predictions returns dozens. The opposing mass is not a rival circuit the net hides. A model writes its prediction into the token frame directly rather than assembling it elsewhere and turning it on, and it does not use that frame as scratch space [41]; so the net contribution is the model writing the output, and the rest is the residual stream being carried between layers and kept organized so that many things can share it [18]. Our lens separates that management from the prediction, and what remains is a small legible circuit.

This paper concerns the legibility and editability of transformers. What exactly does that mean? The intuitive versions are easy enough to state.

  • A component is legible if what it does can be stated. Two things have to be readable: what drives it, and what it produces. A name for either has to meet two conditions. It must be coherent: the tokens that drive the component share something, and so do the tokens it promotes. And it must be verified against the model's behavior rather than against whether the list looks sensible. What a component is credited with writing depends about equally on its weights and on when it fires, so a column read on its own narrows the answer to a seventh of the vocabulary and no further (Appendix C.11). What does supply them is behavior: the predictions a component drives name what it writes, and the positions where it fires name what it reads. Where no token covers the answer, a component can still be described by the circuit it fits within.

  • A model is legible if the connections between its components can be followed. When it generates a token there must be a trace of why it produced that one, and the trace must explain the choice to someone reading it. The path must be traceable end to end and land in the token embedding space where it meets the input and the output, even when what it passes through in between is conceptual. Ideally a trace is small enough for a person to read; it must in any case be complete enough to include what actually decided the token.

  • A component is editable if its behavior can be changed, the model respects the change, and everything unrelated is left alone. Install an intended behavior into one named component, measure how strongly the model takes it, and measure how much else moved. Neither number means anything alone, since any edit is respected if pushed hard enough and any edit is harmless if pushed gently. Editability is therefore a trade-off rather than a threshold.

Our aim was a lens derived from the transformer's own parameters, with no training or fitting of its own. Good fitted explainers exist: a sparse autoencoder trained on a model's activations recovers features a person can name, and we reproduce that result in Appendix C. The reason we did not build on one is that a fitted explainer is a second model, and understanding it becomes a prerequisite to understanding the transformer it was meant to explain. Simple is good if it works.

On the model this paper is built on, the lens returns three numbers answering three questions about one prediction. Fifty-three components carry ninety percent of it. Thirteen it cannot survive losing: removing them changes the answer, where removing the same number at random leaves it alone. And eight suffice to produce it — keep those eight at a position, zero every other feed-forward unit and attention channel there, let the survivors recompute, and the model emits the same token. Eight random components in their place never do, on any of 115 predictions we tested.

The rest of the model is neither idle nor holding work for later tokens. Keep only the circuit at a position and the cost at the token being predicted is a quarter of what an equally sized random set costs, and on each of the next five hundred and twelve tokens the two cost the same. What the remainder is doing is managing the workspace: three quarters of what a layer adds to the residual is a fixed linear map of the state it received, applied whatever the model is about to say, and that work is spread across every component rather than concentrated in a few. Cancellation is far more severe arriving at a component than leaving the model — about a dozen upstream components reach ninety percent of a unit's incoming drive counted signed and many thousands counted absolute, a factor of roughly a thousand against about twenty at the readout.

Most of this paper's effort goes into the gap between finding a component and reading it. A component is named on both sides. What it writes is named from the predictions it drives, which reaches close to half of every model, and the name is a share of the drive that predicts what deleting the component costs. What it reads is named from its own weights, decoded in the frame of its own layer rather than through the vocabulary: asked for a unit's eight strongest drivers, the parameters recover the true set at 58.9 percent, thirty-seven times chance, and that agreement is confined to the head of the list. Somewhat over a quarter of what drives a unit falls on tokens the embedding groups into a category; the remaining three quarters have no name in the vocabulary at all, being concepts the model builds for itself, and sorting them by which upstream component supplies them separates them into grammatical categories the embedding cannot see. The same reading extends to attention, where a channel's value projection is evaluated at the position it attends to, and the drop between what a layer's attention reads and what its feed-forward block reads is the context that layer delivered.

Naming a component is one half of the problem; acting on it is the other. An association the model did not hold installs into a single spare component, with the key and the value both derived from the weights without fitting, moving the target from rank 578 to rank 1 for a quarter of one percent of held-out loss — a fortieth of what the rank-one update the editing literature established costs to reach the top ten. Where such a write can be made turns out to be a property of the architecture rather than of the component chosen. The bottom two layers erase the input token and stash it off the token axis, so a write made there loses most of its direction by the readout. The top layer answers in the token frame, which is the frame the readout reads and the only one a write acts on directly, so the last hop of a circuit belongs in that frame and the earlier hops do not — though not in that layer, which consumes readout-frame content rather than carrying it, and is the one place preservation falls instead of rising. Between the two, the residual carries a write in the coordinates it was written in, and the baseline uses about a quarter of its width, the same quarter at every depth, so a direction drawn at random carries a signal from one installed component to another with nothing else in the model oriented to read it. That is enough to build a circuit across two layers from components that did not exist before, and to drive a unit the model trained for itself from two layers upstream, with 86 percent of the effect passing through it.

Two further sections take the lens beyond the model it was built on. Section 5 replaces the activation function with an order-preserving one, sigmoid or softplus, which makes a unit's inputs readable at the instrument's ceiling, flat across the whole list where the conventional unit decays below chance; the price is that such a unit is never silent, so an association installed into it alone arrives everywhere at once, and the install becomes a two-part edit. ReLU buys legibility with accuracy. Section 6 applies the lens unchanged to twelve models trained by other people, from 124 million to 7 billion parameters across seven architecture families. There the sufficient set runs from two components to sixteen with the largest models at its small end, and on gated feed-forward models nearly half the components carrying a prediction fire negative, so a scope read without that sign lands on the wrong tokens.

Section 2 builds the lens and applies it to the baseline: the accounting, what is necessary, what is sufficient, and what the rest of the model is doing. Section 3 names components, on the write side from behavior and on the read side from weights, and follows the part the vocabulary cannot name back to its sources. Section 4 acts on the names: a gain, an install, where an edit can be placed, a circuit across two layers, a tap into a trained unit, and a comparison against a rank-one editor. Sections 5 and 6 are the two above. Section 7 places the work, Section 8 takes up what the measurements ask of the architecture, and Section 9 closes. Appendix A is a gallery of traces drawn mechanically rather than chosen, two per model, where a reader can see what a trace actually looks like; Appendix B is the set-operator model of Section 5 and how it is trained; Appendix C is the measurements that failed, the conventions that flatter and are therefore not used here, and the ways each number here could have been made to look better by choosing a different null. Appendix D is the dependency graph: the edge relation between components, the closure it builds, and why that closure is a necessity object rather than a sufficient one.

References (58)