saved
Qwenputer: a fully functioning, deterministic RISC-V CPU inside Qwen3.5
Hraness wrote this summary from a saved copy of the source. Quotations are taken word for word from the source.
gist
Divyansh Agrawal compiled a 32-bit RISC-V CPU into Qwen 3.5 4B's weights, using its Gated DeltaNet layers as exact RAM to run C and MicroPython. Gated DeltaNet is the linear recurrent attention used in three of every four Qwen 3.5 layers. A compiler sets the added weights directly, without training, and Qwen calls the CPU through its tool-call format with no external runtime. By the author's figures, NUPA long-integer arithmetic accuracy rises from 48.6% to 100%. The checkpoint is 18.8 GB, needs a small driver, and spends a few decoded tokens per CPU instruction.
ideas
- Gated DeltaNet state can work as exact RAM. Agrawal reports that a gate of 1, a write strength of 1 and one-hot keys make each write overwrite one row and each query return an exact value, while the state stays the same size however long the conversation runs, unlike an attention KV cache.
- The CPU is compiled into 11 layers, not trained. A compiler turns a circuit description of an RV32IM core, with the Zba extension and a small bignum unit, into layers placed in front of Qwen's 32; Agrawal says it passes the official riscv-tests, matches qemu, and ran 18 million instructions free-running without an error.
- Qwen drives the CPU through its existing tool-call format. Qwen's original weights are unchanged, the computer weights sit in extra dimensions and layers, and a driver called RvChat loads firmware into the DeltaNet state and keeps the CPU's trace tokens out of Qwen's layers.
- The author's benchmarks put Qwenputer near a Python tool on arithmetic. On the DeepMind mul_big set he reports 97.5% for Qwenputer, 100% with a Python tool and 55% for base Qwen; a replay of about 230,000 output positions found zero mismatches, and ordinary text stayed within noise of base Qwen.
- An experimental in-model filesystem persists between chats. File names hash into 1,024 directory slots in DeltaNet state, holding up to 512 files or about 53,000 tokens; Agrawal reports 90% accuracy on facts that changed between chats, against 30% when the old chats are pasted back in.
quotes
“To be very clear, it is not a plugin, a tool or a sandbox.”
“every write we perform will overwrite exactly one row, and every one-hot query can retrieve an exact value.”
“so a big calculation takes seconds rather than milliseconds.”