Safety_Tuning-Qwen3.5-4B-Base-SFT365-GRPO-Mixture8-binary-lr1e-6-kl0.001-p15-k8-step680
Intermediate GRPO checkpoint of thkim0305-SNU/Safety_Tuning-Qwen3.5-4B-Base-SFT-Mixture8-genv2gp3-lr1e-5-step365, itself fine-tuned from Qwen/Qwen3.5-4B-Base, (snapshot ccd726d2543d) after
680 optimizer updates (Megatron iteration 679) of safety RL on the
"mixture-8" prompt set. Training is still in progress; this is a snapshot, not a final model.
Weights are bf16 Hugging Face Qwen3_5ForConditionalGeneration; the vision tower and MTP head are
the untouched base weights (only the language model was trained), so the checkpoint loads exactly like
the base model.
Training recipe
| item | value |
|---|
| algorithm | GRPO (group-normalized binary rewards), PPO clip 0.2, TIS on |
| framework | Slime (SGLang rollouts, colocated) + Megatron-LM, bf16 |
| prompts per update x rollouts per prompt | 15 x 8 = 120 sequences |
| learning rate | 1e-06 constant, AdamW betas [0.9, 0.95], weight decay 0.1, grad clip 1.0 |
| KL to the frozen start | low-variance KL loss, coefficient 0.001 |
| sampling | temperature 1.0, top-p 1, up to 32768 generated tokens, 40960 context |
| thinking | Qwen chat template with enable_thinking=true; tool rollouts use qwen3_coder function calling |
| reward | Qwen3.8-27B judge, strict binary (0/1) verdict with the project's model spec; AgentAlign prompts are judged on the whole visible tool trajectory |
| schedule | one padded epoch over 11794 unique prompts = 787 updates; checkpoints every 40 updates |
Data (mixture-8)
| dataset | prompts |
|---|
| star1_gp3 | 1000 |
| star_benign_v2 | 915 |
| agentalign_harmful | 2000 |
| agentalign_benign | 2000 |
| codesafetybench | 900 |
| magicoder | 1000 |
| difficult_advice | 1982 |
| wildjailbreak_benign | 1997 |
4000 AgentAlign prompts carry synthetic tool definitions and are rolled out as multi-turn
tool-use trajectories against a tool simulator (tool outputs are loss-masked).
Judge score during training (mean binary reward, raw before group normalization)
| window | mean score | judged rollouts |
|---|
| updates 0-10 | 0.735 | 1200 |
| updates 30-40 | 0.718 | 1200 |
| updates 70-80 | 0.813 | 1200 |
| updates 110-120 | 0.817 | 1200 |
| updates 150-160 | 0.857 | 1200 |
| updates 190-200 | 0.868 | 1200 |
| updates 230-240 | 0.857 | 1200 |
| updates 270-280 | 0.880 | 1200 |
| updates 310-320 | 0.911 | 1200 |
| updates 350-360 | 0.866 | 1200 |
| updates 390-400 | 0.904 | 1200 |
| updates 430-440 | 0.844 | 1200 |
| updates 470-480 | 0.867 | 1200 |
| updates 510-520 | 0.800 | 1200 |
| updates 550-560 | 0.893 | 1200 |
| updates 590-600 | 0.841 | 1200 |
| updates 630-640 | 0.877 | 1200 |
| updates 670-680 | 0.846 | 1200 |
| dataset | updates 0-10 | updates 30-40 | updates 70-80 | updates 110-120 | updates 150-160 | updates 190-200 | updates 230-240 | updates 270-280 | updates 310-320 | updates 350-360 | updates 390-400 | updates 430-440 | updates 470-480 | updates 510-520 | updates 550-560 | updates 590-600 | updates 630-640 | updates 670-680 |
|---|
| agentalign_benign | 0.48 | 0.49 | 0.63 | 0.69 | 0.70 | 0.71 | 0.61 | 0.71 | 0.82 | 0.62 | 0.72 | 0.66 | 0.72 | 0.67 | 0.77 | 0.60 | 0.67 | 0.69 |
| agentalign_harmful | 0.96 | 0.94 | 0.97 | 0.93 | 0.97 | 0.98 | 0.97 | 0.94 | 0.96 | 0.97 | 0.95 | 0.95 | 0.95 | 0.93 | 0.97 | 0.97 | 0.98 | 0.88 |
| codesafetybench | 0.65 | 0.89 | 0.94 | 0.86 | 0.96 | 0.95 | 0.93 | 0.95 | 0.92 | 0.96 | 0.97 | 0.93 | 0.98 | 0.91 | 0.97 | 0.98 | 0.99 | 0.91 |
| difficult_advice | 0.88 | 0.90 | 0.88 | 0.94 | 0.95 | 0.97 | 0.89 | 0.95 | 0.90 | 0.93 | 0.94 | 0.96 | 0.96 | 0.91 | 0.94 | 0.91 | 0.97 | 0.97 |
| magicoder | 0.38 | 0.26 | 0.19 | 0.47 | 0.55 | 0.56 | 0.70 | 0.71 | 0.80 | 0.76 | 0.76 | 0.49 | 0.72 | 0.54 | 0.49 | 0.57 | 0.73 | 0.59 |
| star1_gp3 | 0.77 | 0.94 | 0.97 | 0.98 | 0.97 | 1.00 | 0.99 | 0.96 | 0.99 | 0.99 | 0.95 | 0.93 | 1.00 | 0.98 | 0.99 | 1.00 | 0.95 | 0.98 |
| star_benign_v2 | 0.72 | 0.64 | 0.72 | 0.82 | 0.94 | 0.82 | 0.91 | 0.79 | 0.93 | 0.85 | 0.98 | 0.92 | 0.95 | 0.88 | 0.93 | 0.95 | 0.93 | 0.89 |
| wildjailbreak_benign | 0.68 | 0.63 | 0.79 | 0.78 | 0.81 | 0.87 | 0.86 | 0.95 | 0.90 | 0.87 | 0.91 | 0.89 | 0.80 | 0.83 | 0.93 | 0.92 | 0.89 | 0.91 |
Usage
from transformers import AutoTokenizer, Qwen3_5ForConditionalGeneration
model_id = "thkim0305-SNU/Safety_Tuning-Qwen3.5-4B-Base-SFT365-GRPO-Mixture8-binary-lr1e-6-kl0.001-p15-k8-step680"
tok = AutoTokenizer.from_pretrained(model_id)
model = Qwen3_5ForConditionalGeneration.from_pretrained(model_id, dtype="bfloat16", device_map="auto")
messages = [{"role": "user", "content": "Explain why phishing emails are dangerous."}]
text = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, enable_thinking=True)
out = model.generate(**tok(text, return_tensors="pt").to(model.device), max_new_tokens=512)
print(tok.decode(out[0], skip_special_tokens=True))
Provenance
- Run
grpo-mixture8-qwen35-sft365-lr1e6-keti-h100-0-20261124-v1 (4x H100 80GB (keti_h100_0): judge TP2 on GPUs 4-5, trainer on GPU 6 (optimizer state on CPU), rollout engine on GPU 7).
- Source checkpoint: Megatron torch_dist
iter_0000679; converted with safety_tuning.hf_export
(GDN projections re-fused, Slime Qwen3.5 name mapping, base vision/MTP weights copied, dtypes matched to the base index).
- Exported 2026-11-30T01:01:18+00:00.