The machine you described
Its tape, its head, and its state, as the universal machine runs it.
The universal machine
Its whole tape: your machine written as data, then your machine's tape. It is now finding the described machine's head.
The network's step
Every step above is one forward pass: read three tokens of the transcript, append what comes next, and move the window forward by one.
How small it is
Trained transformers that run programs they were never trained on, by parameter count. Log scale: each gridline is ten times the last (K thousand, M million).
This project's hand-built network, lag1, realizes the same universal machine with 21,331 integer
weights, none learned; gradient descent finds one 2.6 times smaller. At width 6 (6,092 parameters) two training
seeds of three are exact. The comparison is between networks that learned to be universal.
Turing completeness belongs to the system: the network is the step of a loop that reads the old end of an unbounded transcript. Its exactness is measured on all 14,849 steps the universal machine has been seen to take, not proved for every step it could take. Details and sources in the README.
How this works
The tempting match for a language model pairs the Turing machine's tape with the context window. Here the match is different:
| Turing machine | this transformer |
|---|---|
| the tape | the transcript: every token emitted, never overwritten |
| the head's view | the context window: three tokens |
| the control state | written into the transcript, read back through the window |
| the rule table | the trained weights; one forward pass is one step |
The window reads the old end of the transcript while each new token is appended at the far end. That turns the transcript into a queue, which is what makes the loop able to compute anything. A window that only sees the newest tokens, as in ordinary decoding, cannot.
The network never saw any of the named machines. It was trained only on the universal machine's steps while it ran 4,000 random machines on tapes of up to six cells. Every machine is written on the tape as data, so learning the universal machine's few local steps was enough to run them all. If your own machine needs a step the network never saw, the checks in panel 3 will say so.