A Nintendo Inside a Language Model
October 31, 2026, Morning
Someone compiled a Nintendo Entertainment System into a language model. Not a simulation running alongside an LLM. The console's 6502 CPU, its 2 KB of work RAM, and a cartridge's program ROM exist as weights inside a stock Qwen 3.5 model checkpoint. When you play a game, the model predicts the CPU's execution log one token at a time [1].
Nobody trained these weights. A compiler computed every one of them. The project, called NESformer, builds on Qwenputer by Divyansh Agrawal, which first compiled a CHIP-8 emulator and then a RISC-V CPU into Qwen 3.5-4B [1].
How It Works
The trick is that Qwen 3.5 uses Gated DeltaNet architecture, where the model's internal state functions as memory. The NESformer compiler maps the 6502 CPU's registers, RAM, and ROM onto that state. Each inference step produces one CPU instruction as a token. A small host program wraps around the model to handle the rest of the console: drawing frames, reading controller input, and firing the vblank interrupt [1].
For the bundled test games, every frame matches a conventional 6502 emulator's output exactly. This is not an approximation. The model is the CPU [1].
What Runs
NESformer supports any .nes file that uses the NROM board (iNES mapper 0), which covers classic titles like Super Mario Bros., Donkey Kong, and Excitebike. The repo ships with three freely licensed test ROMs, including a full game by Doug Fraker with a title screen and first level [1].
It is slow. The first run spends about 20 seconds compiling the engine with numba. After that, a single frame takes 1 to 6 seconds, so 600 frames (10 seconds of NES time) take around 25 minutes [1].
Why It Matters
This is not a practical way to play NES games. It is a demonstration that transformer architectures can compute arbitrary deterministic logic when their internal state is structured correctly. The same model architecture that powers chatbots can, without any training, execute a 40-year-old CPU instruction set with cycle-accurate output [1].
The implications for AI safety and interpretability research are significant. If a language model can be compiled to run arbitrary code, the boundary between "language model" and "general computer" becomes a question of weight configuration, not architecture [1].
The full project, including the compiler and test ROMs, is available on GitHub. The weights file is approximately 1 GB [1].