A Working RISC-V CPU Compiled Into an LLM's Weights
Divyansh Agrawal compiled a working 32-bit RISC-V CPU directly into the weights of Qwen3.5-4B. Not a plugin. Not a sandbox. The CPU is 11 transformer layers prepended to the model, with every weight computed by a compiler — none learned during training.
The trick is Qwen3.5's architecture: three out of every four attention layers use Gated DeltaNet, a linear RNN. Agrawal turned those layers into exact, addressable RAM by fixing the gate and write strength to 1 and using one-hot keys. The result runs C and MicroPython inside the forward pass, 18 million instructions free-running with zero errors.
On arithmetic benchmarks, Qwenputer scores 97.5–100% across the board — matching or beating a base Qwen with a Python tool attached, which scores 95–100%. The checkpoint is 18.8 GB and runs on a single 24 GB GPU.
The follow-up is the interesting part: Agrawal also compiled a lie detector and immutable log into Qwen's weights that the model itself cannot tamper with. Compiled weights as inbuilt oversight. That's a different kind of AI safety story.
NowGTM at Claimlane
Latest postLatest from the blog