--- license: apache-2.0 base_model: Qwen/Qwen3-4B-Base library_name: transformers pipeline_tag: text-generation tags: [qwen3, math, reasoning, long-cot, thinking, sft, distillation] language: [en] --- # Qwen3-4B-MathThink-Distill Four **Qwen3-4B-Base** models fine-tuned to solve math problems with long step-by-step reasoning, one per source of reasoning traces. Each model thinks inside a ` … ` block and then writes a final answer with `\boxed{}`. Each folder is a complete model. ## Models and results Accuracy in %: thinking mode, temperature 0.6, top-p 0.95, top-k 20, 16,384-token budget, strict answer matching (a response cut off before the answer counts as wrong). AIME is avg@32, GPQA Diamond is avg@4. | Folder | Source of reasoning traces | AIME 2025 | AIME 2026 | GPQA Diamond | |---|---|---|---|---| | `deepseek-r1` | DeepSeek-R1 (OpenR1-Math-220k) | 19.8 | 20.6 | 26.5 | | `qwen3.8-27b` | Qwen3.8-27B | 8.0 | 7.8 | 24.5 | | `gemma-4-26b-a4b` | Gemma 4 26B-A4B | 8.0 | 8.3 | 6.9 | | `inkling-2-mini` | Inkling 2 Mini | 8.0 | 5.1 | 16.5 | ## Training - Data: 5,314 verified-correct math traces per model. - Full fine-tuning, 5 epochs (final checkpoint, step 830), batch size 32, learning rate 2e-5, sequence length up to 16k. - Trainable weights were stored in bfloat16 during training, so many small updates were rounded away. Treat these models as a lower-precision training baseline. - Prompt suffix: `Please reason step by step, and put your final answer within \boxed{}.` - End-of-sequence token set to `<|im_end|>`. ## Usage ```python from transformers import AutoModelForCausalLM, AutoTokenizer repo, sub = "96kevinli29/Qwen3-4B-MathThink-Distill", "deepseek-r1" tok = AutoTokenizer.from_pretrained(repo, subfolder=sub) model = AutoModelForCausalLM.from_pretrained(repo, subfolder=sub, torch_dtype="bfloat16", device_map="auto") ``` For vLLM, download one folder and pass its local path. ## Limitations Many responses to hard problems reach the token budget before answering, and some get stuck repeating themselves. Math-only training; not tuned for chat safety or tool use. The traces come from third-party models; check their terms for your use.