Instructions to use lllyx/Qwen3-4B-Base-GRPO with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lllyx/Qwen3-4B-Base-GRPO with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="lllyx/Qwen3-4B-Base-GRPO") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("lllyx/Qwen3-4B-Base-GRPO") model = AutoModelForCausalLM.from_pretrained("lllyx/Qwen3-4B-Base-GRPO") 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
- vLLM
How to use lllyx/Qwen3-4B-Base-GRPO with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lllyx/Qwen3-4B-Base-GRPO" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lllyx/Qwen3-4B-Base-GRPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/lllyx/Qwen3-4B-Base-GRPO
- SGLang
How to use lllyx/Qwen3-4B-Base-GRPO 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 "lllyx/Qwen3-4B-Base-GRPO" \ --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": "lllyx/Qwen3-4B-Base-GRPO", "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 "lllyx/Qwen3-4B-Base-GRPO" \ --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": "lllyx/Qwen3-4B-Base-GRPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use lllyx/Qwen3-4B-Base-GRPO with Docker Model Runner:
docker model run hf.co/lllyx/Qwen3-4B-Base-GRPO
Qwen3-4B-Base-GRPO
Qwen3-4B-Base-GRPO is a post-RL checkpoint trained with the verl framework. It starts from Qwen3-4B-Base and applies GRPO on the DAPO-Math-17k-Processed dataset for mathematical reasoning and problem-solving.
This model is associated with the paper:
Rethinking On-Policy Distillation of Large Language Models: Phenomenology, Mechanism, and Recipe
Paper link: https://arxiv.org/abs/2604.13016
Model Description
This model is obtained by applying GRPO reinforcement learning to Qwen3-4B-Base with verl. The training is intended to improve math-focused reasoning performance under the on-policy distillation setting.
Key characteristics
- Base model: Qwen3-4B-Base
- Training framework: verl
- Training stage: Reinforcement Learning (GRPO)
- Parameter update: Full-parameter actor update
- Primary domain: Mathematical reasoning
- Reward model: Not used (
reward_model.enable: false) - Rollout engine: vLLM
- Context length: 32768 tokens
- Responses per prompt: 8
Training Details
Training configuration
- Framework: verl
- Algorithm:
grpo - GRPO outcome weight:
1.0 - Learned reward model: disabled (
reward_model.enable: false) - Reward source: custom rule-based math reward function
- Training dataset:
DAPO-Math-17k-Processed - Training file:
datasets/DAPO-Math-17k-Processed/DAPO-Math.parquet - Validation datasets:
AIME25,AMC23,AIME24 - Prompt length:
1024 - Response length:
7168 - Validation response length:
31744 - Max model length:
32768 - Rollout temperature:
1.0 - Repetition penalty:
1.0 - KL loss: disabled
- Format reward: disabled
- Loss aggregation:
token-mean - Learning rate:
1e-6 - PPO mini-batch size:
64 - PPO micro-batch size per GPU:
1 - Tensor parallel size:
1 - Number of GPUs:
8 - Number of epochs:
1 - Save frequency: every
20steps - Test frequency: every
20steps
Dataset
- Training dataset:
DAPO-Math-17k-Processed - Validation datasets:
AIME25,AMC23,AIME24
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "lllyx/Qwen3-4B-Base-GRPO"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype="auto",
device_map="auto",
)
Citation
If you use this model, please consider citing the related paper:
@article{li2026rethinking,
title={Rethinking On-Policy Distillation of Large Language Models: Phenomenology, Mechanism, and Recipe},
author={Li, Yaxuan and Zuo, Yuxin and He, Bingxiang and Zhang, Jinqian and Xiao, Chaojun and Qian, Cheng and Yu, Tianyu and Gao, Huan-ang and Yang, Wenkai and Liu, Zhiyuan and Ding, Ning},
journal={arXiv preprint arXiv:2604.13016},
year={2026}
}
- Downloads last month
- 301
Model tree for lllyx/Qwen3-4B-Base-GRPO
Base model
Qwen/Qwen3-4B-Base