> ## Content Index
> Fetch the complete content index at: https://globalfeed.ai/llms.txt
> Use this file to discover other available public pages before exploring further.

# nesformer compiles a Nintendo CPU into a stock Qwen3.5 model
- URL: https://globalfeed.ai/en/nesformer-compiles-a-nintendo-cpu-into-a-stock-qwen3-5-model/
- Published: 2026-10-31T00:34:44.000Z
- Updated: 2026-10-31T00:34:44.000Z
- Description: Drew Breunig's project runs the NES 6502 CPU inside an untrained Qwen3.5 model file. The model predicts the CPU's execution log token by token, and games run hundreds of times slower than on a real console.
- Author: GlobalFeed Editor
- Tags: Qwen, nesformer, Nintendo, Open Source, x-dbreunig, dil-en, elle

Developer Drew Breunig has released nesformer on [GitHub](https://github.com/dbreunig/nesformer?ref=globalfeed.ai) under the MIT license. It runs the Nintendo Entertainment System's 6502 CPU, its 2 KB of work RAM and a cartridge's program ROM inside a standard Qwen3.5 model file. Nobody trained the parameters in the file, because a compiler calculated every one. During play, the model predicts the CPU's execution log one token at a time. A small host program draws the picture, reads the controller and fires the interrupts.

## It builds on Qwenputer

The project uses the compiler from Qwenputer, in which Divyansh Agrawal compiled a CHIP-8 and then a RISC-V CPU into Qwen3.5-4B. The central idea is the same: the model's Gated DeltaNet state serves as the machine's memory. The model in the repository has 466.6M parameters and takes up 933 MB in bf16\. Only 9.3M of those parameters are nonzero, so the file compresses to 3.3 MB.

## How it was checked

The developer tested the result in four stages. The reference CPU matched nestest's golden log for 3,348 instructions and the py65 emulator on 5.7 million instructions of game code. Running freely, the model produced 600 frames of Thwaite from 1,916,527 tokens, and all 300 saved frames matched. Full Game produced 420 frames from 2,645,885 tokens, and all 210 saved frames matched. Those runs equal 10 and 7 seconds of console time. The core covers all 151 official 6502 opcodes and every addressing mode, and game code averages 1.1 to 1.3 tokens per instruction.

On speed, the project gives about 10 tokens per second with stock transformers. The default engine is therefore separate code that computes Qwen3.5's forward pass from the model file and compiles it with numba, which takes about 20 seconds on the first run. It reads the same parameters and makes the same predictions. That is what makes the project interesting: with no learning involved, the model file behaves like a machine stepping through a specific program. NROM games, which need no extra chip, work this way, while larger games would need the whole ROM stored in the file.

## It works, very slowly

According to the README, all saved frames from the test games Thwaite and Full Game matched a conventional 6502 emulator exactly. Super Mario Bros. runs if users supply their own ROM. Even so, nesformer runs 150 to 290 times slower than a real console. It supports only NROM cartridges, so the bank-switching chips in larger games do not work yet. There is no sound, and the picture and audio chips sit outside the model file. The project offers no practical way to play games, and stands out as an experiment in what an ordinary language model file can compute.

Sources: [GitHub](https://github.com/dbreunig/nesformer?ref=globalfeed.ai)