Downloads · 30 days
525
19% of all-time downloads
HAD653/qwen3-1.7b-magistral-math-gguf
qwen3-1.7b-magistral-math-gguf is a text generation model from HAD653. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
[](https://www.apache.org/licenses/LICENSE-2.0)
Downloads · 30 days
525
19% of all-time downloads
All-time downloads
2.7K
Public
Repo size
6.4 GB
Likes
1
Public
Click a slice to open those files.
.gguf6.4 GB · 100%
From the Hugging Face model README
This is a math-focused fine-tune of unsloth/Qwen3-1.7B-Base,
exported to GGUF (F16 / Q8_0 / Q4_K_M) with Unsloth.
Goal: small 1.7B model specialized for grade-school & early high-school math reasoning.
Data: HAD653/GSM8K-OpenMath-MathReason-13k – 13.9k math word problems with structured chain-of-thought.
Format: answers always follow the same pattern:
Problem:
...
Reasoning:
...
Answer:
<final numeric answer>
unsloth/Qwen3-1.7B-Base (Apache-2.0)From the Files tab:
Qwen3-1.7B-Magistral-Math-F16.gguf – highest quality, requires the most VRAM.Qwen3-1.7B-Magistral-Math-Q8_0.gguf – 8-bit quantization.Qwen3-1.7B-Magistral-Math-Q4_K_M.gguf – 4-bit K-quant, best for smaller GPUs.These files contain fine-tuned math weights, exported via
model.save_pretrained_ggufafter full BF16 training.
This model is fine-tuned on:
Dataset: HAD653/GSM8K-OpenMath-MathReason-13k
Size: 13,857 examples.
Fields:
question: natural language math word problem.
cot: structured solution with three blocks:
Problem:Reasoning:Answer:final_answer: canonical numeric answer (string).
The dataset focuses on easy–medium difficulty: basic arithmetic, fractions, percentages, rate problems, simple algebra, and simple combinatorics – the kind of tasks a 1–3B model can genuinely master.
Fine-tuning was done with Unsloth + TRL on a single RTX 4090, using full BF16 fine-tuning (no LoRA).
Main hyperparameters:
Base: unsloth/Qwen3-1.7B-Base
Sequence length: 2048
Batching: per_device_train_batch_size = 2, gradient_accumulation_steps = 8
Effective batch size: ≈ 16 sequences
Epochs: 2
Optimizer / schedule:
learning_rate = 7e-5warmup_ratio = 0.05weight_decay = 0.01Precision & memory:
dtype = bfloat16gradient_checkpointing = TrueThe training text for each sample is:
### Instruction:
{question}
### Response:
{cot}</s>
where </s> is the tokenizer EOS token.
Adding eos_token at the end of each sample teaches the model when to stop, which greatly reduces “Answer: 36 / Answer: 36 / …” loops during inference.
You are a math reasoning assistant.
For every question, answer in exactly this format:
Problem:
<restate the problem in your own words>
Reasoning:
<step-by-step reasoning showing all intermediate steps>
Answer:
<final numeric answer only, on its own line>
Do not add any extra commentary before or after the answer.
Do not repeat the answer multiple times.
Stop after writing the final answer.
Single-turn format:
### Instruction:
{question}
### Response:
The model will then generate:
Problem:
...
Reasoning:
...
Answer:
<number>
On top of the EOS token, you can add stop strings in your UI:
### Instruction:### Response:Many frontends (LM Studio, text-generation-webui, KoboldCpp, etc.) let you configure these so the model stops cleanly when it tries to start the next turn.
The three variants in this repo roughly behave as follows (ballpark):
Q4_K_M (~1.1 GB) – best for:
Q8_0 (~1.8 GB) – good compromise:
F16 (~3.5 GB) – highest fidelity:
As a rule of thumb, choose a file that is 1–2 GB smaller than your available VRAM.
Once you have built llama.cpp, you can run the model like this (replace with your path):
./llama-cli \
-m Qwen3-1.7B-Magistral-Math-Q4_K_M.gguf \
-p "### Instruction:
Albert buys 2 large pizzas and 2 small pizzas. A large pizza has 16 slices and a small pizza has 8 slices. If he eats it all, how many pieces does he eat that day?
### Response:
" \
-n 256 \
--temp 0.1 \
--top-p 0.9 \
--repeat-penalty 1.05
Suggested decoding for math:
temperature: 0.0–0.2top_p: 0.9repeat_penalty: 1.05–1.1top_k: 20–40 (optional tweak)Set the prompt template to:
### Instruction:
{{prompt}}
### Response:
Add stop strings:
### Instruction:### Response:and keep temperature low for math benchmarks.
Users are responsible for ensuring there is no data leakage if they evaluate on GSM8K/OpenMath-derived benchmarks.
HAD653/GSM8K-OpenMath-MathReason-13k.If you use this model in your work, please cite:
@misc{had653_qwen3_magistral_math_gguf_2025,
author = {HAD653},
title = {Qwen3-1.7B Magistral Math (GGUF): A 1.7B Math Reasoning Model with Magistral Chain-of-Thought},
year = {2025},
howpublished = {\url{https://huggingface.co/HAD653/qwen3-1.7b-magistral-math-gguf}},
note = {Fine-tuned on GSM8K + OpenMath MathReason 13k, exported to GGUF (F16 / Q8\_0 / Q4\_K\_M).}
}