ZR1-1.5B is a small reasoning model trained extensively on both verified coding and mathematics problems with reinforcement learning. The model outperforms Llama-3.1-70B-Instruct on hard coding tasks and improves upon the base R1-Distill-1.5B model by over 50%, while achieving strong scores on math evaluations and a 37.91% pass@1 accuracy on GPQA-Diamond with just 1.5B parameters.
For training we utilized the PRIME Eurus-2-RL dataset which combines the following math and code datasets:
NuminaMath-CoT
APPS, CodeContests, TACO, and Codeforces train set
We filtered math data by validating that questions are correctly graded when calling the evaluator with reference ground truth, and we removed all code examples with an empty list of test cases. Our final dataset comprised roughly 400k math + 25k code samples.
We employ PRIME (Process Reinforcement through IMplicit rEwards), an online RL algorithm with process rewards, motivated by the improvement over GPRO demonstrated in the paper, as well as potentially more accurate token-level rewards due to the learned process reward model. We used the training batch accuracy filtering method from PRIME for training stability, and the iterative context lengthening technique demonstrated in DeepScaleR for faster training, which has also been shown to improve token efficiency. After a warmup period with maximum generation length set to 12k tokens, we sequentially increased the maximum generation length during training, starting at 8k tokens before increasing to 16k and 24k.
We trained on a single 8xH100 node with the following specific algorithmic details.
PRIME + RLOO with token-level granularity
No <think> token prefill. 0.1 format reward/penalty
Main train batch size 256 with n=4 samples per prompt. veRL dynamic batch size with max batch size set per GPU to support training with large generation length
Max prompt length 1536, generation length increase over training. Started with 12k intended to ease model into shorter generation length training
12384 -> 8192 -> 16384 -> 24448
Start with 1 PPO epoch, increase to 4 during 24k stage
Accuracy filtering 0.2-0.8 and relax to 0.01-0.99 during 24k stage
Our direct answer system prompt was: “Give a direct answer without thinking first.”
The table reports the average greedy pass@1 score across the following math evals: AIME24, AIME25, AMC22\_23, AMC24, GPQA-Diamond, MATH-500, MinervaMath, OlympiadBench
avg pass@1
max\_tokens
ZR1-1.5B
51.13%
32768
ZR1-1.5B (truncated)
46.83%
4096
ZR1-1.5B (direct answer prompt)
45.38%
4096
ZR1-1.5B (truncated)
40.39%
2048
ZR1-1.5B (direct answer prompt)
37%
2048
Qwen-2.5-Math-1.5B-Instruct
32.25%
2048
Qwen-2.5-Math-7B-Instruct
37.01%
2048
For Leetcode and LiveBench, we report pass@1 accuracy with greedy sampling. For the rest of the evaluations we report pass@1 accuracy averaged over 16 samples per question, with temperature 0.6 and top_p 0.95.
import os
os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com"
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("Zyphra/ZR1-1.5B", revision="6108a26d0cd7f378704e281ee4d842c4a055cb4a")
model = AutoModelForCausalLM.from_pretrained("Zyphra/ZR1-1.5B", revision="6108a26d0cd7f378704e281ee4d842c4a055cb4a", device_map="auto")