All hacks

NES CPU compiled into the weights of a Qwen model to run Super Mario Bros.

A compiler wrote an NES 6502 CPU, its RAM and a game ROM into stock Qwen3.5 weights, so the model plays Super Mario Bros. token by token.

NES CPU compiled into the weights of a Qwen model to run Super Mario Bros.
NES CPU compiled into the weights of a Qwen model to run Super Mario Bros., as posted by dbreunig
Photo: dbreunig, from the original post.

The NES’s 6502 CPU, its 2 KB of work RAM and a cartridge’s program ROM now live inside the weights of a stock Qwen3.5 model, and the model plays Super Mario Bros. World 1-1. Nobody trained it. A compiler computed the weights, and the model predicts the CPU’s execution log one token at a time.

A small host program does the rest of the console: it draws frames, reads the controller and fires the vblank interrupt. The model’s Gated DeltaNet state acts as memory, and its frames match a conventional 6502 emulator exactly. It’s a 466.6M-parameter model that loads with standard Hugging Face tooling, and it builds on Divyansh Agrawal’s Qwenputer, which did the same for CHIP-8 and RISC-V.

Expect it to be slow: about 1,650 tokens a second on one CPU core, so a frame takes one to six seconds. It needs Python 3.11 or newer and your own ROMs, and only NROM cartridges work. Code and weights are on dbreunig’s GitHub.

All credit to dbreunig. The full story is at the original source.

Cracked something open?

Send us your hack. Clever, useful or gloriously pointless, we want to see it.

Submit a hack