Free · Daily brief + weekly playbookDaily 60-sec AI Voice Brief + Weekly Production AI Agent PlaybookGet the brief →
ReleaseCode / SDK · ActionableHacker News AI→ original

NES CPU Compiled into Qwen3.5 Weights Without Training: Mario Runs 150–290× Slower

A hobbyist has built a working NES console inside the weights of the Qwen3.5 model. The CPU was never trained; instead, a program computed every number in the weights. The model emits a token-by-token execution log of the processor, while ordinary code draws the frame and reads the gamepad. The frames match the emulator, but the game runs 150–290 times slower than a real console. The takeaway: a transformer can execute an exact algorithm, but it cannot replace an emulator.

AI-processed from Hacker News AI; edited by Hamidun News
NES CPU Compiled into Qwen3.5 Weights Without Training: Mario Runs 150–290× Slower
Source: Hacker News AI. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceHacker News AI ↗
Editor-in-Chief
Weights466.6M parameters in bf16, 933 MB; only 3.3 MB in a zip archive
Key metric #2A frame takes 1–6 seconds, roughly 1,650 tokens/s on a single CPU core
Key metric #3Only NROM (mapper 0) games work, such as Super Mario Bros.

Hacker News has featured nesformer, a working Nintendo Entertainment System (NES) whose processor is written directly into the weights of a neural network based on the Qwen3.5 architecture. Such stories usually involve a network that "learned" to play Mario from thousands of runs.

Here it's different: there was no training at all. Every number in the weights was computed by a compiler program, as if the processor's circuit were not drawn but translated into a table of coefficients. The game still runs 150–290 times slower than a real console: one second of gameplay requires anywhere from several minutes to nearly five minutes of computation.

On the other hand, the frames match a reference emulator. For practitioners, it's a clear answer to whether transformer weights can execute an exact algorithm, not just predict text.

How the model replaces the processor

Inside sits a 6502 processor (the 2A03 chip core), 2 KB of RAM, and the cartridge program. When you launch a game, the model predicts, one token at a time, the processor's execution log: which instruction ran, what ended up in the registers, where the write went. Everything around the processor is handled by a small Python host program: it draws the image, reads gamepad buttons, and triggers the frame-sync interrupt. The host cannot see registers or memory directly, only the log the model outputs.

The project builds on an earlier Qwenputer, which used the same method to compile CHIP-8 and a RISC-V processor into Qwen3.5-4B. The layer shapes mirror Qwen3.5-4B: 16 key heads, 32 value heads, dimension 128, and an MLP width of 9,216. There are 7 Gated DeltaNet layers plus one null attention layer, which the Hugging Face cache requires. The checkpoint has 466.6M parameters in bf16, or 933 MB, but compresses to 3.3 MB in an archive because it contains many zeros.

Memory is provided by the DeltaNet internal state. Each head stores a 128×128 matrix that the delta rule updates at every token. If the gate is opened and a key with a one in a single position is supplied, the update overwrites exactly one row, and the same query reads it back. The result is an ordinary array: the rows hold the cartridge, RAM, and registers alike. It is simply built from a mechanism that LLMs use to store context.

What was verified and how slow it is

All 151 official instructions are implemented, along with all addressing modes, flags, the stack, and entry into BRK and NMI. The log matched the reference nestest log across 3,348 instructions and the py65 emulator across 5.7 million game-code instructions. The circuit predicted every reference token across the full nestest run and at 283,610 positions while loading two games. Plain transformers in bf16 on CPU passed 2,651 nestest positions and the Full Game run with no divergence. In two runs, all saved frames, 300 and 210, matched the reference.

The cost of this accuracy is speed. A numba-based engine delivers about 1,650 tokens per second on one CPU core, pure numpy about 210, and standard transformers about 10. A real NES needs on the order of 700,000 tokens per second. One frame takes 1–6 seconds, and 600 frames (10 seconds of gameplay) take considerably longer. The first run spends about 20 seconds on compilation. To avoid burning cycles on idle loops, the host skips repetitive iterations, which cuts the token count by 2.6–4.2 times. The resulting gap from the console is the 150–290× figure.

Limitations

Only NROM cartridges (iNES mapper 0) are supported, such as Super Mario Bros., Donkey Kong, or Excitebike. You must supply the ROM yourself: the repository contains only three freely licensed test ROMs. Games that use bank switching (MMC1, MMC3) will not run, because ROM reads happen inside the model from a fixed 32 KB table. Supporting such cartridges would require storing the entire ROM in the state and adding an address-remapping stage.

Other constraints: unofficial instructions are not supported, code must execute from cartridge ROM, and the graphics and sound chips are not part of the weights. Graphics are drawn line by line, so effects within a scanline are not reproduced, and some sprite effects are approximate.

There is no practical production value here: emulating the NES with ordinary code is faster and cheaper. But it is a reproducible example that transformer weights can execute a deterministic algorithm, and that the state of recurrent layers works as addressable memory. It will interest researchers in interpretability, computation inside models, and hybrid architectures with linear attention. The project runs on Python 3.11+ with numpy, scipy, numba, and pillow. The code is released under the MIT license.

Story

Key Questions Answered

How the model replaces the processor?

Inside sits a 6502 processor (the 2A03 chip core), 2 KB of RAM, and the cartridge program. When you launch a game, the model predicts, one token at a time, the processor's execution log: which instruction ran, what ended up in the registers, where the write went. Everything around the processor is handled by a small Python host program: it draws the image, reads gamepad buttons, and triggers the frame-sync interrupt. The host cannot see registers or memory directly, only the log the model outputs.

What was verified and how slow it is?

All 151 official instructions are implemented, along with all addressing modes, flags, the stack, and entry into BRK and NMI. The log matched the reference nestest log across 3,348 instructions and the py65 emulator across 5.7 million game-code instructions. The circuit predicted every reference token across the full nestest run and at 283,610 positions while loading two games. Plain transformers in bf16 on CPU passed 2,651 nestest positions and the Full Game run with no divergence.

What are the key details on Limitations?

Only NROM cartridges (iNES mapper 0) are supported, such as Super Mario Bros., Donkey Kong, or Excitebike. You must supply the ROM yourself: the repository contains only three freely licensed test ROMs. Games that use bank switching (MMC1, MMC3) will not run, because ROM reads happen inside the model from a fixed 32 KB table. Supporting such cartridges would require storing the entire ROM in the state and adding an address-remapping stage.

ZK
Zhemal Khamidun — Head of AI at Alpina Digital · MIPT (academic supervisor of the Tech Entrepreneurship department). Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Unified AI Workspace · Nomad

Test Frontier LLMs & Autonomous Agents in One Workspace

Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.

Try Nomad AI →Launch Nomad Agent
Jemal Hamidun

Editor-in-chief · Cite this analysis

Jemal Hamidun

Head of AI at Alpina Digital · Academic Supervisor of the Tech Entrepreneurship Department at MIPT

Head of AI & CPO of AlpinaGPT at Alpina Digital, Academic Lead of Tech Entrepreneurship at MIPT. Founder of Hamidun News and Vibe Academy.

Ready-to-paste citation for journalists, blogs and Telegram channels

Source: Hamidun News — NES CPU Compiled into Qwen3.5 Weights Without Training: Mario Runs 150–290× Slower https://news.hamidun.com/en/news/16941/nes-cpu-compiled-into-qwen3-5-weights-without-training-mario

What do you think?
Loading comments…