Text Generation
Transformers
Safetensors
English
qwen3
spyrl
rlsvr
self-play
reinforcement-learning
mathematical-reasoning
reasoning
conversational
text-generation-inference
Instructions to use SpyRL/SpyRL-Qwen3-4B-Math with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SpyRL/SpyRL-Qwen3-4B-Math with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SpyRL/SpyRL-Qwen3-4B-Math") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("SpyRL/SpyRL-Qwen3-4B-Math") model = AutoModelForCausalLM.from_pretrained("SpyRL/SpyRL-Qwen3-4B-Math", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use SpyRL/SpyRL-Qwen3-4B-Math with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SpyRL/SpyRL-Qwen3-4B-Math" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SpyRL/SpyRL-Qwen3-4B-Math", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/SpyRL/SpyRL-Qwen3-4B-Math
- SGLang
How to use SpyRL/SpyRL-Qwen3-4B-Math 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 "SpyRL/SpyRL-Qwen3-4B-Math" \ --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": "SpyRL/SpyRL-Qwen3-4B-Math", "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 "SpyRL/SpyRL-Qwen3-4B-Math" \ --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": "SpyRL/SpyRL-Qwen3-4B-Math", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use SpyRL/SpyRL-Qwen3-4B-Math with Docker Model Runner:
docker model run hf.co/SpyRL/SpyRL-Qwen3-4B-Math
Add link to paper
#1
by nielsr HF Staff - opened
README.md
CHANGED
|
@@ -1,21 +1,23 @@
|
|
| 1 |
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
base_model: Qwen/Qwen3-4B-Instruct-2507
|
| 4 |
-
pipeline_tag: text-generation
|
| 5 |
-
library_name: transformers
|
| 6 |
language:
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
| 8 |
tags:
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
---
|
| 16 |
|
| 17 |
# SpyRL-Qwen3-4B-Math
|
| 18 |
|
|
|
|
|
|
|
| 19 |
Qwen3-4B-Instruct-2507 trained with SpyRL on mathematical reasoning. In the performing stage each agent designs *and* solves a problem grounded in a math-heavy web document; the spy sees the same document with a contiguous 40% span masked out.
|
| 20 |
|
| 21 |
Trained with **SpyRL**, the reference implementation of **RLSVR** (Reinforcement Learning with Self-Verifiable Rewards) from the COLM 2026 paper *From RLVR to RLSVR: Task Transformation Induces Self-Verifiable Rewards for Open-Ended LLM Self-Improvement*.
|
|
@@ -89,4 +91,4 @@ bash spyrl/train_math_reasoning.sh
|
|
| 89 |
booktitle = {Conference on Language Modeling (COLM)},
|
| 90 |
year = {2026}
|
| 91 |
}
|
| 92 |
-
```
|
|
|
|
| 1 |
---
|
|
|
|
| 2 |
base_model: Qwen/Qwen3-4B-Instruct-2507
|
|
|
|
|
|
|
| 3 |
language:
|
| 4 |
+
- en
|
| 5 |
+
library_name: transformers
|
| 6 |
+
license: apache-2.0
|
| 7 |
+
pipeline_tag: text-generation
|
| 8 |
tags:
|
| 9 |
+
- spyrl
|
| 10 |
+
- rlsvr
|
| 11 |
+
- self-play
|
| 12 |
+
- reinforcement-learning
|
| 13 |
+
- mathematical-reasoning
|
| 14 |
+
- reasoning
|
| 15 |
---
|
| 16 |
|
| 17 |
# SpyRL-Qwen3-4B-Math
|
| 18 |
|
| 19 |
+
This model was presented in the paper [From RLVR to RLSVR: Task Transformation Induces Self-Verifiable Rewards for Open-Ended LLM Self-Improvement](https://huggingface.co/papers/2607.23802).
|
| 20 |
+
|
| 21 |
Qwen3-4B-Instruct-2507 trained with SpyRL on mathematical reasoning. In the performing stage each agent designs *and* solves a problem grounded in a math-heavy web document; the spy sees the same document with a contiguous 40% span masked out.
|
| 22 |
|
| 23 |
Trained with **SpyRL**, the reference implementation of **RLSVR** (Reinforcement Learning with Self-Verifiable Rewards) from the COLM 2026 paper *From RLVR to RLSVR: Task Transformation Induces Self-Verifiable Rewards for Open-Ended LLM Self-Improvement*.
|
|
|
|
| 91 |
booktitle = {Conference on Language Modeling (COLM)},
|
| 92 |
year = {2026}
|
| 93 |
}
|
| 94 |
+
```
|