Arabic language research · DiacriticS

تشكيل

اللغة العربية

tashkīl: the marks that carry the meaning

DiacriticS

Fine-tuning a language model to restore Arabic's missing vowels, evaluated where it counts: on a benchmark built to resist memorisation.

Scroll to restore the marks that written Arabic often leaves out.

Artwork: diacritised Arabic set in Amiri

01 · Comprehension

One skeleton, many meanings

Written Arabic is usually published bare: consonants and long vowels only, with the short vowels and grammatical case endings (the diacritics, or tashkeel) left out. A single skeleton of letters can hide several unrelated words.

Same three letters, ع ل م

عَلَمٌa flag
عِلْمٌknowledge
عَلَّمَhe taught

Three readings. Zero difference on the page without diacritics.

Why it matters

Diacritisation is preprocessing for text-to-speech, machine translation, and information extraction: systems that need one unambiguous pronunciation, not a lattice of possibilities.

Why it's hard to benchmark

Prior benchmarks leaked: training and test sets overlapped, and evaluations skewed toward either Classical or Modern Standard Arabic, inflating reported accuracy.

02 · The people behind DiacriticS

Meet the team

Four researchers connecting Arabic NLP, multilingual machine learning, and practical engineering to make Arabic text easier to read, study, and use.

Mentor · KAUST

Youssef S. Mohamed

KAUST Ph.D. researcher in multimodal deep learning, affective image captioning, and multicultural modelling. He brings research experience from KAUST, the University of Tartu, and Zewail City, with a love for swimming and basketball beyond the lab.

AI/ML student · Team Leader · IAU

Mahdi Alkhamis

Senior AI/ML student At IAU focused on deep learning and computer vision. His work spans LAR-U-Net image denoising, the VisionFit posture-analysis app, and fine-tuning open-source LLMs for Arabic diacritisation; he also led 30+ CCSIT Club technical events.

Software Engineering student · KFUPM

Mohammad Alali

Software Engineering student at KFUPM and KAUST Academy AI/ML learner. He builds practical software with Python, C++, and Java, bringing a Mawhiba alumnus’s curiosity and an engineering perspective to the project.

Electrical & Computer Engineering student · KAU

Saad Alnafjan

Electrical and Computer Engineering student at KAU. He combines a strong hardware and computational foundation with deep learning techniques, bringing hardware-software integration and analytical problem-solving to the team.

03 · Method

How the project works

A strict wall between what the model learns from and what it is judged on. Five stages, run in order.

  1. Train on Sadeed-Tashkeela

    The cleaned split of Tashkeela: unified diacritisation style, 50–60-word chunks, almost nothing left half-marked. Every example overlapping the Fadel test set was removed, cutting overlap to 0.4%: the train/test wall the project rests on. 1,042,698 examples, ~53M words.

  2. Test on SadeedDiac-25

    1,200 paragraphs, half Modern Standard and half Classical: 600 MSA paragraphs of 40–50 words (454 curated web articles, 146 from WikiNews) reviewed by two independent experts, and 600 Classical paragraphs from the Fadel test set. The modern half was diacritised in-house and never published diacritised, so no model had read it.

  3. Benchmark zero-shot, across scales

    Eleven open-weights models are scored cold, before any fine-tuning happens, establishing an honest baseline.

  4. Fine-tune with LoRA, and scale the data

    The strongest candidate model is adapted on the cleaned Tashkeela set with LoRA only: no QLoRA, no full-weight retraining. Training is then repeated over 10%, 30%, and 50% of the corpus, so the gain can be read against the amount of data it took.

  5. Score, then break the score apart

    Diacritic and Word Error Rates are computed with and without sentence-final case endings, then compared across Classical vs. Modern Standard subsets to isolate where errors come from.

The two headline metrics

DER= incorrect diacritics / total diacritised characters × 100

WER= words with ≥1 diacritic error / total words × 100

04 · Baseline findings

Results on SadeedDiac-25

Zero-shot scores across twelve open-weights models, before any fine-tuning. Each figure averages the Modern Standard and Classical Arabic halves of the benchmark, and two patterns dominate every tier.

Mean (MSA + CA) · SadeedDiac-25 · lower is better

ModelDERwith CEWERwith CEDERno CEWERno CE
Flan-T5-Tashkeel-Small4.1011.863.617.88
gemma-4-E4B-it4.189.963.806.78
Tashkeel-350M-v26.3315.285.6410.40
Fine-Tashkeel17.9122.6117.7320.35
Fanar-1-9B-Instruct26.1431.4826.3528.81
Glonor-ByT5-Arabic33.6250.6833.2244.77
Qwen3.5-9B39.7859.4441.9255.69
gemma-3-1b-pt-10k-diacritization50.2555.8150.6652.95
Qwen3.5-4B58.2979.0059.4375.22
aya-expanse-8b66.5585.7867.0884.04
Moonlight-16B-A3B-Instruct86.6099.0187.1098.84
Qwen3.5-0.8B92.1899.6792.4199.62

CE = sentence-final case endings (i'rab). Every figure is the mean of the Modern Standard and Classical Arabic halves of the benchmark, sorted by DER with case endings.

Finding 1

Sentence endings are the weak point

Every model's error rate jumps on the last, case-marking diacritic of a sentence (i'rab) compared to diacritics inside a word, the clearest sign that these models resolve local spelling far better than sentence-level syntax.

قَرَأَ الطَّالِبُ الكِتَابَ'the student', ُ nominative, reads correctly inside the word but breaks at the case ending

Finding 2

Classical Arabic is the harder domain

Error rates rise markedly moving from Modern Standard Arabic passages to Classical Arabic (CA) texts: evidence that domain-balanced training, not just more data, is what closes the gap.

وَقَالَ الرَّاوِي فِي إِسْنَادِهِdense classical narration syntax, the CA register with the highest observed error

05 · Fine-tuning

What fine-tuning buys

Both 4B targets were adapted with LoRA under identical conditions on nested slices of the training corpus, so the 10% slice sits inside the 30% and that inside the 50%. Only the data volume and the backbone differ.

After LoRA fine-tuning · SadeedDiac-25 · lower is better

Model / training dataDERwith CEWERwith CEDERno CEWERno CE
gemma-4-E4B-it zero-shot4.189.963.806.78
gemma-4-E4B-it 10%3.157.282.684.47
gemma-4-E4B-it 30%2.986.822.544.12
gemma-4-E4B-it 50%2.816.542.383.96
Qwen3.5-4B zero-shot58.2979.0059.4375.22
Qwen3.5-4B 10%7.0711.746.948.74
Qwen3.5-4B 30%5.279.285.036.54
Qwen3.5-4B 50%4.388.184.075.57

LoRA rank 16, effective batch 96, one epoch, 5% warmup ratio, seed 42, on nested subsets of Sadeed Tashkeela. Gemma leads at every fraction, but the gap narrows from 54.1 points to 1.6.

LoRA or every weight?

Qwen3.5-0.8B is small enough to train end to end, which makes it the one place in this study where the adaptation regime can be isolated. Base checkpoint, corpus and prompt are held identical; only the fraction of weights allowed to move changes.

Qwen3.5-0.8B · adaptation regime · lower is better

Model / training dataDERwith CEWERwith CEDERno CEWERno CE
Zero-shot no training92.1899.6792.4199.62
LoRA rank 16, full corpus3.608.283.154.98
Full fine-tuning all weights, full corpus3.067.342.584.12

Full fine-tuning wins by 0.54 DER points. The narrow margin is the result: a rank-16 adapter recovers roughly 94% of the benefit of updating every weight. The LoRA row is scored on the benchmark only.

Finding 3

A weak start gains the most

Qwen3.5-4B falls from 58.29% to 4.38% DER, and 51.2 of those 54 points are bought by the first tenth of the corpus alone. Gemma 4 E4B-it starts at 4.18%, already below where Qwen finishes, and reaches 2.81%.

58.29 ← 4.38Qwen3.5-4B, zero-shot to half the corpus

Finding 4

Size is not the binding constraint

A 0.8B model trained end to end reaches 3.06% DER, beating a 4B model adapted with LoRA on half the corpus at a fifth of the parameter count. How much of the model is free to move matters more than how large it is.

3.06 < 4.380.8B full fine-tune against 4B LoRA

From report to interaction

Put Arabic text in. Inspect what the model returns.

The local interface exposes the product behavior while the secure proxy keeps model credentials off the page.

Try the model