divagr1925/Qwen3.5-4B-Qwenputer

Independent author's experimental model: Inserts 11 layers of a 32-bit RISC-V CPU (RV32IM) with weights directly computed by a compiler (without training) before Qwen3.5-4B, using Gated DeltaNet states as memory, enabling the execution of C and MicroPython programs during the model's forward pass; Qwen writes calc calls in the standard tool-calling format, and the results are written back bit by bit by the model itself, without invoking an external interpreter.

Independent author's experimental model: Inserts 11 layers of a 32-bit RISC-V CPU (RV32IM) with weights directly computed by a compiler (without training) before Qwen3.5-4B, using Gated DeltaNet states as memory, enabling the execution of C and MicroPython programs during the model's forward pass; Qwen writes calc calls in the standard tool-calling format, and the results are written back bit by bit by the model itself, without invoking an external interpreter.

Upvotes 80 · Likes 80 · Downloads 321

Reasons

  • Author's self-tests (greedy decoding, 40 questions per group): Synthetic integer arithmetic improved from 75.0 on the base model to 97.5, and DeepMind mul_big improved from 55.0 to 97.5, matching the performance of the base model calling real Python tools.
  • The author claims that replaying approximately 230,000 CPU output positions yields zero difference compared to the reference simulator, and the CPU passes official riscv-tests; Qwen's original weights remain unchanged, with a KL divergence of 6e-4 for text behavior compared to the base model.
  • Novel direction: Encoding deterministic computation into weights rather than using external sandboxes; achieves approximately 3,200 trajectory tokens per second on L4. Licensed under Apache-2.0, and not included in previous issues.

Usage

  • git clone divagr18/qwenputer, enter experimental/riscv and run 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?"; The RvChat driver is responsible for loading the firmware into the state and shielding CPU trajectory tokens from the Qwen layers.

Risks

  • Research nature: Currently, only arithmetic is demonstrated, with evaluations limited to 40 questions per group, all self-tested by the author; it requires the author's driver and firmware to function and is not a model that can be loaded and conversed with normally.
  • bf16 weights are 18.8 GB (mostly zero-padded), and the vocabulary includes an additional 230,000 trajectory tokens; it only processes text.
  • A file system version is released separately; the citation information in the GitHub code states MIT, while the model card states Apache-2.0.

Open

Hugging Face Trending

Explore the latest AI Radar updates