Run this model with HF Jobs
Run rvindra/Qwenputer-2B-SPSQ-RL on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/rvindra/Qwenputer-2B-SPSQ-RL. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/rvindra/Qwenputer-2B-SPSQ-RL on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/rvindra/Qwenputer-2B-SPSQ-RL. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/rvindra/Qwenputer-2B-SPSQ-RL. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use rvindra/Qwenputer-2B-SPSQ-RL with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rvindra/Qwenputer-2B-SPSQ-RL with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="rvindra/Qwenputer-2B-SPSQ-RL") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("rvindra/Qwenputer-2B-SPSQ-RL") model = AutoModelForCausalLM.from_pretrained("rvindra/Qwenputer-2B-SPSQ-RL", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use rvindra/Qwenputer-2B-SPSQ-RL with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "rvindra/Qwenputer-2B-SPSQ-RL" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rvindra/Qwenputer-2B-SPSQ-RL", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/rvindra/Qwenputer-2B-SPSQ-RL
- SGLang
How to use rvindra/Qwenputer-2B-SPSQ-RL with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "rvindra/Qwenputer-2B-SPSQ-RL" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rvindra/Qwenputer-2B-SPSQ-RL", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "rvindra/Qwenputer-2B-SPSQ-RL" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rvindra/Qwenputer-2B-SPSQ-RL", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use rvindra/Qwenputer-2B-SPSQ-RL with Docker Model Runner:
docker model run hf.co/rvindra/Qwenputer-2B-SPSQ-RL
Qwenputer-2B-SPSQ-RL
Qwenputer-2B-SPSQ-RL is the SFT + RL post-trained release of rvindra/Qwen3.5-2B-Qwenputer-SPSQ โ a 2B model with a compiled 32-bit RISC-V CPU (rv32im_zba + 62-digit bignum coprocessor) embedded directly in its weights.
Whereas the pre-SFT base SPSQ model required disabling thinking (enable_thinking=False) and decoding heuristics to prevent mental arithmetic hallucinations, Qwenputer-2B-SPSQ-RL removes all decoding heuristics (heuristic_decoding: false). It reasons naturally inside <think>...</think>, delegates multi-step calculations natively to its in-weight RISC-V CPU (95.5% delegation, 2.95 tool calls/problem), and finishes cleanly within a 768-token budget with 0 lockstep mismatches across 25.39M verified RISC-V trace tokens.
Training Method (SFT + RL)
- Supervised Fine-Tuning (SFT): Warm-started LoRA adapters on verified multi-step reasoning trajectories where numerical sub-steps are delegated to the in-weight
calctool. Token-level ownership masking supervises only model-owned reasoning, tool-call syntax, and final answers while masking prompt and firmware-emitted<tool_response>spans, teaching concise problem setup and natural</think>closure. - Reinforcement Learning with Verifiable Rewards (RLVR): On-policy group rollouts trained directly with W4A16 straight-through quantization so policy behavior matches the exported 4-bit weights. Rewards combine exact answer correctness, verified
calcdelegation, clean termination within budget, and a KL anchor to preserve general language behavior. Trained adapters (168LoRA modules) are merged back into group-128 W4A16 weights with all decoding heuristics disabled.
Benchmarks
Evaluated apples-to-apples across the full GSM8K and GSM-Hard test sets (2,638 problems total) with greedy decoding (do_sample=False), enable_thinking=True, 768 model-owned token budget, and heuristic_decoding=False.
Accuracy
| Benchmark | Problems | Base Qwen3.5-2B (BF16) |
Baseline SPSQ-2B (Pre-SFT) |
Qwenputer-2B-SPSQ-RL (Ours) |
Gain vs. Baseline SPSQ |
|---|---|---|---|---|---|
| GSM8K Full | 1,319 |
6.07% (80) |
10.54% (139) |
70.43% (929) |
+59.89 pp |
| GSM-Hard Full | 1,319 |
1.21% (16) |
2.96% (39) |
60.80% (802) |
+57.84 pp |
| Overall Word | 2,638 |
3.64% (96) |
6.75% (178) |
65.62% (1,731) |
+58.87 pp |
| Held-Out Word | 200 |
1.50% (3) |
6.00% (12) |
62.50% (125) |
+56.50 pp |
Under thinking=True and a 768-token budget, untrained Base 2B and pre-SFT Baseline SPSQ overthink into the token cap on >92% of problems without closing </think>.
Higher Thinking Budget (4,096 Tokens on Held-Out 200)
Evaluated apples-to-apples at a 4,096-token budget across all three models (enable_thinking=True, greedy): Qwenputer-2B-SPSQ-RL leads by +50.0 to +56.5 pp while using 8.9รโ9.2ร fewer tokens and maintaining 0 lockstep mismatches:
| Model | Budget | GSM8K (100) |
GSM-Hard (100) |
Overall (200) |
Avg Tokens | Closed </think> |
Cap Hits | Delegated |
|---|---|---|---|---|---|---|---|---|
Base Qwen3.5-2B |
4,096 |
23.0% |
2.0% |
12.5% (25) |
3,733.8 |
13.0% |
87.0% |
0.0% |
Baseline SPSQ-2B |
4,096 |
10.0% |
2.0% |
6.0% (12) |
3,863.3 |
6.5% |
93.5% |
0.0% |
Qwenputer-2B-SPSQ-RL (Ours) |
4,096 |
73.0% |
52.0% |
62.5% (125) |
421.2 |
98.5% |
1.5% |
96.5% |
Token Usage (2,638 Word Problems)
| Model | Dataset | Mean Tokens | Median | P95 | Mean (Correct) | Total Tokens | Closed </think> |
Cap Hits (768) |
|---|---|---|---|---|---|---|---|---|
Base Qwen3.5-2B |
GSM8K | 754.7 |
768 |
768 |
554.8 |
995,465 |
8.3% |
93.8% |
Base Qwen3.5-2B |
GSM-Hard | 766.0 |
768 |
768 |
605.9 |
1,010,398 |
1.6% |
98.8% |
Base Qwen3.5-2B |
Overall | 760.4 |
768 |
768 |
563.3 |
2,005,863 |
5.0% |
96.3% |
Baseline SPSQ-2B |
GSM8K | 736.5 |
768 |
768 |
481.3 |
971,486 |
12.6% |
89.1% |
Baseline SPSQ-2B |
GSM-Hard | 758.5 |
768 |
768 |
495.9 |
1,000,521 |
3.9% |
96.6% |
Baseline SPSQ-2B |
Overall | 747.5 |
768 |
768 |
484.5 |
1,972,007 |
8.3% |
92.8% |
Qwenputer-2B-SPSQ-RL |
GSM8K | 354.9 |
334 |
558 |
332.9 |
468,135 |
99.6% |
1.6% |
Qwenputer-2B-SPSQ-RL |
GSM-Hard | 389.8 |
371 |
622 |
356.1 |
514,174 |
99.1% |
2.1% |
Qwenputer-2B-SPSQ-RL |
Overall | 372.4 |
352 |
592 |
343.7 |
982,309 |
99.4% |
1.9% |
Tool Delegation & Circuit Lockstep (2,638 Word Problems)
| Metric | Base Qwen3.5-2B |
Baseline SPSQ-2B |
Qwenputer-2B-SPSQ-RL (Ours) |
|---|---|---|---|
| Verified Delegation Rate | 0.0% (0) |
0.4% (11) |
95.5% (2,518) |
Total calc Calls (Avg / Prob) |
0 (0.00) |
111 (0.04) |
7,773 (2.95) |
| Problems with All Calls Verified | 0.0% (0) |
2.7% (72) |
97.3% (2,567) |
| Manual Arithmetic in Reasoning | N/A | 71.8% (1,895) |
1.6% (42) |
| RISC-V Trace Tokens Executed | 0 |
431,371 |
25,388,370 |
| Lockstep Mismatches | N/A | 0 |
0 |
Quickstart
import torch
from huggingface_hub import snapshot_download
from transformers import AutoTokenizer
from spsq.modeling_qwenputer_spsq import QwenputerSPSQForCausalLM
from chipformer.rv.chat import CALC_TOOL
# from_pretrained_spsq() expects a local directory path, so download the Hub repo first
model_dir = snapshot_download("rvindra/Qwenputer-2B-SPSQ-RL")
tokenizer = AutoTokenizer.from_pretrained(model_dir)
model = QwenputerSPSQForCausalLM.from_pretrained_spsq(model_dir, device="cuda")
# Optional: pre-dequantize W4A16 weights for ~3x faster inference (~5 GB VRAM; skip on <=4 GB GPUs)
model.cache_dequantized_weights()
messages = [
{
"role": "system",
"content": (
"Use calc for every numerical calculation. Reason about the setup, then use the tool to "
"evaluate the expression. You can call it again if another calculation is needed."
),
},
{
"role": "user",
"content": (
"A warehouse packs 48,725 crates across 35 trucks and sells each crate for $19.75. "
"What is the total revenue? Put the final answer in \\boxed{}."
),
},
]
inputs = tokenizer.apply_chat_template(
messages,
tools=[CALC_TOOL],
add_generation_prompt=True,
enable_thinking=True,
return_tensors="pt",
).to("cuda")
with torch.no_grad():
outputs = model.generate(
inputs,
max_new_tokens=768,
strip_trace_tokens=True,
heuristic_decoding=False,
suppress_prose_starters=False,
)
print(tokenizer.decode(outputs[0, inputs.shape[1]:], skip_special_tokens=False))
Citation
@software{agrawal2026qwenputer,
author = {Agrawal, Divyansh},
title = {{Qwenputer}: a computer compiled into the weights of a language model},
year = {2026},
url = {https://github.com/divagr18/qwenputer},
license = {MIT}
}
@software{rvindra2026qwenputer_spsq_rl,
author = {Rvindra},
title = {{Qwenputer-2B-SPSQ-RL}: SFT and RLVR for Natural In-Weight RISC-V Tool Delegation},
year = {2026},
url = {https://huggingface.co/rvindra/Qwenputer-2B-SPSQ-RL},
license = {Apache-2.0}
}
- Downloads last month
- 913
