Qwen3-8B-RL2R
math reasoning model with RL2R
2 min readupdated
This LLM (large language model) is built on Qwen/Qwen3-8B using R1-Zero-style reinforcement learning via RL2R (Reinforcement Learning with Reference-Based Rewards). Instead of simple binary answer checking, the algorithm considers semantic similarity to reference solutions at both the answer and step levels, providing dense feedback on complex tasks. The model significantly outperforms the base version on math benchmarks (such as MATH500 and AMC) and is well-suited for researchers and developers of automated problem-solving systems.
Key features
- RL2R training with rewards based on semantic proximity to the reference.
- Base Qwen3 architecture with a size of 8.19 billion parameters.
- Significant accuracy gains on olympiads and math tests.
- Support for the transformers framework and response generation via vLLM.
What you can do
- Solve complex math problems and olympiad examples (AIME, AMC, MATH500).
- Integrate the model into educational AI assistants and tutoring bots.
- Analyze step-by-step logical reasoning with answers formatted in
\boxed{}.
Example
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "mzhaoshuai/Qwen3-8B-RL2R"
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="bfloat16", device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(model_id)
problem = "Let $a$ and $b$ be positive real numbers such that $a + b = 1.$ Find the minimum value of $\frac{1}{a} + \frac{1}{b}.$"
prompt = (
"<|im_start|>user\n"
f"Question: {problem}\n"
"Please reason step by step, and put your final answer within \\boxed{}.<|im_end|>\n"
"<|im_start|>assistant\n"
)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
output = model.generate(**inputs, max_new_tokens=3072, do_sample=False)
response = tokenizer.decode(output[0][inputs.input_ids.shape[1]:], skip_special_tokens=True)
print(response)
Read more
DetailsAverage benchmark accuracy increased from 20.2% (base) to 60.9%.
The MATH500 result is 91.2% (greedy decoding) and up to 97.0% (pass@16).
Training was conducted on 8,523 math problems using Dr. GRPO and bf16.










Comments