saadxsalman/Q-SS-0.5B-Reasoning-Math-GGUF
077
Q-SS-0.5B-Reasoning-Math-GGUF
The same structured math reasoning model โ quantized and ready for instant local CPU inference.
Q-SS-0.5B-Reasoning-Math-GGUF is the quantized GGUF version of Q-SS-0.5B-Reasoning-Math, a fine-tuned Qwen/Qwen2.5-0.5B-Instruct trained with GRPO reinforcement learning on mathematical reasoning tasks. At just ~300MB with Q4KM quantization, it runs instantly on any CPU with no GPU required.
๐ง Want the full precision model for GPU or fine-tuning? See Q-SS-0.5B-Reasoning-Math.
โจ Highlights
- โก Instant CPU inference โ ~300MB Q4KM, runs on any machine
- ๐ง Thinks out loud โ explicit step-by-step reasoning inside
<thought>tags - ๐ฏ Clean structured output โ final answer always isolated in
<answer>tags - ๐ฅ๏ธ No GPU required โ perfect for local, offline, and edge deployments
- ๐ Apache 2.0 โ free for personal and commercial use
๐ Model Details
๐ฌ Output Format
Every response follows this strict structure:
<thought>
[Step-by-step reasoning and calculations]
</thought>
<answer>
[Final numerical answer only]
</answer>๐ Quick Start
llama.cpp
# Download the model
huggingface-cli download saadxsalman/Q-SS-0.5B-Reasoning-Math-GGUF \\
--local-dir ./Q-SS-0.5B-Reasoning-Math-GGUF
# Run inference
./llama-cli \\
-m Q-SS-0.5B-Reasoning-Math-GGUF/model-q4_k_m.gguf \\
--temp 0.1 \\
-n 384 \\
-p "You are a mathematical reasoning engine. Solve the problem step-by-step inside <thought> tags, then give ONLY the final answer inside <answer> tags.\\n\\nProblem: Janet has 3 cats. Each cat eats 2 cans per day. How many cans for 7 days?"Ollama
ollama run hf.co/saadxsalman/Q-SS-0.5B-Reasoning-Math-GGUFPython with llama-cpp-python
from llama_cpp import Llama
llm = Llama(
model_path = "./Q-SS-0.5B-Reasoning-Math-GGUF/model-q4_k_m.gguf",
n_ctx = 2048,
n_threads = 4,
)
SYSTEM_PROMPT = \"\"\"You are a mathematical reasoning engine.
Solve the problem step-by-step inside <thought> tags, then give ONLY the
final numerical or LaTeX result inside <answer> tags.
<thought>
[Your internal reasoning and calculations here]
</thought>
<answer>
[Final answer only]
</answer>\"\"\"
def solve(problem):
response = llm.create_chat_completion(
messages = [
{"role": "system", "content": SYSTEM_PROMPT},
{"role": "user", "content": problem},
],
max_tokens = 384,
temperature = 0.1,
)
answer = response["choices"][0]["message"]["content"]
if "<answer>" in answer:
return answer.split("<answer>")[-1].split("</answer>")[0].strip()
return answer
print(solve("Janet has 3 cats. Each cat eats 2 cans of food per day. How many cans does she need for 7 days?"))
# Output: 42๐ Example Outputs
Problem: Janet has 3 cats. Each cat eats 2 cans of food per day. How many cans does she need for 7 days?
<thought>
Each cat eats 2 cans per day.
Janet has 3 cats, so they eat 3 ร 2 = 6 cans per day together.
For 7 days: 6 ร 7 = 42 cans total.
</thought>
<answer>
42
</answer>Problem: Tom has $50. He buys a book for $12 and a pen for $3. How much money does he have left?
<thought>
Tom starts with $50.
He spends $12 on a book and $3 on a pen.
Total spent: 12 + 3 = $15.
Money remaining: 50 - 15 = $35.
</thought>
<answer>
35
</answer>โ What It's Good At
๐ฅ๏ธ Performance on CPU
Speeds are approximate and depend on system load and memory bandwidth.
๐ฆ Related Models
โ ๏ธ Limitations
- Optimized for English language math problems only
- Complex abstract reasoning, geometry, and calculus are beyond reliable capacity at 0.5B scale
- Q4KM quantization introduces minor precision loss vs full FP16 โ negligible for most use cases
- Always verify critical calculations โ the model may occasionally produce confident but incorrect answers
๐ Acknowledgements
- Unsloth โ efficient fine-tuning framework
- Qwen Team โ Qwen2.5-0.5B-Instruct base model
- HuggingFace TRL โ GRPO implementation
- llama.cpp โ GGUF conversion and inference
- OpenR1 โ OpenR1-Math-220k dataset
- OpenAI โ GSM8K dataset
๐ Citation
@misc{qss-reasoning-math-gguf-2025,
author = {Saad Salman},
title = {Q-SS-0.5B-Reasoning-Math-GGUF},
year = {2025},
publisher = {HuggingFace},
howpublished = {\\url{https://huggingface.co/saadxsalman/Q-SS-0.5B-Reasoning-Math-GGUF}},
}