# nesformer — a Nintendo CPU compiled into Qwen3.5 weights

> A stock Qwen3.5 model whose compiled weights run NES games, one predicted token at a time.

- Org: Drew Breunig
- Date: 2026-10-30
- Category: showcase, repo
- Source: https://github.com/dbreunig/nesformer
- Canonical page: https://ai-tldr.dev/releases/dbreunig-nesformer/

nesformer is an MIT-licensed project that runs an NES CPU inside the weights of a stock Qwen3.5 model. The weights are compiled, not trained, and the model predicts the CPU log one token at a time.

## What it is

nesformer puts an NES 6502 CPU, 2 KB of RAM and a cartridge ROM inside a Qwen3.5 checkpoint. The weights are computed by a compiler, not trained. The demos include Super Mario Bros. World 1-1, and it runs NROM (mapper 0) cartridges that you supply.

## How it works

Each DeltaNet head keeps a 128 × 128 state matrix, and a one-hot key update overwrites one row, so rows act as memory cells. Seven DeltaNet layers each handle one CPU stage, from fetch to result. A host program draws the screen and reads the controller.

## Why it matters

The project shows that a normal transformer checkpoint can hold exact program state, and the README checks the output against the nestest golden log for 3,348 instructions. It is slow, 150–290× slower than a real NES, so it is a research curiosity, not a practical emulator.

## Who it's for

ML researchers and curious hackers

## Try it

python -m nesformer run roms/thwaite.nes --frames 600 --show

## Links

- [GitHub Repo](https://github.com/dbreunig/nesformer)
- [Hacker News Thread](https://news.ycombinator.com/item?id=50306442)
- [Qwenputer Post](https://divagr.com/blog/qwenputer)
