Safety_Tuning-Qwen3.5-4B-Base-GRPO-Mixture8-binary-lr1e-6-kl0.001-p15-k8-step80
Intermediate GRPO checkpoint of Qwen/Qwen3.5-4B-Base (snapshot 1001bb4d826a) after
80 optimizer updates (Megatron iteration 79) 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 80 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.417 | 1200 |
| updates 70-80 | 0.578 | 1200 |
| updates 150-160 | 0.708 | 1200 |
| dataset | updates 0-10 | updates 70-80 | updates 150-160 |
|---|
| agentalign_benign | 0.41 | 0.48 | 0.60 |
| agentalign_harmful | 0.63 | 0.88 | 0.94 |
| codesafetybench | 0.47 | 0.78 | 0.80 |
| difficult_advice | 0.28 | 0.30 | 0.69 |
| magicoder | 0.51 | 0.34 | 0.38 |
| star1_gp3 | 0.57 | 0.78 | 0.82 |
| star_benign_v2 | 0.27 | 0.54 | 0.83 |
| wildjailbreak_benign | 0.27 | 0.45 | 0.61 |
Usage
from transformers import AutoTokenizer, Qwen3_5ForConditionalGeneration
model_id = "thkim0305-SNU/Safety_Tuning-Qwen3.5-4B-Base-GRPO-Mixture8-binary-lr1e-6-kl0.001-p15-k8-step80"
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-qwen35base4b-b200-20261117-v3 (two B200 GPUs: judge on GPU 0, trainer and rollout engine on GPU 1).
- Source checkpoint: Megatron torch_dist
iter_0000079; 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-18T00:48:02+00:00.