CoolFace
Apppublic

oddadmix/Nawah-Math-Reasoning-Demo

sourceHugging Faceupdated 25d agoView on Hugging Face
0likes
App README

Nawah-Math-Reasoning — Demo

A 51.8M-parameter Arabic math reasoning model. It writes its derivation inside <think>…</think> and then gives the final answer; the demo splits the two live as it streams — the reasoning trace in one panel, the answer in the other.

Fine-tuned from `oddadmix/50M-2048-Emhotob`, a Llama-architecture base pre-trained from scratch on ~20B Arabic tokens (12 layers, hidden 512, 2048 context).

بالعربية: نموذج عربي صغير (~52 مليون معامل) يكتب خطوات تفكيره داخل وسم <think> ثم يعطي الإجابة النهائية. الديمو بيفصل الاتنين وانت بتتفرج على النموذج وهو بيكتب.

Everything is open — Apache 2.0

🧠 Model`oddadmix/Nawah-Math-Reasoning`
🛠️ Training code`code/` — data generation, translation, SFT, eval, GRPO
📚 Synthetic corpus`oddadmix/arabic-math-reasoning-synth` — 120,462 arithmetically verified rows
📚 Translated corpus`oddadmix/gsm8k-reasoning-ar` — 142,969 rows

Results

Number agreement, greedy decoding, on held-out splits. Every version of the model was scored on identical rows, so the numbers are comparable across the whole development ladder.

eval setnscore
GSM8K-ar60079.0%
Arabic_Reasoning40073.0%
synthetic math100040.4%
synthetic relational40052.2%

The last row is what this release adds: problems where the difficulty is the relation between quantities (ضعف, نصف, أكثر بـ…) rather than the arithmetic. The previous version scored 34.0% there — the relation appeared in barely 1.3% of the training corpus, so 20,139 rows were generated specifically to fill the gap.

Limitations

A 52M proof of concept. It reliably produces the shape of Arabic step-by-step reasoning, but arithmetic errors are the dominant failure mode — the derivation is usually structurally right, one computation is wrong, and the model then stays faithful to its own bad number. The 40.4% and 52.2% above are the honest ceiling on multi-step problems. Single-turn only; open-ended and non-mathematical questions are out of distribution.

نموذج تجريبي: بيعرف يمشي خطوة خطوة بالعربي، بس بيغلط في الحساب كتير.

Runs on ZeroGPU. The model is small enough for CPU too — switch the Space to cpu-basic and it still works, just slower.

Configuration

VariablePurpose
MODEL_IDModel repo to load (default oddadmix/Nawah-Math-Reasoning)
MODEL_HF_TOKENOnly needed if MODEL_ID points at a private repo. (HF_TOKEN is reserved by Spaces and does not reach the container.)