CoolFace
Modelpublic

saadxsalman/Q-SS-0.5B-Reasoning-Math-GGUF

sourceHugging Faceapache-2.0updated 5mo agoView on Hugging Face
0likes77downloads
Model Card

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

PropertyDetails
Model NameQ-SS-0.5B-Reasoning-Math-GGUF
Base ModelQwen/Qwen2.5-0.5B-Instruct
Parameters500M
QuantizationQ4KM
File Size~300MB
Training MethodSFT Warm-up + GRPO Reinforcement Learning
Trained OnGSM8K + OpenR1-Math-220k
LicenseApache 2.0
DeveloperSaad Salman

๐Ÿ’ฌ 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

bash
# 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

bash
ollama run hf.co/saadxsalman/Q-SS-0.5B-Reasoning-Math-GGUF

Python with llama-cpp-python

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

Problem TypeSupport
Basic arithmeticโœ… Reliable
Multi-step word problemsโœ… Reliable
Problems with units and currencyโœ… Reliable
Basic algebraโš ๏ธ Partial
Competition math (AMC/AIME)โŒ Beyond capacity

๐Ÿ–ฅ๏ธ Performance on CPU

HardwareEstimated Speed
Modern laptop (8-core)~5โ€“10 tokens/sec
Desktop (16-core)~15โ€“20 tokens/sec
Apple Silicon (M1/M2/M3)~20โ€“30 tokens/sec
Raspberry Pi 4~1โ€“2 tokens/sec

Speeds are approximate and depend on system load and memory bandwidth.


๐Ÿ“ฆ Related Models

RepoFormatSizeBest For
Q-SS-0.5B-Reasoning-MathFP16~988MBGPU inference & further fine-tuning
Q-SS-0.5B-Reasoning-Math-GGUFQ4KM~300MBLocal CPU inference

โš ๏ธ 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

bibtex
@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}},
}