Watch a Language Model Do Arithmetic
I gave a language model (2 + 3) * 4 and it wrote 20 without running a calculator. Using the paper's lens I read the model's half-formed answer out of each layer and watched it reach the sub-sum 5 partway up, then twenty near the top. The readouts are from a 4B model I ran myself.
Watch a language model do arithmetic
I typed (2 + 3) * 4 into a language model and it answered 20. It didn't run a calculator or any code, it just did one forward pass, the same single sweep through the network it uses to guess the next word in a sentence. So where does the 20 come from?
This is one of the things Anthropic works out in the paper linked below. A transformer builds its answer in stages, one per layer, and they built a lens (the Jacobian lens) that decodes the half-formed guess sitting in the model at any layer into plain words, a bit like clipping a probe onto a chip and reading the bus while it computes. None of that is mine. What I did was run their lens on a small model I could host myself and wire it to a slider, so you can scrub through the same thing: the guess reaches the inner sum 5 partway up, then twenty near the top, before it writes a single digit.
expr = as a quiz to echo back rather than solve, and computes nothing.The answer shows up as a word, not a digit
The answer shows up as twenty or forty, not 2 or 4. Inside the network the result is a number as a concept, and only in the last few layers does it commit to the actual digit it will write. That is what makes the lens worth using to me: I can read the meaning the model is holding before it turns into output.
What the lens actually is
A transformer keeps a running vector for each token, the residual stream, and refines it layer by layer until the top layer turns it into a next-word guess. The natural way to peek at an early layer is to shove its vector straight into that final guess step (the logit lens), but early vectors live in a different internal coordinate system, so the readout is mush. The Jacobian lens first applies the average linear map from that layer to the top before decoding, which is why5 and twenty come out as real words instead of noise. It is a read-only probe: it changes nothing about the model, it just reports what a layer is leaning toward saying.
Next, the same lens on a different kind of thought:
- A silent chain of reasoning : watch the model reach "Italy" without ever saying it.
- Planning the next word : rhymes and typo fixes it settles on before writing them.
- The global workspace : the paper's larger claim about what these readable thoughts are.
I computed these readouts on Qwen/Qwen3.5-4B with the lens neuronpedia/jacobian-lens@qwen-n1000. The method and the original arithmetic example come from Verbalizable Representations Form a Global Workspace in Language Models (Anthropic, 2026). Lens code: anthropics/jacobian-lens. I generated every number here with scripts/gen-lens-data.py in this repo; rerun it to reproduce.