Qwenputer: A Deterministic RISC-V CPU Embedded in Qwen 3.5 Weights

Core Architecture: Embedding Compute into Weights

Qwenputer integrates a 32-bit RISC-V core (RV32IM) directly into the weights of a Qwen 3.5 4B model. Unlike traditional tool-use paradigms that rely on external Python sandboxes or API calls, Qwenputer performs arithmetic and logic operations entirely within the model's forward pass. The system leverages Gated DeltaNet (GDN) layers—a type of linear RNN—to serve as deterministic, addressable RAM. By configuring the gate and write strength to 1.0 and using one-hot key encoding, the model achieves reliable memory read/write operations that persist across tokens without the memory scaling issues associated with standard attention KV caches.

Implementation: From Circuitry to Tokens

The CPU is implemented by compiling a circuit description directly into the model's weights, bypassing the need for traditional training. Each instruction is executed as a series of tokens representing memory addresses and values, which the model generates as an execution trace.

  • RAM Mechanism: The GDN state acts as a memory bank where one-hot keys point to specific rows for overwriting or retrieval.
  • Filesystem: An experimental extension allows the model to hash filenames into 1,024 slots within the GDN state, enabling persistent storage of up to 512 files (approximately 53,000 tokens). This state can be saved and reloaded across different chat sessions.
  • Execution: The model uses a driver (RvChat) to load firmware and manage the execution trace, ensuring that CPU instructions are processed without external runtime intervention.

Performance and Accuracy

Qwenputer demonstrates significant improvements in arithmetic tasks compared to the base Qwen 3.5 model. In benchmarks using DeepMind arithmetic sets and NUPA long-integer arithmetic, Qwenputer achieved 97.5% to 100% accuracy, matching or exceeding the performance of base models equipped with external Python tools. The CPU has successfully passed official RISC-V tests, executing over 18 million instructions without error in a free-running state.

Community Discussion and Technical Critiques

The project has sparked significant discussion regarding the implications of embedding deterministic compute within neural networks:

  • Transparency and Tooling: Some observers have raised concerns about the distinction between "internal" execution and the required inference driver. As one commenter noted: > "A custom host runtime is still responsible for loading firmware, booting the CPU... I wish the author would be more forthcoming about these limitations."
  • AI Safety and Oversight: Researchers have highlighted that this architecture could be used to create "hidden" reasoning paths. By storing computations in the RNN state, models might potentially evade chain-of-thought (CoT) monitoring tools.
  • Future Research: The community has expressed interest in whether this approach could be applied to scratch-trained models or if it could serve as a foundation for self-verifying, authenticated AI agents that sign their own outputs.

Limitations

Qwenputer is currently an experimental proof-of-concept with notable trade-offs:

  • Resource Overhead: The model checkpoint size is approximately 18.8 GB, roughly double that of the base Qwen 3.5 4B, due to the added layers and zero-padding.
  • Speed: CPU execution is significantly slower than native transformer inference, as each instruction requires multiple decoded tokens.
  • Inference Requirements: The system requires a specialized driver to manage the CPU boot process and prevent trace tokens from leaking into the model's primary output layers.

Sources

Related