TTLM
A language model on a computer with no CPU: a tiny ternary transformer, 22,000 weights and integer arithmetic only, chatting on the Gigatron TTL, an 8-bit computer built from about 30 logic chips. It plays the 1947 moth. A weekend POC.
POC · public

The Gigatron TTL is an 8-bit computer built from about 30 ordinary 7400-series chips, with no microprocessor. TTLM runs a real decoder-only transformer on it, with attention, a KV cache and an MLP, trained in PyTorch and squeezed into 32 KB next to the screen. It plays the moth found in a Harvard Mark II relay in 1947: it knows about light, dust and warm chips, and not much else.
- No multiplications: ternary weights (−1, 0 or +1) turn each matrix product into a list of additions; the inner loop is ten lines of vCPU assembly.
- Integers only: power-of-two norms and scales, a softmax from two small tables, quarter squares for attention.
- The model is on the screen: the Gigatron has no video memory, so the weights and the KV cache live in the top of the picture. The noise is the model.
- Bit-exact: the PyTorch model, a Python reference and the Gigatron compute the same logits, bit for bit.
About half a token per second: a typical exchange takes 25 to 35 seconds. Talk to the moth in your browser, on a cycle-accurate emulated Gigatron. The code is public: the repository.