This model is a fine-tuned version of
Qwen/Qwen3-1.7B optimized for mathematical reasoning on the GSM8K benchmark.
Note: The fine-tuned model shows significant improvement on GSM8K (+57pp) but slightly lower performance on MATH-500 compared to the base model. This is expected as the training focused on GSM8K-style problems.
1# Download and run
2ollama run hf.co/HuggingFaceTB/qwen3-1.7b-gsm8k-sft:q8_0
1# Download the GGUF file
2huggingface-cli download HuggingFaceTB/qwen3-1.7b-gsm8k-sft qwen3-1.7b-gsm8k-q8_0.gguf
3
4# Run inference
5./llama-cli -m qwen3-1.7b-gsm8k-q8_0.gguf -p "Solve: If a train travels 120 miles in 2 hours, what is its average speed?"
1SFTConfig(
2 num_train_epochs=2, # Stage 1
3 per_device_train_batch_size=8,
4 gradient_accumulation_steps=4,
5 learning_rate=2e-5, # 5e-6 for Stage 2
6 lr_scheduler_type="cosine",
7 warmup_ratio=0.03,
8 weight_decay=0.01,
9 max_length=1024,
10 packing=True,
11 bf16=True,
12 gradient_checkpointing=True,
13)
1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
3
4model = AutoModelForCausalLM.from_pretrained(
5 "HuggingFaceTB/qwen3-1.7b-gsm8k-sft",
6 torch_dtype=torch.bfloat16,
7 device_map="auto"
8)
9tokenizer = AutoTokenizer.from_pretrained("HuggingFaceTB/qwen3-1.7b-gsm8k-sft")
10
11# For math problems, the model uses chain-of-thought reasoning
12messages = [
13 {"role": "user", "content": "Natalia sold clips to 48 of her friends in April, and then she sold half as many clips in May. How many clips did Natalia sell altogether in April and May?"}
14]
15
16text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
17inputs = tokenizer(text, return_tensors="pt").to(model.device)
18outputs = model.generate(**inputs, max_new_tokens=1024, do_sample=False)
19print(tokenizer.decode(outputs[0], skip_special_tokens=True))
1@misc{qwen3-gsm8k-sft,
2 title={Qwen3-1.7B Fine-tuned for GSM8K},
3 author={HuggingFaceTB},
4 year={2026},
5 publisher={Hugging Face},
6 url={https://huggingface.co/HuggingFaceTB/qwen3-1.7b-gsm8k-sft}
7}
This model inherits the license from the base model
Qwen/Qwen3-1.7B (Apache 2.0).