Skip to content

AI Engineer Compiles RISC-V Processor Inside Qwen 3.5 LLM Weights

News
AI Engineer Compiles RISC-V Processor Inside Qwen 3.5 LLM Weights
Large language models usually rely on external plugins, vector databases, or isolated Python sandboxes to execute code, but one developer decided to bypass the sandbox entirely. AI engineer Divyansh Agrawal recently built an experimental project called Qwenputer that literally compiles a functional computer into the neural matrices of a stock Qwen 3.5 4B model. Instead of generating text that tells an external interpreter what to do, the model actually processes machine code natively during standard inference. This turns a probabilistic text generator into a deterministic computing engine.

How a CPU Lives Inside Neural Weights

Getting a processor to run inside a neural network requires bending transformer architecture to mimic hardware logic gates. According to a detailed technical breakdown by Tom's Hardware, Agrawal managed to embed a full RV32IM RISC-V instruction set architecture directly into 11 extra transformer layers. The system cleverly uses a Gated DeltaNet state to function as system RAM, allowing the model to read and write memory states just like a physical motherboard. Because the logic is permanently baked into the model parameters, there are no API tool calls, network requests, or external dependencies required to run bare-metal binaries. It just runs.

Architectural Breakdown of Embedded Processing

ComponentStandard LLM ApproachQwenputer Implementation
Execution EnvironmentExternal Python sandbox or API tool callInternal transformer layer matrices
Memory ManagementVector database or context windowGated DeltaNet state acting as RAM
Instruction SetPython scripts or JSON formattingNative RV32IM with Zba extension
Processing OverheadNetwork latency to external interpretersZero-latency tensor multiplications
State PersistenceCleared after each generation cycleMaintained within recurrent hidden states

Running Doom and Bare-Metal Code

The ultimate stress test for any unconventional computing environment is the classic 1993 shooter, and Qwenputer passes it with flying colors. The internal processor successfully renders the floor plan of Doom's E1M1 level entirely through raw tensor calculations, proving that graphical rendering can happen inside a language model's hidden states. Beyond retro gaming, the embedded core handles standard C code execution and MicroPython scripts natively. Every single arithmetic operation, register swap, and logic gate is executed purely via the language model's forward pass.
This approach proves that transformer weights can be hijacked to act as deterministic silicon. While not meant to replace your desktop processor, it opens up bizarre but fascinating pathways for localized, offline code execution. If an AI can simulate an entire operating system bare-metal within its own synapses, the line between software generation and actual hardware emulation has officially blurred.
loading

Loading