explainx.ai0k
TrendingAI News TodayPathwaysSkills
Pricing
explainx.ai

Upskill in AI — 16 free pathways, live workshops & bootcamps, and 50+ courses from practitioners. Plus the skills, tools, and MCP servers to practice on.

follow us

follow on google

Add explainx.ai as a preferred source

corporate training

support@explainx.ai

get started

Find your pathTake Free Evaluation

community

Join the community

learn

mind: share how you thinkpathways — start freeworkshopsbootcampscoursescompare Explainxcertificationsmock testsexplainx universitycorporate traininglearn skills & mcp

discover

skillsmcp serversexplainx mcptoolsmdx readeragentsllmsdesignsdictionarypeopleagi trackerfelony benchranks

company

aboutvisionmissionteaminstructorsteach on explainxpartnershipscommunityhackathonscareers

content

daily AI newsstate of AI — live resultsblogreleasespromptsgeneratorsresource libraryfor LLMsexplainx.ai kids

solutions

all solutionsdeveloper upskillingmarketing upskillingproduct manager upskillingleadership upskilling

newsletter · weekly

Get AI news, tools, and insights in your inbox.

supportcontactprivacytermsdata rightshow we create contentsubmission guidelines

© 2026 AISOLO Technologies Pvt Ltd

explainx.ai

On this page

  • Nesformer at a glance
  • What does nesformer actually do?
  • How does a language model become a CPU?
  • How do I run it?
  • How slow is it, really?
  • What are the limits?
  • Why does this matter beyond the novelty?
  • Is this the same as an emulator that runs on the GPU?
  • What we verified and what we did not
  • Related reading
← Back to blog

explainx / blog

Nesformer: A Nintendo NES CPU Compiled Into Qwen3.5 4B Weights Runs Super Mario Bros.

Open Source, Qwen, Language Models, Research, AI News

Part of AI Tools and Apps

Nesformer compiles a NES 6502 CPU into stock Qwen3.5 4B weights, so a language model plays Super Mario Bros. one token at a time. How it works, speed and limits.

Oct 30, 2026·9 min read·Yash Thakker
add explainx.ai
go deep
Nesformer: A Nintendo NES CPU Compiled Into Qwen3.5 4B Weights Runs Super Mario Bros.

Drew Breunig has released nesformer, a project that bakes a working Nintendo Entertainment System CPU into the weights of a stock Qwen3.5 4B model. According to the GitHub repository, nobody trained those weights: a compiler computed them, and the model then predicts the processor's execution log one token at a time. It can run cartridges such as Super Mario Bros., very slowly. Simon Willison flagged the project on October 30, 2026.

It is a stunt, and the author describes it as built for fun. But the trick underneath it, using a language model's own attention state as exact computer memory, is a genuinely interesting fact about the hybrid architectures now shipping in open models. This post explains what was built, how it works, how to run it, where it breaks and what to make of it.

Nesformer at a glance

table · 2 cols
ItemWhat the repository says
What it isAn NES CPU compiled into a stock Qwen3.5 model
TrainingNone. A compiler sets every weight
Machine emulatedThe 6502-family core of the NES chip, 2 KB of work RAM, a cartridge program ROM
MemoryThe model's Gated DeltaNet state; each row of a state matrix acts as a memory cell
Host programDraws the picture, reads the controller, fires the vblank interrupt
GamesNROM (mapper 0), e.g. Super Mario Bros. and Donkey Kong
Speed1 to 6 seconds per frame; about 1,650 tokens per second on one CPU core
Real console needAbout 700,000 tokens per second
LicenseMIT
Builds onQwenputer by Divyansh Agrawal

What does nesformer actually do?

A normal language model predicts the next word. Nesformer predicts the next line of a CPU trace. Each instruction the emulated processor executes becomes a few generated tokens that say which memory row to write and what value to put there. Because the weights were built to compute exactly that function, the output is not a guess: it is the deterministic result of running the program.

A tiny host program handles what the model does not. It draws the screen from the memory contents, reads the controller state and triggers the vertical blank interrupt that the NES uses to time each frame. The repository lists a terminal display option, so you can watch frames render as text. The picture processor is approximate, so do not expect pixel-perfect output, and there is no sound.

The important point is what this is not. It is not a language model that learned to play Mario from pixels, the way a reinforcement learning agent would. It is also not a model calling an emulator as a tool. The CPU logic lives inside the forward pass, in the matrices of the network.

How does a language model become a CPU?

Nesformer stands on Qwenputer, published on October 22, 2026 by Divyansh Agrawal. Qwenputer compiled first a CHIP-8 machine and then a 32-bit RISC-V core into Qwen3.5 4B. Its write-up explains the key insight.

Qwen3-Next and Qwen3.5 use a hybrid design in which three out of every four attention layers use Gated DeltaNet, a linear recurrent network, instead of ordinary attention. Each head keeps a state matrix and updates it with the delta rule. Agrawal found that if you set the gate to 1 (nothing fades), the write strength to 1 (new values fully replace old ones) and use one-hot keys, every write overwrites exactly one row and every query reads one row back exactly. In other words, the layer becomes RAM.

That has a practical advantage over using ordinary attention as memory. A Gated DeltaNet head's state stays the same size no matter how long the run is, while an attention KV cache grows with every token. The idea that the delta rule acts as an associative memory is not new; Agrawal credits the 2021 "Linear Transformers Are Secretly Fast Weight Programmers" paper. The new part is making it exact and addressable inside a production model.

With RAM available, a compiler can take a CPU described as a circuit and turn each step into part of a transformer layer: attention heads that look things up, feed-forward units that do arithmetic, and DeltaNet heads that hold memory. In Qwenputer's case, the RISC-V core takes 11 layers in front of Qwen's 32, passes the official riscv-tests, matches the qemu emulator, and ran 18 million instructions free-running without an error, according to the author.

Nesformer applies the same recipe to a different processor and a different memory map, and adds the host program needed for a game console. According to Willison's post, Breunig used Claude Opus 5.5 to explore and implement the idea, and Opus checked the emulated processor against nestest, a CPU conformance suite that Willison attributes to Christopher Pow (the repository's credits list the nestest ROM under Kevin Horton).

How do I run it?

The repository's instructions are short:

  1. Unzip the code and the weights archive into the same folder and check the weights against the included SHA-256 file.
  2. Install Python 3.11 or newer with numpy, scipy, numba and pillow.
  3. Run a game with python -m nesformer run ROM. Add --frames to limit the run, --buttons for a scripted controller sequence and --show for terminal display.

You bring your own ROM files. Three test ROMs ship in the repo, which is also the sensible place to start: run one for a handful of frames before committing 25 minutes to a long Mario session.

Notice what you do not need: a GPU. The default engine is a custom CPU implementation at about 1,650 tokens per second on a single core. That is about eight times faster than the numpy path (roughly 210 tokens per second) and far faster than stock transformers (about 10). The stock path exists mostly to prove that the compiled weights really behave like a normal Qwen3.5 checkpoint.

How slow is it, really?

A frame takes one to six seconds. A real NES draws 60 frames a second and needs, by the repository's estimate, about 700,000 tokens per second to keep pace. Nesformer manages roughly 1,650, putting it between 150 and 290 times slower than the console depending on the scene. Running 600 frames, ten seconds of gameplay, can take around 25 minutes.

Nobody should read that as a failure. A 4-billion-parameter model that executes an entire 8-bit console exactly, without a single learned parameter, is the point. It also shows the cost of doing computation through generation. Each emulated instruction costs several tokens, so even a very modest 1980s processor swamps a modern language model's decode speed.

What are the limits?

The repository is explicit about what is missing:

  • Mappers. Only NROM (mapper 0) works. Bank-switched cartridges using MMC1 or MMC3 are out, which excludes many well-known games.
  • Opcodes. Unofficial 6502 opcodes are not implemented.
  • Interrupts and sound. IRQs and audio are missing.
  • Graphics. The picture processor is approximate, so some effects will look wrong.
  • Speed. As above, minutes per second of gameplay.

Also remember the stats: the repository had about 130 stars and 5 forks when we looked, so this is a young release. We have not run it ourselves, and everything about speed and compatibility here is the author's reporting.

Why does this matter beyond the novelty?

It shows what hybrid attention models can be. More open model families are moving to a mix of linear-recurrent and full-attention layers because the recurrent state is cheaper at long context. We have covered other Qwen3.5-based work, such as the Qwen3.5 4B 3D coder preview and the two-neuron steering experiments on Qwen3.5 4B. Nesformer shows the state matrices can be driven as exact memory, which is a different relationship from the fuzzy learned memory most people picture.

It blurs the line between model and tool. Agents normally call out to code interpreters. Qwenputer's author describes a model that hands arithmetic to a CPU in its own weights, with no external tool call. Whether that is ever practical is open, but it changes how you might think about small models doing exact work that normally needs code.

It raises safety questions. Agrawal's Qwenputer page links two follow-ups. One argues hybrid models could learn to hide reasoning in their recurrent state and evade chain-of-thought monitoring. The other argues compiled weights could serve as built-in monitoring tools the model cannot tamper with. We have not reviewed either follow-up in depth, so treat these as the author's arguments rather than established results. They are still a reminder that state inside a recurrent layer is harder to inspect than text.

It is a good "what is a transformer" lesson. Anyone learning how these networks work gets a concrete example that attention heads can do lookups, feed-forward layers can do logic, and the whole thing can be constructed by hand rather than discovered by gradient descent.

Is this the same as an emulator that runs on the GPU?

No. Emulators such as the ones used by AnyPS5 to relink games natively are written to run console code fast. Nesformer deliberately runs it through the slowest possible route to prove a point about model weights. If you want to play Mario, use a regular emulator.

What we verified and what we did not

Verified from the sources: the repository describes an NES CPU compiled into a stock Qwen3.5 model, untrained, using Gated DeltaNet state as memory; the run instructions, the speed figures, the supported cartridge types, the limits and the MIT license all come from the repository page. The Qwenputer mechanism comes from its author's own write-up. Willison's post confirms the Qwen3.5-4B base, the Claude Opus assistance and the nestest verification (the nestest author credit differs between his post and the repository).

Not verified: we did not run the code, check the weights checksum or reproduce the speed numbers. We did not independently check the claim of 18 million error-free RISC-V instructions. We also did not find any independent test of nesformer yet, given how new it is. If you try it, check the SHA-256 file first and run it in a throwaway environment as you would with any downloaded archive.

Related reading

  • Qwen3.5 4B 3D coder preview
  • Evil Qwen: two-neuron steering on Qwen3.5 4B
  • Coinbase's fine-tuned Qwen3.5 9B fraud agent
  • AnyPS5 and native relinking
  • EAGLE-4 speculative decoding on Qwen3
  • Exowatt's fine-tuned Qwen3 for edge alarm triage
Spotted something out of date? Let us know.

People in this article

  • Simon Willison →Independent open source developer and creator of Datasette
Explore people in AI →
Yash Thakker

Written by

Yash Thakker

Yash is an AI expert with over 300K learners. Join his workshops →

View Yash Thakker in People in AI →

Related posts

Oct 27, 2026

Qwen-Image-PE: How Qwen Taught a Prompt Rewriter Visual Design

Qwen researchers published Qwen-Image-PE, a prompt enhancer that learns lighting, composition and layout instead of only adding adjectives. This guide explains the two-stage training, the reported gains, and what you can actually download.

Oct 16, 2026

MLExpert: An Open 35B Model Trained to Do Machine Learning Engineering Nearly Doubles Its MLE-Bench Lite Medal Rate

Researchers released MLExpert, an Apache-2.0 35B mixture-of-experts model post-trained on Qwen3.6-35B-A3B for autonomous machine learning engineering. It reports a 72.7 percent medal rate on MLE-Bench Lite, up from 37.9 percent. Here is the training recipe, the numbers, how to serve it, and what to treat cautiously.

Oct 14, 2026

Agent-Reflex: Training Qwen3-8B Agents to Recover From Broken Tools and User Corrections

RUC-NLPIR released Agent-Reflex, a three-stage recipe that teaches a small tool-using model to reflect when an MCP tool times out or a user interrupts. This post explains the method, the numbers, the released assets and the caveats.