NES CPU runs inside 1GB Qwen model weights

Original: Show HN: A working Nintendo in ~1GB of Qwen weights

Why This Matters

Shows LLM architectures can function as deterministic compute substrates, not just text predictors.

Developer dbreunig compiled the NES's 6502 CPU, 2KB RAM, and cartridge ROM into a stock Qwen3.5 model checkpoint (~1GB). No training involved — a compiler calculated every weight. Super Mario Bros. runs frame-accurate.

A developer has compiled a working NES emulator into the weights of a standard Qwen3.5 language model, with no neural network training involved. The project, called nesformer, encodes the NES's 6502 CPU (the core of the 2A03 chip), its 2KB work RAM, and cartridge program ROM into a Qwen3_5ForCausalLM checkpoint. When running, the model predicts the CPU's execution log one token at a time, while a small host program handles the rest: rendering, controller input, and vblank interrupts.

The trick at the center of the approach is using the model's Gated DeltaNet state as the machine's physical memory — not attention or generation in the conventional sense. nesformer builds on prior work called Qwenputer by Divyansh Agrawal, which previously compiled a CHIP-8 and then a RISC-V CPU into Qwen3.5-4B using the same compiler. nesformer extends that to the full NES 6502 architecture.

Verification is strict: for included test ROMs, every frame output matches a conventional 6502 emulator exactly. Super Mario Bros. World 1-1 runs fully through the model. The project is open-source on GitHub with weights and ROM support included.

Source

github.com — Read original →