Skip to content

Back to the catalog

Qwenputer: A functioning, deterministic RISC-V CPU inside Qwen3.5
divagr.comwriteup

Qwenputer: A functioning, deterministic RISC-V CPU inside Qwen3.5

Qwenputer is a stock Qwen3.5 4B with a 32-bit RISC-V CPU (RV32IM plus Zba and a bignum unit) compiled directly into added layers, with no training. Gated DeltaNet states act as exact RAM via gate 1, beta 1 and one-hot keys. It scores 97.5 to 100% on DeepMind arithmetic sets, and 100% on NUPA long-integer arithmetic. It also has an experimental in-model filesystem. The checkpoint is 18.8 GB and needs the RvChat driver.

TL;DR Compiles a deterministic RISC-V CPU into Qwen3.5 4B weights, using Gated DeltaNet states as exact RAM, to run arithmetic, C and MicroPython inside the forward pass.
Document

What it claims

Qwenputer adds 11 compiled layers in front of the 32 layers of an unmodified Qwen 3.5 4B. Those layers implement an RV32IM RISC-V core with Zba and a bignum unit, and they run C and MicroPython inside the forward pass. Divyansh Agrawal reports that the core passes the official riscv-tests, matches qemu, and ran 18 million instructions free-running with no errors. Base Qwen weights are unchanged. The computer sits in extra hidden dimensions and layers, and normal text output stays within noise of base Qwen (KL 6e-4 against a noise floor of 5e-4).

How it works

A compiler sets every weight directly from a circuit description of the CPU. Attention heads do lookups, feed-forward units do arithmetic, and Gated DeltaNet heads hold RAM. Each instruction decodes as three tokens: ADDR names the memory row to write, VAL carries the value, and STEP ends the instruction. That token stream is the CPU's execution trace.

Qwen reaches the CPU through its existing tool-call format, with no post-training. The compiled layers write the tool response themselves, so no external runtime is involved. The RvChat driver loads firmware into the GDN state and keeps trace tokens out of Qwen's own layers.

The filesystem hashes file names into one of 1,024 directory slots in DeltaNet state and uses linear probing on collisions. File text is stored in other heads at eight tokens per row, chained together. Lookup takes about two or three steps. Capacity is 512 files, about 53,000 tokens. The state can be saved and reloaded across conversations.

Evidence

On DeepMind math sets, the comparison is Qwenputer vs Qwen 3.5 4B with a Python tool vs base Qwen:

  • div_big: 97.5% vs 95% vs 72.5%
  • mul_big: 97.5% vs 100% vs 55%
  • mul_div_multiple_longer: 100% vs 97.5% vs 90%
  • add_or_sub_big: 97.5% vs 97.5% vs 87.5%

On NUPA long-integer arithmetic, accuracy rises from 48.6% to 100%, equal to the Python-tool setup. Replaying about 230,000 CPU output positions against a reference machine found zero mismatches.

The filesystem answers facts that changed between chats correctly 90% of the time, against 30% when old chats are pasted back in. Against Python-run memory tools, the page reports 83.3% vs 78.9%. Sample sizes are not given.

How to use it

The model runs on a single 24 GB GPU and needs uv and the Hugging Face CLI. Weights are divagr1925/Qwen3.5-4B-Qwenputer on Hugging Face, and are also on ModelScope. The filesystem variant's code is on the rv-store branch.

git clone https://github.com/divagr18/qwenputer && cd qwenputer/experimental/riscv && uv sync --extra hf
hf download divagr1925/Qwen3.5-4B-Qwenputer --local-dir qwenputer-rv
uv run python -m chipformer.rv.chat qwenputer-rv --firmware tests/data/rv/calc-bridge.elf \
    --ask "Use calc: what is 123456789 * 987654321?"

Limits

  • Checkpoint size: 18.8 GB, about double base Qwen, although mostly zero padding.
  • No plain generate(): the model requires RvChat to run.
  • Speed: each instruction costs several decoded tokens, so large calculations take seconds. The batched benchmark executor reaches about 3,200 CPU tokens per second on an NVIDIA L4.
  • Not Linux-class: the core implements RV32IM but cannot run Linux.
  • Filesystem is experimental: it lives on a separate branch.
  • Not yet available: a python() tool that would run model-written code on the in-weight MicroPython is listed as future work.
  • Licence: the page does not state one for the code or weights.

Organisations named here

  • Qwen
  • DeepMind
  • Hugging Face
  • ModelScope
  • GitHub
  • NUPA
  • qemu

Technologies named here

  • RvChat
  • Qwenputer
  • Qwenputer Filesystem
  • chipformer
  • Qwen3.5
  • Gated DeltaNet
  • riscv-tests
  • Qwen3-Next
  • qemu
  • uv
  • Hugging Face CLI
  • MicroPython
  • Hugging Face
  • ModelScope
  • GitHub
  • Python
  • RISC-V
  • Transformer

Techniques named here

  • Gated DeltaNet state as exact RAM
  • Compiling a CPU into transformer weights
  • Tool-call format piggybacking
  • In-model filesystem
  • Delta rule associative memory

Also named here

  • Schlag et al.