qwen3-0.6b-reasoning-sft

Full-parameter supervised fine-tune of Qwen/Qwen3-0.6B on Kenshiii/minimax-m3-reasoning-traces (data/chat.jsonl).

Model details

Base model Qwen/Qwen3-0.6B @ c1899de289a04d12100db370d81485cdf75e47ca
Method Full fine-tuning (TRL SFTTrainer)
Parameters 596,049,920 total, 596,049,920 trained
Precision fp32 master weights, bfloat16 autocast
Training sequence length 2048 tokens
Chat template Qwen3 template, unchanged
Reasoning format Qwen3 native <think>…</think> block, followed by the final answer

Training data

  • Source: Kenshiii/minimax-m3-reasoning-traces @ 157ed14aecdb6e0fa0a09ea5981b45048cca2f3d, file data/chat.jsonl (single file; the other files in the repo are re-formattings of the same traces).
  • Format: system + user → assistant turn with the dataset's <thinking> trace mapped to Qwen3's reasoning_content (rendered as <think>), then the final answer. Loss on assistant tokens only.
  • Split (seed 42, domain-stratified, near-duplicate prompts grouped at 5-gram Jaccard ≥ 0.8): train 847 / validation 106 / test 106.
  • Truncation: 17 training examples exceeded 2048 tokens; the end of the reasoning trace was shortened, the final answer kept.

Training procedure

Hyperparameter Value
Epochs (max) 3
Learning rate 2e-05
LR scheduler cosine, warmup ratio 0.05
Weight decay 0.01
Max grad norm 1.0
Effective batch size 16 (1 × 16 accumulation)
Optimizer adamw_torch_fused
Gradient checkpointing True
Checkpoint selection lowest validation loss
Early stopping patience 3 evaluations (every 10 steps)
Seed 42
  • Steps: 80 (1.51 epochs), time 10.4 min, peak memory 13.6 GB.
  • Best validation loss: 1.0698 (checkpoint-40); final logged train loss: 0.8242.
  • Hardware: NVIDIA GeForce RTX 5060 Ti; CUDA 12.8.

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "thealper2/qwen3-0.6b-reasoning-sft"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, dtype="auto", device_map="auto")

messages = [
    {"role": "system", "content": "You are a careful, step-by-step reasoner. For each problem, think through it methodically, then give a final answer."},
    {"role": "user", "content": "Solve x^2 - 7x + 12 = 0 and verify both roots."},
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
output = model.generate(**inputs, max_new_tokens=2048)
print(tokenizer.decode(output[0, inputs.input_ids.shape[1]:], skip_special_tokens=True))

The model writes its trace inside <think>…</think> and the final answer after </think>. It was trained with the system prompt shown above.

Framework versions

  • transformers: 5.17.0
  • trl: 0.24.0
  • torch: 2.11.0+cu128
  • datasets: 4.3.0
  • accelerate: 1.12.0
Downloads last month
44
Safetensors
Model size
0.6B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for thealper2/qwen3-0.6b-reasoning-sft

Finetuned
Qwen/Qwen3-0.6B
Finetuned
(1305)
this model

Dataset used to train thealper2/qwen3-0.6b-reasoning-sft