/ Модель

Характеристики

Контекст
2 048 токенов
Параметры
51,8 млн
Лицензия
Apache 2.0
Архитектура
llama · dense
Базовая модель
50M-2048-Emhotob
Библиотека
transformers
Опубликована
28 авг 2026

Nawah-Math-Reasoning

Генерация текстаТекст → текст3 профессии

Компактная дообученная модель Llama для решения математических задач на арабском языке с пошаговым выводом и итоговым ответом.

160скачиваний за 30 дней2лайкавеса обновлены28 авг 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Nawah-Math-Reasoning — модель на арабском языке для решения математических задач с пошаговым выводом рассуждения и итоговым ответом. Её разработчик дообучил с нуля обученную базовую модель oddadmix/50M-2048-Emhotob с архитектурой Llama; в модели 51,8 млн параметров, контекст — 2048 токенов. Она предназначена для генерации ответов на арифметические и многошаговые задачи, в том числе задачи на отношения между величинами. Модель компактна и, согласно карточке, может работать на CPU.

В опубликованных оценках точность составила 79% на GSM8K-ar, 73% на Arabic_Reasoning и 40,4% на синтетическом наборе математических задач. Модель лучше справляется с узкими формулировками GSM8K-ar, чем с разнообразными синтетическими задачами; вычислительные ошибки могут испортить правильную структуру решения. Обучающие данные преимущественно на современном литературном арабском (MSA), а трасса рассуждений не обязательно отражает внутренний ход вычислений модели. Лицензия — Apache-2.0.

Сценарии применения

  • решение арифметических задач на арабском языке
  • пошаговые ответы на школьные текстовые задачи
  • решение задач GSM8K на арабском языке
  • задачи на сравнение и отношения между величинами
  • эксперименты с небольшими арабоязычными моделями рассуждения

Ограничения

Это proof of concept с заметно более низкой точностью на синтетических многошаговых задачах, чем на GSM8K-ar; отдельный шаг вычисления может быть неверным. Данные ориентированы на MSA и имеют ограничения качества, а README предупреждает не применять модель в consequential-сценариях.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Nawah-Math-Reasoning — نموذج استدلال رياضي عربي

A 51.8M-parameter Arabic math reasoning model. It writes its derivation step by step inside <think>…</think>, then gives the answer. It is small enough to run on a CPU.

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

🤗 Demooddadmix/Nawah-Math-Reasoning-Demo
🧩 Base modeloddadmix/50M-2048-Emhotob — Llama architecture, 12 layers, hidden 512, 2048 ctx, pre-trained from scratch on ~20B Arabic tokens
📚 Dataarabic-math-reasoning-synth · gsm8k-reasoning-ar · Arabic_Reasoning_Dataset
🛠️ Training codecode/ in this repo — data generation, translation, SFT, eval, GRPO
🔤 Vocab32004 (4 chat/reasoning tokens added to the 32000 base vocab)

Results

Number agreement, greedy decoding. Every cell is measured on identical held-out rows. The Arabic_Reasoning and GSM8K-ar rows are the eval splits fixed at the start of the project and never re-drawn; the synthetic rows are pinned to the same 1,000 items every earlier version was scored on.

The v3 / v4 / v5 columns are internal development runs, kept here because they are what makes the release number mean something. They are not published — the numbers are, so the ablation is readable without them.

eval setnv3v4v5release
GSM8K-ar60077.3%19.5%76.0%79.0%
Arabic_Reasoning40065.8%50.2%75.2%73.0%
synthetic math10002.0%35.6%39.1%40.4%
synthetic relational400——34.0%52.2%

The relational row is what this release adds. On problems whose difficulty is the relation between quantities (ضعف, نصف, أكثر بـ…) rather than the arithmetic, it scores 52.2% where the previous run scores 34.0% — a +18.2 point gain and the largest single-cell move anywhere in the development ladder. It did not cost the other distributions: GSM8K-ar is simultaneously the best of the series at 79.0%, and synthetic math gains +1.3.

The one regression is Arabic_Reasoning at -2.2 against v5 — on 400 rows that is close to sampling noise, but it is the second consecutive mix where this column is the give.

detailGSM8K-arArabic_Reasoningsynth mathsynth relational
final-answer number correct79.0%77.5%46.2%54.2%
all numbers match79.0%73.0%43.5%52.2%
well-formed <think> + answer100.0%98.8%99.5%99.5%
mean reasoning length39 tok90 tok59 tok45 tok

(the synth-math column here is the 400-row mix cell; the 40.4% in the table above is the 1,000-row set used for the cross-model comparison.)

Reproduce any cell with code/eval_reasoning.py — it is the same script for every model and every row, which is the only reason these are comparable.

The final checkpoint ships, and eval loss disagrees

Loss bottoms at 0.4559 (epoch 1.86) and rises to 0.5154 by epoch 5 — yet the epoch-5 weights are the better model. This was measured directly on an earlier run whose corpus contained no repeated rows, which rules out memorisation: the minimum-loss checkpoint scored 30.9% where the final scored 35.6%. It happened on four consecutive runs. train_reasoning.py therefore takes LOAD_BEST=0, and that is not an oversight.

Training mix

275,639 rows, 31.1M tokens/epoch:

sourcerowstokens/epochshare
oddadmix/arabic-math-reasoning-synth118,06216.79M53.9%
oddadmix/gsm8k-reasoning-ar140,96911.88M38.2%
Omartificial-Intelligence-Space/Arabic_Reasoning_Dataset16,608 (5,536 × 3)2.45M7.9%

Of the synthetic corpus's 120,462 rows, 20,139 are relational problems generated specifically for this release, after a pass@k diagnostic showed the previous model went 0/8 on ضعف-style problems and a corpus audit found the relation appears in only 1.34% of rows. The synthetic eval split was pinned, not re-drawn when those rows were added: re-shuffling would have moved 1,955 of the 2,000 previously held-out items into train, turning that column into a memorisation score.

Full fine-tune from the base (not from the previous version). Loss on the assistant turn only, user prompt masked with -100. Arabic_Reasoning is ~25× smaller than GSM8K, so it is repeated 3×.

epochs5 (21,535 steps)
effective batch64
learning rate3e-4 cosine, 200 warmup steps
max length768 tokens (mix p100 is 703 — nothing truncated)
precisionbf16
checkpointfinal (load_best_model_at_end disabled — it picks the worse model)
hardware1× RTX A6000, ~85 min

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

model_id = "oddadmix/Nawah-Math-Reasoning"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, dtype=torch.bfloat16).eval()

messages = [{"role": "user", "content": "اشترى خالد 4 دفاتر بسعر 15 جنيهًا للدفتر، ودفع بورقة 100 جنيه. كم المبلغ المتبقي؟"}]
prompt = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
ids = tok(prompt, return_tensors="pt")

out = model.generate(**ids, max_new_tokens=384, do_sample=False)
print(tok.decode(out[0][ids["input_ids"].shape[1]:], skip_special_tokens=False))

Split the parts with re.match(r"\s*<think>(.*?)</think>(.*)", completion, re.S). Decode with skip_special_tokens=False — <think> and </think> are real tokens in this tokenizer, and stripping them destroys the split.

It is single-turn: one user message per call. Chat history is out of distribution.

Answer style is not something you can request. The three corpora disagree — GSM8K rows end in a bare numeral, the other two in an إذن، … sentence — and arithmetic word problems look alike in all of them, so the model picks a style per prompt. Score it on number agreement, not exact string match, and parse the answer by extracting its numbers.

Limitations

At ~52M parameters this is a proof of concept, and the honest headline is the synthetic columns — 40.4% and 52.2% on multi-step problems, well below the 79.0% it scores on GSM8K's narrower phrasing. Arithmetic is the dominant failure mode: the reasoning is usually structurally right, one computation step is wrong, and the model then stays faithful to its own bad number.

Each corpus brings its own defect. The GSM8K half is machine-translated, its 140,969 rows expanding from only 2,814 question patterns, so that score partly reflects narrow phrasing. The synthetic half is verified for arithmetic, not for sense — rows survive where every equation checks out but a step introduces an entity never mentioned, or the answer resolves the reverse of what was asked. The Arabic_Reasoning half excludes open-ended expository rows (they have no final answer to place after </think>), so expository prompts remain out of distribution.

Everything is MSA; the synthetic corpus's region axis sets currency and context, not dialect. The Arabic inherits source artifacts including inconsistent gender agreement. Its reasoning trace is not a faithful account of any internal computation. Do not use it for anything consequential.

Citation

@misc{nawah_math_reasoning_2026,
  title  = {Nawah-Math-Reasoning: a 52M-parameter Arabic chain-of-thought math model},
  author = {Ahmed Wasfy},
  year   = {2026},
  url    = {https://huggingface.co/oddadmix/Nawah-Math-Reasoning}
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Можно запустить

Подбираем GPU…

Класс архитектуры
LlamaForCausalLM
Ревизия весов
4cdd298

0 моделей