Experimental model: Compiles a 32-bit RISC-V CPU into a 11-layer Transformer placed before Qwen3.5-4B's own layers, using Qwen's Gated DeltaNet state as memory, enabling the model to actually execute C and MicroPython programs during forward computation, and writing out arithmetic operations like large-number multiplication and division with bit-level precision.
Star count 309 (+80 / 24h)
Rationale
- The weights of the CPU layer are not trained but directly computed by a compiler; Qwen continues to write
calctool calls as usual, but there is no external executor. The internal computation layer within the model reads the calls, performs the calculations on the CPU, and then the model itself writes out the results bit by bit. The authors claim it passes the official riscv-tests, with zero error across approximately 23 ten-thousand output positions when replayed, and the KL divergence of the text behavior compared to the original model is 6e-4 - Comparison provided by the authors (greedy decoding, 40 questions per group): Synthetic integer arithmetic improves from 75.0 in the base model to 97.5, DeepMind mul_big improves from 55.0 to 97.5, matching the performance of the base model calling the host machine's Python interpreter
- Additional experimental branches: An NPU version with added dot-product instructions can run a small 260K model with 26 ten-thousand parameters within the model; a file system version stores up to 512 files in the DeltaNet state, with the authors claiming cross-session recall questions improve from 7.8 to 83.3; an early CHIP-8 version is also still available for download
Usage
- After
git clone, enterexperimental/riscv, runuv sync --extra hf, usehf download divagr1925/Qwen3.5-4B-Qwenputerto download weights, then useuv run python -m chipformer.rv.chat qwenputer-rv --firmware tests/data/rv/calc-bridge.elf --ask "…"to ask questions - The model is loaded as a standard Qwen3_5ForCausalLM; the example code is placed on CUDA and disables bf16 reduced-precision reduction to ensure matrix multiplication precision; the design and all measurements are in
experimental/riscv/docs/rv32.md
Risks
- The authors state it is not useful everywhere: It ties on word problems like GSM8K, the base model still leads on long expression chains, and the model repeatedly verifies results it has already provided until it exhausts the token budget; the table for the CHIP-8 version shows the best scores from various benchmarks at development checkpoints
- The example runs on NVIDIA GPUs; the authors report a speed of approximately 3,200 trajectory tokens per second on L4, and the NPU version takes about 41 seconds to generate one story token; the code is MIT licensed, weights follow a modified Apache-2.0 license for Qwen3.5-4B, and the repository was created on 10/19