Qwenputer: a functioning, deterministic RISC-V CPU inside Qwen 3.5
Qwenputer is a stock Qwen 3.5 4B model with a deterministic RISC-V CPU compiled into its weights, running entirely within the model's forward passes with no external runtime, plugin or tool calls. RAM is provided by the model's own Gated DeltaNet[1] layers: in Qwen 3.5, three of every four attention layers use this linear RNN as their attention mechanism, and with the gate set to 1, the write strength (beta) set to 1 and one-hot key encoding[2], every write overwrites exactly one state row and every query returns an exact value. This RAM is cheap because a GDN head's state stays the same size however long the conversation gets, unlike the growing cache of ordinary attention. No training is involved: a compiler turns a circuit description of the CPU into pieces of transformer layers, and Qwen's original weights stay untouched, with the computer weights added in extra dimensions and layers.
The core implements the 32-bit RV32IM[3] instruction set plus the Zba extension and a small bignum unit, takes up 11 layers in front of Qwen's 32, passes the official riscv-tests, matches qemu, has run 18 million instructions on its own outputs without a single error, and runs C and MicroPython code in the forward passes, though slowly — it is not a Linux-class chip yet. The model drives the CPU through its usual tool call format, a small driver called RvChat loads firmware into the GDN state, and each instruction becomes a few generated tokens (ADDR, VAL, STEP) that form the CPU's execution trace. On the DeepMind arithmetic sets Qwenputer scores 97.5% on div_big, 97.5% on mul_big, 100% on mul_div_multiple_longer and 97.5% on add_or_sub_big, against 72.5%, 55%, 90% and 87.5% for base Qwen (a Python tool gets 95%, 100%, 97.5% and 97.5%), and on NUPA long-integer arithmetic it goes from 48.6% to 100%, the same as giving Qwen a Python tool. About 230,000 of the CPU's output positions replayed against a reference machine showed zero mismatches, and the model's normal text stays within noise of base Qwen (KL[4] 6e-4 against a noise floor of 5e-4).
An experimental filesystem adds internal put/append/get/list/delete operations: file names hash into one of 1,024 slots in a directory kept in the DeltaNet state, the text itself is stored in other heads, eight tokens per row, chained together, and the store holds up to 512 files, about 53,000 tokens. Saved state carries files between conversations, and Qwen gets facts that changed between chats right 90% of the time, versus 30% when the old chats are pasted back in, on par with Python memory tools (83.3% versus 78.9%); the model is on Hugging Face and ModelScope, with code on GitHub and the filesystem code on the rv-store branch.
Read the original divagr.comDiscussion
Discussion
Commenters are mostly delighted and trade related work: one links a project that implemented WebAssembly inside a transformer, another describes a small network called Loom that can run Doom very slowly. Others ask whether the approach could win AdderBoard, a contest to build hand-written transformers that add two 10-digit numbers with as few parameters as possible, and how a model trained from scratch with this circuitry would behave. One argues ordinary attention could do the same job, just less computationally efficiently, and another jokes about what a misaligned agent would do with a hidden CPU inside a language model.
Sources
-
divagr.com
Qwenputer: A functioning, deterministic RISC-V CPU inside Qwen3.5
-
KRGeekNews KO
Qwenputer: Qwen3.5 내부에서 작동하는 결정론적 RISC-V CPU



