qwen-math-0.5b

A LoRA supervised fine-tune of Qwen2.5-0.5B-Instruct that solves grade-school math word problems step by step and ends with a parseable #### <answer> line.

Trained with Apple MLX on a MacBook Air M5 (16 GB), in ~2 minutes, ~1.9 GB peak memory. Full pipeline is reproducible from mrrahman1517/apple-silicon-ml-lab.

Results

Held-out accuracy on 100 hard (3โ€“5 step) word problems:

Model Accuracy
Qwen2.5-0.5B-Instruct (base) 58%
qwen-math-0.5b (this model) 82% (+24 pts)

Runs at 215 tok/s in Ollama on an Apple M5 (0.6 GB RAM).

Files

File Use
qwen-math-Q4_K_M.gguf 4-bit GGUF (379 MB) โ€” llama.cpp / Ollama
qwen-math-f16.gguf f16 GGUF (948 MB) โ€” re-quantize as you like
Modelfile Ollama Modelfile (Qwen2.5 ChatML + math system prompt)
adapters/ the MLX LoRA adapter (use on top of the 4-bit base)

Usage

Ollama (GGUF)

huggingface-cli download <repo_id> qwen-math-Q4_K_M.gguf Modelfile --local-dir qwen-math
cd qwen-math && ollama create qwen-math -f Modelfile
ollama run qwen-math "A jacket costs $200. Take 25% off, then add 10% tax. Final price?"
# -> ... #### 165

MLX (LoRA adapter on the 4-bit base)

pip install mlx-lm
python -m mlx_lm.generate \
  --model mlx-community/Qwen2.5-0.5B-Instruct-4bit \
  --adapter-path adapters \
  --prompt "A train travels at 60 km/h for 3 hours, then 50 km/h for 2 hours. Total distance?"

Training data

Synthetic GSM8K-style problems with deterministically-correct step-by-step solutions (discount+tax, percent-of-remainder, multi-leg trips, missing-average, two-equation systems). Generator and configs in the source repo.

Limitations

It's a 0.5B model โ€” it still makes ~18% arithmetic slips on hard problems (e.g. summing a list incorrectly), and it's specialized to short numeric word problems. For general use prefer a larger base.

Base model: Qwen2.5-0.5B-Instruct (Apache-2.0).

Downloads last month
72
MLX
Hardware compatibility
Log In to add your hardware

Quantized

GGUF
Model size
0.5B params
Architecture
qwen2
Hardware compatibility
Log In to add your hardware

4-bit

16-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for mrrahman82/qwen-math-0.5b

Adapter
(708)
this model