The core idea here is genuinely unusual: instead of training a neural network to do something, a compiler directly calculated every weight value needed to simulate a real CPU. NESformer encodes the NES's 6502 processor, its 2 KB of working RAM, and up to 32 KB of cartridge ROM entirely within a Qwen3.5-4B-shaped checkpoint. When you run a game, the model performs greedy token prediction — but each token represents a CPU execution step, not a word.
The memory mechanism making this possible is Gated DeltaNet. Each attention head maintains a 128×128 state matrix updated by the delta rule. By using one-hot keys and queries, individual rows of that matrix behave as addressable memory cells — registers, RAM addresses, and ROM contents all live there. A small host program handles everything the CPU can't: it renders graphics via a scanline PPU, injects controller input, fires NMI interrupts at vblank timing, and handles OAM DMA transfers. The model never sees raw register state; it only produces and consumes a structured token stream.
The verification story is solid. NESformer's reference CPU passes nestest's golden log for 3,348 instructions and matches the py65 emulator across 5.7 million instructions of real game code. Free-running on actual ROMs, the weights produce traces identical to the reference emulator — 700,000 tokens checked across Thwaite and a homebrew game, with every saved frame matching pixel-for-pixel. The checkpoint itself is 933 MB in bf16, but since only 9.3 million of its 466.6 million parameters are nonzero, the weights compress to 3.3 MB in a zip file.

Performance is the honest limitation. The numba-compiled engine runs at roughly 1,650 tokens per second on a single CPU core. A real NES needs about 700,000 tokens per second to run at full speed, so NESformer is 150–290× slower than actual hardware. Generating 10 seconds of NES gameplay takes around 25 minutes. An idle-loop optimization — skipping repeated loop iterations with no RAM or I/O side effects — reduces token count by 2.6–4.2× without affecting observable output.
The current scope covers NROM cartridges only (iNES mapper 0), which includes Super Mario Bros., Donkey Kong, and Excitebike. Games using bank-switching mappers like MMC1 or MMC3 aren't supported yet — the ROM table is fixed at 32 KB inside the model state. There's no sound, mid-scanline PPU effects aren't reproduced, and unofficial 6502 opcodes halt execution. These are tractable engineering problems rather than fundamental limits of the approach.
For builders, the practical angle is this: NESformer demonstrates that transformer architectures with associative state (like DeltaNet) can be used as general-purpose computing substrates via compilation rather than gradient descent. The technique originated with Qwenputer's CHIP-8 and RISC-V implementations and now scales to a real commercial CPU ISA. The checkpoint loads with a standard Hugging Face call — no custom model code required — and the compiler source is included, so extending it to new instruction sets or mappers is a defined engineering task rather than a research problem.
