AI Engineer Compiles RISC-V Processor Directly Into LLM Weights to Run DOOM Internally
Developer Divyansh Agrawal embedded a 32-bit RISC-V CPU into Qwen 3.5 4B weights, enabling internal execution of C code and DOOM without external tools.
AI engineer Divyansh Agrawal has released an experimental project called Qwenputer, successfully compiling and embedding a 32-bit RISC-V CPU directly into the weights of the Qwen 3.5 4B large language model. This innovation allows the model to use its own weights as memory (RAM) to execute processor arithmetic operations, C, and MicroPython code internally, without relying on any external runtime or tool calls, and even run the classic game DOOM at a very slow speed.
Unlike traditional model training, this built-in 'CPU' was not learned through machine learning but computed entirely by a compiler across 11 Transformer layers placed before Qwen's original layers. Agrawal claims the built-in CPU passes official riscv-tests, matches qemu programs, and has run 18 million instructions free-running without a single error. This design overcomes the common arithmetic weaknesses of LLMs by providing exact calculation capabilities. Additionally, the project uses DeltaNet state to provide the model with a filesystem supporting up to 512 files with persistent storage.
Due to expanded resource usage, Qwenputer is nearly twice the size of the underlying Qwen 3.5 4B model, reaching almost 19GB, thus requiring a workstation with at least 24GB of VRAM for testing. The project remains highly experimental, primarily exploring technical possibilities rather than solving specific production problems, though its MIT-licensed code is now available on GitHub.