Qwen3-4B-DAPO
Qwen/Qwen3-4B trained with DAPO (arXiv 2503.14476) on DAPO-Math-17k, in non-thinking mode (enable_thinking=False). Trained as a stronger teacher for on-policy distillation experiments.
Training
| Base model | Qwen/Qwen3-4B, non-thinking (chat template with an empty <think></think> block) |
| Data | DAPO-Math-17k, deduplicated: 17,917 problems (8 with prompts over 1024 tokens dropped) |
| Prompt | {problem}\nPlease reason step by step, and put your final answer within \boxed{}. |
| Epochs | exactly 3 passes over the data (138 steps; counted as data passes, not verl's step-based epochs) |
| Algorithm | DAPO: clip-higher (0.2 / 0.28), dynamic sampling (groups with all-equal accuracy dropped), token-level loss, overlong reward shaping (linear penalty over the last 2048 tokens), no KL, no entropy bonus |
| Batch | 128 prompts x 16 samples per step, mini-batch 32 prompts (4 updates per step) |
| Optimizer | AdamW, lr 1e-6 constant after 10 warmup steps, weight decay 0.1, grad clip 1.0 |
| Rollout | temperature 1.0, top-p 1.0, max response 8192 tokens |
| Reward | rule-based: Answer: line or last \boxed{} vs. ground truth (verl math_dapo) |
| Framework | verl (FSDP + vLLM), 4 x A100 80GB, ~3.5 days |
Evaluation
mean@k accuracy (%): average correctness over k samples per problem. Non-thinking, temperature 0.7, top-p 0.8, top-k 20, max_tokens 8192, scored with evalscope 1.11.1. AIME24 / AIME25 / AMC23 at k = 16, MATH-500 at k = 4.
| Model | AIME 2024 | AIME 2025 | AMC 2023 | MATH-500 |
|---|---|---|---|---|
| Qwen3-4B (non-thinking) | 20.6 | 20.6 | 64.3 | 84.3 |
| Qwen3-4B-DAPO | 45.0 | 41.0 | 85.0 | 92.4 |
Usage
Use it in non-thinking mode, as it was trained:
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("shrango/Qwen3-4B-DAPO")
model = AutoModelForCausalLM.from_pretrained("shrango/Qwen3-4B-DAPO", torch_dtype="auto", device_map="auto")
messages = [{"role": "user", "content": "What is 1+1?\nPlease reason step by step, and put your final answer within \\boxed{}."}]
text = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, enable_thinking=False)
out = model.generate(**tok(text, return_tensors="pt").to(model.device), max_new_tokens=8192)
print(tok.decode(out[0], skip_special_tokens=True))