Skip to content
storagebits
← Projects

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
A monitor plugged into a real Gigatron: the top of the screen is a field of colored noise, then the line TTLM 22k params 0 CPU, then the chat: who are you, i am a tiny model. no cpu. only wires. where is the cpu, there is no cpu here. Below, the Arduino that loads the program, wired to the controller port.
The Gigatron screen next to its X-ray: each pixel of the noise colored by what it holds, word and position embeddings, attention and MLP weights of both layers, the KV cache, the activations, the tables.
The noise is the model: the screen and what each pixel holds.

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.