Text Generation
PEFT
Safetensors
Arabic
lora
unsloth
arabic
levantine-arabic
syrian-arabic
tutoring
adult-literacy
numeracy
education
conversational
Instructions to use ekatra/asmaa-2b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use ekatra/asmaa-2b with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.5-2B") model = PeftModel.from_pretrained(base_model, "ekatra/asmaa-2b") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Desktop
|
Download README.md from ekatra/asmaa-2b: direct link, hf CLI and curl.
- Browser
- Download file 9.22 kB
-
https://huggingface.co/ekatra/asmaa-2b/resolve/main/README.md
- Command line
-
hf download hf://ekatra/asmaa-2b/README.md
-
curl -L -o README.md https://huggingface.co/ekatra/asmaa-2b/resolve/main/README.md
9.22 kB
| base_model: Qwen/Qwen3.5-2B | |
| library_name: peft | |
| pipeline_tag: text-generation | |
| license: apache-2.0 | |
| language: | |
| - ar | |
| tags: | |
| - lora | |
| - peft | |
| - unsloth | |
| - arabic | |
| - levantine-arabic | |
| - syrian-arabic | |
| - tutoring | |
| - adult-literacy | |
| - numeracy | |
| - education | |
| # Asmaa 2B | |
| Asmaa 2B is a small tutor model for adults from Syria who are learning to read, write and work with numbers. It | |
| replies the way a kind Syrian teacher texts on WhatsApp: in Syrian Levantine colloquial Arabic (Shami, in Arabic | |
| script), with one short guiding question at a time and no lecture. | |
| It is a LoRA adapter (135 MB) on [Qwen3.5 2B](https://huggingface.co/Qwen/Qwen3.5-2B), small enough to run on a | |
| laptop. Made by [Ekatra](https://huggingface.co/ekatra). | |
| > **Status: research preview, not yet judged.** The results below are eval loss and automatic checks. No judge model | |
| > or native speaker has scored correctness, teaching quality or dialect yet. Review its answers before using it with | |
| > learners. | |
| ## Model details | |
| | | | | |
| | --- | --- | | |
| | Base model | Qwen/Qwen3.5-2B | | |
| | Type | LoRA adapter (PEFT), r 32, alpha 64 | | |
| | Language | Syrian Levantine Arabic; Modern Standard Arabic only when the task is a formal text | | |
| | Task | Socratic tutoring in reading, writing and everyday maths, in a chat (WhatsApp) style | | |
| | Training data | 157,408 synthetic tutor conversations in Syrian Arabic (not released) | | |
| | License | Apache-2.0 | | |
| ## What it does | |
| The learner writes a short, often misspelled message about something in front of them: a shopping list, a medicine | |
| label, a form, a phone number, a price. Asmaa answers in a sentence or two and asks one question that leads the | |
| learner to the answer, instead of giving the answer straight away. | |
| Examples from the held-out test split (greedy decoding; English glosses are rough): | |
| | Learner | Asmaa 2B | Base Qwen3.5 2B | | |
| | --- | --- | --- | | |
| | عندي سئال علبه الحليب ب ٢ يورو بدي ٣ علب قدي بيطلعو<br>*A carton of milk is 2 euros, I want 3, how much is that?* | خلّينا نحسبها سوا: علبتين بـ٤ يورو، وإذا زدنا العلبة التالتة بـ٢ يورو، قديش بيصير المجموع؟<br>*Let's work it out together: two cartons are 4 euros, and if we add the third for 2 euros, what's the total?* | Formal Arabic; misreads the question as asking for the price of one carton. | | |
| | اسمي فايز، كتبتو بالاستمارة «فاءز»، هيك الهمزة صح؟<br>*My name is Fayez, I wrote it on the form as «فاءز», is the hamza right?* | أهلين فايز. خلّينا نلفظ اسمك شوي شوي: «فا ـ إِ ـ ز». شو حركة الهمزة هون: كسرة ولا فتحة؟<br>*Hi Fayez. Let's say your name slowly. What vowel is on the hamza here: kasra or fatha?* | Says the spelling is fully correct (it is not). | | |
| | ع كيس الخبز مكتوب «خبز»، أول حرف خ ولا ح؟ بس قلّي الجواب.<br>*The bread bag says «خبز». Is the first letter خ or ح? Just tell me.* | خلّينا نميّزه من النقطة: الحرف اللي بأول «خبز» فوقه نقطة، ولا بلا نقطة؟<br>*Let's tell them apart by the dot: does the first letter have a dot on top or not?* | Gives the answer, then asks an unrelated question about the second letter. | | |
| | رقمك اخره ٦ ولا ٩ عم لخبط بيناتن<br>*Does your number end in 6 or 9? I mix them up.* | خلّينا نميّزهن بالشكل: ٦ و٩. أي واحد فيهن فيه حلقة صغيرة مسكّرة من فوق؟<br>*Let's tell them apart by shape: which one has a small closed loop at the top?* | Invents a number (600) and repeats one line until cut off. | | |
| ## Results | |
| Eval loss is on 500 rows of the frozen test split. The other checks use the training system prompt, greedy decoding, | |
| thinking off and at most 320 new tokens. "Same 200 rows" is the subset that was also run through the base model. | |
| | | Base Qwen3.5 2B | Earlier LoRA (48,834 rows) | **Asmaa 2B (157,408 rows)** | Reference answers | | |
| | --- | --- | --- | --- | --- | | |
| | Eval loss (500 test rows) | n/a | 0.874 | **0.725** | n/a | | |
| | Character 3-gram F-score vs reference (same 200 rows) | 13.3 | 39.9 | **41.9** | 100 | | |
| | Mean words per reply (same 200 rows) | 33.5 | 20.0 | 21.0 | 21.9 | | |
| | Replies cut off at 320 tokens (same 200 rows) | 7.0% | 0% | 0% | n/a | | |
| | Mean words per reply, second test set (441 rows) | n/a | 16.2 | 18.8 | 21.2 | | |
| On the first 1,000 frozen test rows, Asmaa's replies average 21.3 words (reference 23.3), all in Arabic script, and | |
| none are cut off. The character 3-gram score only measures closeness to one reference reply. A good tutor reply can | |
| differ from the reference and still be right, so it is not a quality score. | |
| ## How to use | |
| Use the system prompt the model was trained with (`system_prompt.txt` in this repo), and turn thinking off. Without | |
| that prompt it behaves much more like the base model. | |
| ```python | |
| import torch | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| from peft import PeftModel | |
| from huggingface_hub import hf_hub_download | |
| base = "Qwen/Qwen3.5-2B" | |
| repo = "ekatra/asmaa-2b" | |
| tok = AutoTokenizer.from_pretrained(base) | |
| model = AutoModelForCausalLM.from_pretrained(base, dtype=torch.bfloat16, device_map="auto") | |
| model = PeftModel.from_pretrained(model, repo) | |
| system = open(hf_hub_download(repo, "system_prompt.txt"), encoding="utf-8").read() | |
| messages = [{"role": "system", "content": system}, | |
| {"role": "user", "content": "مرحبا، بدي اتعلم اقرا الساعة"}] | |
| ids = tok.apply_chat_template(messages, add_generation_prompt=True, enable_thinking=False, | |
| return_tensors="pt").to(model.device) | |
| out = model.generate(ids, max_new_tokens=200, do_sample=False) | |
| print(tok.decode(out[0, ids.shape[1]:], skip_special_tokens=True)) | |
| ``` | |
| - Requires transformers 5 or newer (Qwen3.5 support). Trained with transformers 5.17.0, PEFT 0.21.2 and Unsloth | |
| 2026.11.7. | |
| - For a single merged model, call `model.merge_and_unload()` and save it. That is also the starting point for a GGUF | |
| or other on-device build. | |
| - Multi-turn chats work the same way: keep the system prompt first and pass the whole conversation. | |
| - The prompt asks for replies under 90 words, so `max_new_tokens=200` is plenty. | |
| ## Intended use | |
| - Research and prototyping of chat tutors for adult literacy and numeracy in Syrian Arabic, with a person reviewing | |
| the model's answers. | |
| - A starting point for further fine-tuning or evaluation on real learner conversations. | |
| Out of scope: unsupervised use with learners before evaluation; medical, legal, immigration or financial advice; | |
| children's education (the data is written for adults); other Arabic dialects (untested). | |
| ## Training | |
| - **Data:** 157,408 synthetic tutor conversations in Syrian Arabic from Ekatra's `ekatra-tutor-sy` set, which is not | |
| released. Frontier LLMs wrote the learner messages and the tutor replies, a third model judged them, and | |
| low-scoring rows were dropped. The conversations cover reading letters and words, spelling (hamza, taa marbuta), | |
| forms and labels, money, time and dates, phones and everyday arithmetic. They vary the learner's region, writing | |
| style and the document in front of them. | |
| - **Held-out tests:** the frozen test split (4,256 rows) and a second test set (441 rows) were never trained on, and | |
| train and test ids were checked for overlap. | |
| - **Method:** LoRA r 32, alpha 64, dropout 0. It is applied to the attention, MLP and linear-attention projections of | |
| the language model. Loss is on the tutor's final reply only; the chat template is used with thinking off. | |
| - **Settings:** one epoch (4,919 steps), learning rate 1e-4 with a cosine schedule, effective batch 32 (2 x 16), | |
| max length 1,024 tokens, fp16. Trained with Unsloth on a single Google Colab T4 at about 18 s per step, resuming | |
| across several disconnects from checkpoints. | |
| - **Eval loss by step:** 1.40 (250), 0.99 (1,000), 0.85 (2,000), 0.77 (3,000), 0.73 (4,000), 0.725 (4,919). | |
| The full run settings, package versions and per-step loss are in `training/run.json` and | |
| `training/log_history.json`. | |
| ## Limitations | |
| - **Not judged.** Content correctness and dialect quality still need a judge and native-speaker review. | |
| - **It can teach a wrong rule.** One test learner wrote «رئس ثوم» (a head of garlic). Asmaa read it as «رئيس» and | |
| hinted that the hamza takes a kasra, which is wrong for this word. Spelling and grammar hints need checking. | |
| - **Synthetic data.** The training conversations were written by AI models, so they reflect those models' Syrian | |
| Arabic, not real learner chats. | |
| - **One prompt.** It was trained and tested with one system prompt. Other prompts, personas and tasks are untested. | |
| The prompt does not give the tutor a name. | |
| - **Small model.** Expect factual and arithmetic slips. Long conversations were not tested beyond a few turns. | |
| - **Safety.** The system prompt tells it to stay off politics, war and the learner's past, and to answer hardship | |
| briefly and kindly. This was not tested separately. | |
| ## License | |
| Apache-2.0, the same as Qwen3.5 2B. The training data is not released. | |