← Back to articles

Newsneural networksgamesopen source

An AI swallowed a Nintendo: Super Mario now runs inside a language model

A developer compiled an NES console into the weights of a Qwen model, and it plays Super Mario Bros. Nobody trained it to.

An AI swallowed a Nintendo: Super Mario now runs inside a language model
Photo: Drew Breunig, nesformer
Media: Drew Breunig, nesformer

Developer Drew Breunig stuffed a Nintendo Entertainment System into a neural network. The console's CPU, its 2 KB of RAM and a game cartridge now live inside a stock Qwen3.5-4B language model from Alibaba, and it runs Super Mario Bros. Slowly, but it runs.

The wild part is that nobody trained it. The weights never saw a game: every number in them was computed by a compiler that turns a CPU circuit into network layers. When you play, the model predicts, one token at a time, what the real NES processor would do next. The machine's memory sits in the model's internal state. A small host program outside only draws the picture, reads the controller and signals each new frame.

The project is called nesformer and grew out of Qwenputer, where Divyansh Agrawal used the same trick to build a CHIP-8 emulator and a RISC-V CPU inside Qwen. Breunig says Claude Opus 5.5 wrote the whole thing. He fed it the Qwenputer write-up, asked whether an NES could be done the same way, then told it to build it just for fun. Opus found a 15-year-old set of NES CPU conformance tests on its own and used them to check its work.

The code and weights are on GitHub, so anyone with Python can try it. It handles games on the simplest NROM cartridges, like Super Mario Bros., Donkey Kong and Excitebike, and you bring your own ROMs. Don't expect a console: one frame takes one to six seconds, so ten seconds of gameplay takes about 25 minutes. For the bundled test games, every frame matches a regular emulator exactly.

Zero practical use, maximum delight. And a very clear demo that you can build a real computer inside a language model.

original