Qwenputer: A RISC-V processor running inside Qwen 3.5's weights

A developer has compiled a working 32-bit RISC-V CPU into Qwen 3.5 4B that runs entirely within the model's own computation. The Gated DeltaNet layers act as exact working memory, with no external tools or Python sandbox.

Research Try it yourself Oct 28, 2026 5 min read Source: r/LocalLLaMA
Illustrative image, AI-generated

What this is about

Under the name Qwenputer, developer Divyansh Agrawal has published an unusual experiment: an unmodified Qwen 3.5 4B (a language model with about 4 billion parameters, i.e. learned tuning knobs) with a working 32-bit RISC-V CPU compiled into its weights. RISC-V is an open processor architecture. The CPU runs entirely inside the model's forward passes and can execute arithmetic as well as C and MicroPython code, with no external program, tool or sandbox. The model is available on Hugging Face and ModelScope, and the code is on GitHub.

The trick: Gated DeltaNet as exact working memory

Qwen3-Next and Qwen 3.5 use Gated DeltaNet in three out of four attention layers. It's a linear RNN (a network with a running memory state) used as the attention mechanism. Each head keeps a state matrix as its memory. If you set the gate (which controls forgetting) to 1, the write strength beta to 1 and use one-hot keys (a vector with exactly one 1 that points to a row like a memory address), every write overwrites exactly one row and every query returns the exact value. That turns the layers into real RAM. Unlike the KV cache of normal attention, its size stays the same regardless of conversation length. Schlag et al. (2021) had already shown that the delta rule works as a memory. According to the author, what's new is making it exact and addressable in a production model.

A CPU without training

A compiler sets every weight directly. The CPU is described as a circuit (read registers, add, branch conditionally), and each step becomes part of a transformer layer: attention heads do lookups, feed-forward units compute, and DeltaNet heads hold the RAM. Each instruction corresponds to a few generated tokens (ADDR, VAL, STEP). These tokens are the CPU's execution trace.

The CPU implements RV32IM plus the Zba extension and a small bignum unit for large numbers, and takes up 11 layers ahead of Qwen's 32. It passes the official riscv-tests, its programs match the qemu emulator, and it executed 18 million instructions without a single error. It is not yet a CPU that can run Linux. Qwen's original weights stay unchanged, while the compute weights sit in extra dimensions and layers. Qwen uses the CPU without any further training by relying on the familiar tool-call format. A small driver called RvChat loads the firmware into the DeltaNet state.

Results

Test Qwenputer Qwen with Python tool Base Qwen
div_big 97.5% 95% 72.5%
mul_big 97.5% 100% 55%
mul_div_multiple_longer 100% 97.5% 90%
add_or_sub_big 97.5% 97.5% 87.5%

On NUPA (long integer arithmetic), Qwenputer rises from 48.6% to 100%, on par with the Python tool. Around 230,000 output positions were checked against a reference machine with no deviation. Normal text stays close to the base model (KL 6e-4 against a noise floor of 5e-4).

A file system inside the model

There is also an experimental file system with the operations put, append, get, list and delete. File names are hashed to one of 1,024 directory slots, the text lives in other heads, eight tokens per line. It holds up to 512 files, about 53,000 tokens of text. The state can be saved and loaded into a new conversation. With it, Qwen reproduces updated facts correctly 90% of the time, versus 30% when you paste in old chats. Python-based memory tools reach 83.3% versus 78.9% (as stated in the original). The code is on the rv-store branch.

What you need to try it

  • A single GPU with 24 GB of VRAM.
  • The checkpoint is 18.8 GB (about twice the size of base Qwen, mostly zeros as padding), so plan for a good 20 GB of disk space.
  • Tools: uv and the Hugging Face CLI; a Linux/Python environment.
  • There is a live demo on ModelScope. The author tested throughput on an L4 GPU (about 3,200 CPU tokens per second).
  • Running on a CPU or Mac isn't specified.

Limits

This is an experiment. It needs the RvChat driver and doesn't yet run with a simple generate() call. It's slow because every CPU instruction costs several tokens, so big calculations take seconds instead of milliseconds. Next, the author plans to have Qwen write Python and run it on the MicroPython inside its own weights, plus a faster CPU. Two follow-up articles cover AI safety: how hybrid models could hide their reasoning in the RNN state and evade CoT monitoring, and how compiled weights could serve as monitors that can't be switched off.

Our take

Qwenputer shows that a language model can run exact, deterministic computation internally, an approach that could make tool calling partly unnecessary. In practice it's still slow and clunky, and all the numbers come from the author, not independent verification. The benchmarks are limited to arithmetic, where Python tools already work perfectly. The most exciting part is the research angle: exact control over the RNN state as a testbed for interpretability and safety.

Sources

#qwen#risc-v#gated-deltanet#research#experiment
Read the original source

Try it yourself: Qwen3.5-4B-Qwenputer

Explained step by step, no prior knowledge needed – on your own computer or free in your browser.

What can I do with it?

Qwenputer is a Qwen 3.5 4B with a small computer CPU (RISC-V, an open processor architecture) built right in. When you run the model locally, you can give it arithmetic problems with very large numbers. It doesn't work them out by feel. Instead, it runs them on the CPU inside its own layers. That needs no Python tool and no sandbox (an isolated execution environment). According to the author, it hits 97.5 to 100% on multiplication, division and addition of large numbers. Base Qwen scores between 55 and 90% there. On normal text it stays close to the base model. The limits: it's an experiment and only works with the RvChat driver, not with a simple generate() call. It's slow, and all the numbers come from the author. Compared with a Python tool it's at best on par in the tests, but it shows how a model can calculate exactly.

Who is it worth it for?

The model is for tinkerers, researchers and the curious who have a 24 GB GPU and some Linux experience. They want to see how a language model computes exactly on the inside. If you want a fast everyday chatbot or a simple setup, this isn't for you. The same goes if you don't have a suitable GPU.

Ideas: What you can do with it

Check big-number math exactly

Give the model long multiplications or divisions and compare the result with a calculator or Python. That lets you see for yourself how reliable the built-in CPU is. It's a good way to build trust in the technique.

Compare with base Qwen

Give the same tasks to regular Qwen 3.5 4B and to Qwenputer. Note how often each one gets it right. According to the author, the base model scores only 55% on mul_big, while Qwenputer scores 97.5%. Whether you can confirm that in small samples makes for a nice hobby experiment.

Teaching material for CS courses

Show students or colleagues that a language model can carry a processor in its weights. Explain Gated DeltaNet as RAM and read excerpts from the Model Card. It makes abstract concepts like registers, memory and program counters tangible.

Interpretability research

If you work on interpretability (understanding what happens inside a model) or AI safety, use the model as a testbed. The RNN state is exactly controllable here. You can save states, inspect them and load them into new conversations. According to the author, this is the most exciting perspective.

Try the experimental memory

With the file system variant, you store facts using put, change them and query them later. The state can be saved and loaded in a new conversation. According to the author, Qwen reproduces updated facts correctly 90% of the time this way, versus 30% when pasting in old chats.

Size9.4 B parameters
Download5.6 GB (about 7 min at 100 Mbit/s)
Licenseapache-2.0
TypeLanguage model (text chat)

What your computer needs

Graphics card (NVIDIA) at least 7.5 GB VRAMe.g. RTX 3060 Ti, RTX 4060, RTX 5060, RX 7600
Mac (Apple Silicon M1–M5) from 16 GB unified memoryThe GPU and CPU share the memory – the model can use about 70% of it
CPU only (no graphics card) Runs smoothly without a graphics cardan estimated 8 words per second on a current desktop PC. This requires at least 16 GB of RAM.
Storage approx. 7.6 GB freeModel download plus programs
Google Colab runs for freeThe free Tesla T4 GPU with 15 GB is enough

Values estimated from the model size – the Model Card may have more precise figures.

Which variant is right for me?

Many models come in several sizes or "quantizations." These are compressed versions: smaller and faster, but slightly less accurate. Rule of thumb: pick the largest variant whose memory requirement fits in your VRAM (video memory). The scripts below choose this for you automatically.

VariantDownloadNeeds approx.Compatible graphics cards
4-bit (Q4) Default 5.6 GB7.5 GBe.g. RTX 3060 Ti, RTX 4060, RTX 5060, RX 7600
8-bit (Q8) 10 GB12 GBe.g. RTX 4060 Ti 16 GB, RTX 4080, RTX 5080, RX 7800 XT
16-bit (Original) 19 GB22 GBe.g. RTX 3090, RTX 4090, Tesla P40

There are two variants. The Qwenputer model with CPU is the best starting point. There is also an experimental file system variant (branch rv-store) that stores files in the model state. According to the source, both are in bf16 (18.8 GB). No quantized, meaning shrunken, variant is mentioned. The checkpoint is mostly zeros as padding. Plan for a good 20 GB of disk space.

  • According to the author, a single GPU with 24 GB of VRAM is enough.
  • The checkpoint is 18.8 GB, about twice the size of base Qwen. Plan for a good 20 GB of free disk space.
  • The author measured throughput on an L4 GPU: about 3,200 CPU tokens per second.
  • Every CPU instruction costs several tokens. Big calculations therefore take seconds instead of milliseconds.
  • The CPU's RAM lives in the DeltaNet state. Its size stays the same regardless of conversation length.
  • Running on a CPU or Mac (Apple Silicon) isn't specified in the source.
How do I find out what my computer has?
  • Windows: Press Ctrl + Shift + Esc → Task Manager → Performance tab → click GPU on the left. At the bottom you'll see Dedicated GPU memory (that's your VRAM). You'll find system memory under Memory.
  • Mac: Apple menu at the top left → About This Mac. You'll see your chip (e.g. M2) and memory (e.g. 16 GB). On Apple chips, graphics and processor share this memory.
  • Linux: Type nvidia-smi in the terminal (shows your graphics card and its memory) and free -h for system memory.

Guide

Google Colab (in your browser, no installation)

Google Colab is a free service from Google. It gives you a computer with a graphics card in your browser for a few hours. All you need is a Google account. For this model: runs for free – The free Tesla T4 GPU with 15 GB is enough.

  1. Download the notebook. Click the button and save the file.

    Download colab.ipynb

  2. Open Colab. Go to colab.research.google.com and sign in with your Google account.
  3. Upload the notebook. In the window that appears, click Upload on the left (or choose File → Upload notebook at the top) and select the file colab.ipynb.
  4. Turn on the GPU. In the top menu, go to Runtime → Change runtime type → under Hardware accelerator, select T4 GPU → Save.
  5. Start everything. Runtime → Run all (keyboard shortcut Ctrl + F9). If you see the warning “This notebook was not authored by Google,” click Run anyway.
  6. Wait. The cells run one after another. A green checkmark appears to the left of each cell when it's done. Installation and download take about 6 minutes here.
  7. Try it out. The result appears below the last cell. To test something else, change the text in the cell and run it again with Shift + Enter.
  8. Clean up. When you're done: Runtime → Disconnect and delete runtime. This saves your free quota.

Good to know: The free GPU is limited (usually a few hours per day). After about 90 minutes of inactivity, Colab disconnects, and you'll have to start everything over.

Windows 10 / 11

This model runs on Python. Our script handles the setup automatically: it creates an isolated Python environment, installs the required packages (PyTorch, approx. 3 GB) and downloads the model (5.6 GB (about 7 min at 100 Mbit/s)).

  1. Update your graphics driver (NVIDIA): install the latest driver. Without an NVIDIA card, it runs on the CPU – much more slowly.
  2. Install Python. Download Python 3.12 from python.org and run the installer. Important: At the bottom of the first window, tick Add python.exe to PATH, then click Install Now.
  3. Create a folder and download the files. Create a folder, e.g. Documents\AI-Test, and save both files into it:

    try_windows.ps1 demo.py

  4. Open a terminal in the folder. Open the folder in File Explorer, right-click an empty spot → Open in Terminal.
  5. Run it. Paste this command and press Enter:
    powershell -ExecutionPolicy Bypass -File try_windows.ps1
    Installation and download are running now. The first time, this can take 10–30 minutes.
  6. Result. The window shows the model's answer to a test question.
  7. Try your own input: Open demo.py in an editor, change the sample text, and save. Then run this in the terminal:
    .\.venv-qwen3-5-4b-qwenputer\Scripts\Activate.ps1
    python demo.py

macOS

Macs with an Apple chip (M1 to M5) are ideal. Older Intel Macs are very slow.

  1. Open Terminal. Press Cmd + Space, type Terminal, and press Enter.
  2. Install the developer tools (first time only; includes Python):
    xcode-select --install
    Click Install in the window. If you see "already installed," everything is already in place.
  3. Download the files – both end up in your Downloads folder:

    try_mac.sh demo.py

  4. Run it:
    cd ~/Downloads
    bash try_mac.sh
    The first time, installation and download take 10–30 minutes.
  5. Result. The window shows the model's answer to a test question.

Linux

  1. Check your GPU. nvidia-smi should show your card. If it doesn't, install the driver on Ubuntu and restart:
    sudo ubuntu-drivers install
  2. Install the Python basics (Ubuntu/Debian):
    sudo apt update && sudo apt install -y python3-venv python3-pip git
  3. Put the files in a folder and open a terminal there:

    try_linux.sh demo.py

  4. Run it:
    bash try_linux.sh
  5. Result. The window shows the model's answer to a test question.

Try it

Use calc: what is 123456789 * 987654321?
Use calc: what is 98765432109876543210 divided by 12345?
Use calc: compute 2^100 minus 3^50 and give the exact result.
Use calc: add 99999999999999999999 and 1 and give the result digit by digit.
Use calc: what is 987654321987654321 * 123456789123456789? Calculate exactly, without rounding.

Tips for better results

  • Start with the example task from the Model Card (123456789 * 987654321). If it runs, your setup is correct. Then increase the size of the numbers.
  • Phrase the task with "Use calc:" and keep it clear and unambiguous. This is about arithmetic. The model isn't meant for general questions.
  • Double-check every result, for example with Python. The benchmarks are at 97.5 to 100%, not 100% on all tests. The numbers also come from the author himself.
  • Test the task types one at a time: addition, multiplication, division. That way you can tell where it stumbles.
  • Expect to wait. Don't ask for lots of huge calculations at once, because every instruction costs several tokens.

If something goes wrong

A simple generate() call doesn't work. The RvChat driver (chipformer.rv.chat) has to load the firmware.

You need uv and the Hugging Face CLI. The source mentions a Linux/Python environment.

The firmware file tests/data/rv/calc-bridge.elf from the GitHub repo must be passed with --firmware. Run the command in the experimental/riscv folder of the cloned repo.

The model needs a GPU with 24 GB of VRAM. With less memory it probably won't load. The checkpoint is 18.8 GB.

Start the task with "Use calc:", as in the quickstart guide. Without this pattern, the model may not use the CPU.

The file system (put, append, get, list, delete) is experimental. It lives on the rv-store branch and has its own model (file system variant).

Big calculations take patience. Waiting a few seconds is normal and not a crash.

“out of memory,” a crash, or your computer freezes

The model is too big for your VRAM (video memory). Pick a smaller variant from the table above and close other programs, especially games and browsers with lots of tabs.

It runs, but extremely slowly

Your CPU is probably doing the work instead of your graphics card. In Ollama, the PROCESSOR column of ollama ps shows how much runs on the GPU. If it says "100% CPU", update your graphics driver or pick a smaller variant that fits entirely into VRAM (video memory).

“ollama” or “python” is not found

Close the terminal window and open it again so it recognizes the newly installed program. For Python on Windows: reinstall it and check Add python.exe to PATH.

Windows: "Running scripts is disabled on this system"

Run the script with exactly the command above: powershell -ExecutionPolicy Bypass -File try_windows.ps1. This allows execution for this one time only.

Error message when loading the model (version, "trust_remote_code", unknown architecture)

Brand-new models often need the latest software version. With Ollama: update Ollama. With Python: pip install -U transformers in the activated environment. The Model Card usually lists the exact version.

Tokenstrom generates the scripts and notebook automatically. Please take a quick look before running them – they're plain, readable text. Mind the model's license: apache-2.0.

Ask the AI assistant

Questions about this article, installation or background? Our assistant knows this page and runs on our own machine, not in someone else's cloud.

Connecting …

The Assistant is an AI (Gemma 4) and can make mistakes – please check important details against the source. Questions are used only to generate an answer and are deleted after one hour. Please don't enter any personal data.

Comments

What do you think? Already tried it? Write it here, no sign-up needed.

  1. Loading comments …

Comments are public. Links aren't allowed, and we delete abusive posts. You can delete your own comment at any time in this browser. Learn more in the Privacy Policy.