Qwen3-4B-R1-Distill

A Qwen3-4B-Base model fine-tuned (full-parameter SFT) to solve math problems with long step-by-step reasoning. The model thinks inside a <think> … </think> block and then writes a final answer with \boxed{}.

Training

  • Data: 5,585 math problems with long reasoning traces from DeepSeek-R1 (OpenR1-Math-220k), filtered to verified-correct traces.
  • Format: Qwen chat template; assistant turn = <think>\n…\n</think>\n\n + final solution. Prompt suffix: Please reason step by step, and put your final answer within \boxed{}.
  • Full fine-tuning, 5 epochs, batch size 32, learning rate 2e-5, sequence length up to 16k.
  • End-of-sequence token set to <|im_end|>.

Usage (vLLM)

from vllm import LLM, SamplingParams
llm = LLM("96kevinli29/Qwen3-4B-R1-Distill", max_model_len=20480)
q = "Find the remainder when 2^100 is divided by 7."
msgs = [{"role": "user", "content": q + "\n\nPlease reason step by step, and put your final answer within \\boxed{}."}]
sp = SamplingParams(temperature=0.6, top_p=0.95, top_k=20, max_tokens=16384, stop=["<|im_end|>", "<|endoftext|>"])
print(llm.chat(msgs, sp)[0].outputs[0].text)

Evaluation

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). Accuracy in %.

Evaluated checkpoint: the root weights (epoch 5, step 870). Intermediate checkpoints are not benchmark-evaluated.

Benchmark This model Qwen3-4B-Base
AIME 2025 (avg@32) 22.4 –
AIME 2026 (avg@32) 19.2 6.9
AMC 2025 (avg@32) 53.6 32.5
MATH-500 (avg@8) 81.1 69.3
GPQA Diamond (avg@4) 27.0 –

Checkpoints

  • Root: final checkpoint (epoch 5, step 870).
  • intermediate/epochK_stepN/: earlier checkpoints, kept as-is.

Variants

variants/b … variants/e hold four more models trained the same way (same base, same problems, same schedule) on differently preprocessed versions of the same traces. Each has its own intermediate/ checkpoints. Load with subfolder="variants/b" in transformers, or download the folder for vLLM.

Folder AIME 2025 AIME 2026 AMC 2025 MATH-500 GPQA Diamond
variants/b 20.9 20.6 50.6 80.5 26.9
variants/c 20.1 20.7 55.3 82.8 23.6
variants/d 20.1 19.7 52.6 81.7 26.1
variants/e 20.6 19.4 49.8 80.1 24.9

Limitations

A 4B model with long outputs: many hard-problem responses hit the 16k budget before answering. Math-only training; not tuned for chat safety or tool use.

Downloads last month
514
Safetensors
Model size
4B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for 96kevinli29/Qwen3-4B-R1-Distill

Finetuned
(565)
this model