CoolFace
Modelpublic

zbeeb/Qwen2.5-Math-7B-GRPO-Staleness-4

sourceHugging Faceapache-2.0updated 2d agoView on Hugging Face
0likes106downloads
Model Card

Qwen2.5-Math-7B-GRPO-Staleness-4

Final step-1000 full-parameter GRPO checkpoint of Qwen/Qwen2.5-Math-7B, trained on the shared 17,005-row DAPO math dataset.

Training

Staleness cap: 4 (max_off_policy_steps). This limits rollout policy age during training, not decoding length. The original segment used four trainer GPUs and one inference GPU. Recovery from step 850 changed to eight trainer GPUs and one inference GPU. The final job resumed full model, optimizer, scheduler and progress state from step 925 and reached step 1000. The final training job was 2142283 on deep-chungus-3. This is a recovered trajectory, not a bitwise continuation across the topology change. The model started from the pinned base model with fresh optimizer state; higher-cap runs are not continuations of lower-cap models.

PrimeRL v0.9.0; 1,000 updates; batch size 64; group size 8; seed 42; AdamW learning rate 1e-6; 30 warmup updates; PPO clip 0.2; no reference KL penalty. Training uses a 4,096-token total context and up to 3,072 completion tokens. The deterministic reward scores mathematical equivalence of the terminal answer. See training-config.json. GPU topology varies across some arms, so comparisons are not pure staleness ablations.

Export and stopping

Full saved-dtype model weights are exported losslessly to sharded Safetensors. Export checks include step-1000 provenance, finite tensors, strict reload, tied embeddings, tokenizer round-trip, and identical CPU probe logits before and after serialization. Optimizer state remains in the source checkpoint. See export-manifest.json.

The training tokenizer identifies <|im_end|> (151645) as EOS. For inference compatibility, generation_config.json stops on both 151645 and <|endoftext|> (151643). Model weights and tokenizer are unchanged by this stopping configuration. Use explicit stop IDs if your serving engine ignores the generation configuration. The native positional configuration is preserved. No 8K benchmark result is claimed by this release.

Usage

python
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = 'zbeeb/Qwen2.5-Math-7B-GRPO-Staleness-4'
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, dtype=torch.bfloat16, device_map="auto")
messages = [{'role': 'user', 'content': 'Solve the following math problem. Explain your reasoning. End with either \\boxed{...} or a final line `Final answer: ...`.\n\nCompute 2 + 2.'}]
inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt", return_dict=True).to(model.device)
assert inputs["input_ids"].shape[-1] <= 1024
output = model.generate(**inputs, max_new_tokens=3072, do_sample=False, eos_token_id=[151645, 151643], pad_token_id=tokenizer.pad_token_id)
print(tokenizer.decode(output[0, inputs["input_ids"].shape[-1]:], skip_special_tokens=True))

Final training-run evaluations

Scores use final policy 1000. Greedy rows use one completion per question. Sampled rows use eight completions per question at temperature 0.6 and report mean answer accuracy, not pass@8. MATH500, AMC and AIME use 3,072 output tokens; Minerva and OlympiadBench use 2,048. All nine final sets have zero recorded evaluation errors. These are training-run results, not a fresh benchmark of the exported artifact or an 8K comparison.

BenchmarkCompletionsAccuracyTruncated
aime24-pass13030.00%10.00%
aime24-sampled24024.17%12.08%
aime25-pass13016.67%13.33%
aime25-sampled24011.67%14.58%
aime26-sampled24013.75%9.58%
amc23-pass14057.50%5.00%
math500-pass150074.60%1.80%
minerva-pass127226.84%1.10%
olympiadbench-pass167538.52%7.26%

Machine-readable results and dataset revisions: evaluation-results.json. Training data was filtered against these evaluations; this does not establish absence of pretraining contamination or all near-duplicates.

Completion and recovery provenance

Training job 2142283 completed successfully with exit 0:0. The combined parent and recovery history audit passed for steps 1 through 1000, including the staleness cap, final checkpoint, and nine final evaluation sets. The release verifies that the completion report, checkpoint metadata, checkpoint file sizes and timestamps, metrics, and training manifest still match that evidence. The recorded history audit excludes one checksum-pinned malformed metrics record; original logs are preserved. See completion-verification.json.

License

The upstream base-model license is included unchanged in LICENSE. This checkpoint is a GRPO modification of the cited base revision.