--- license: cc-by-nc-4.0 language: - ar - en task_categories: - translation size_categories: - 100K [!IMPORTANT] > **This augmentation did not work.** Training NileChat-3B on it (84.7% synthetic against > 15.3% real supervision) scored **22.77** spBLEU on the official AlexandriaX dev set against > **23.54** for the same adapter trained on real data alone. No submitted system used it. It is > released because the negative result is reusable, and because the underlying Arabic sentences > are useful in their own right — but read *Known limitations* before building on it. | | | |---|---| | **Rows** | 348,787 (single `train` split) | | **Direction** | English (synthetic) → dialectal Arabic (authentic) | | **Varieties** | 14 — the 13 AlexandriaX countries plus Algerian (DZ) | | **Built from** | 358,483 cleaned dialectal sentences from public corpora | | **Back-translator** | `facebook/nllb-200-distilled-600M`, fp16, greedy | | **Size** | 65 MB parquet, 214 MB in memory | | **Format** | one prompt/response pair per row, prompt pre-rendered | | **License** | CC-BY-NC-4.0 — non-commercial; the source corpora carry their own terms | ## Loading ```python from datasets import load_dataset ds = load_dataset("NAMAA-Space/alexandria-backtranslated-pairs", split="train") print(ds[0]["prompt"]) print(ds[0]["response"]) # Egyptian rows only eg = ds.filter(lambda r: r["country"] == "EG") ``` The `prompt` field is already rendered in the format the sibling models were trained on, so it drops straight into a completion-only SFT run: ``` You are an expert translator. Translate the English sentence into EG. ### Metadata: - Country: EG - Domain: Everyday / Social - Participants: Unknown Participants - Speaker: A - Speaker Direction: Unknown ### Conversation History: No previous turns (Start of conversation). ### Sentence to Translate: {NLLB back-translation of the Arabic sentence} ### Translation: ``` ## Fields | Field | Type | Description | |---|---|---| | `prompt` | string | Fully rendered instruction prompt. The metadata block is a placeholder: `Domain` is always *Everyday / Social*, `Participants` *Unknown Participants*, `Speaker` *A*, `Speaker Direction` *Unknown*, and the history is always *No previous turns*. Only `Country` carries real information. | | `response` | string | The authentic dialectal Arabic sentence — the training target. Mean 84 characters, median 53, capped at 1,000. | | `country` | string | ISO-2 country code of the variety (14 values, includes `DZ`). | | `conv_id` | string | Synthetic id, `BT-{CC}-{hash}`. One row per id — these are **not** conversations. | | `turn_order` | int64 | Always `1`. Present only for schema compatibility with the official task data. | ## Composition Rows per variety: | Country | Rows | Share | In the AlexandriaX task? | |---|---|---|---| | SA Saudi | 50,000 | 14.3% | yes (train + dev + test) | | SY Syrian | 50,000 | 14.3% | yes (train + dev + test) | | MA Moroccan | 46,286 | 13.3% | yes (train + dev + test) | | PS Palestinian | 30,538 | 8.8% | yes (train + dev + test) | | DZ Algerian | 30,078 | 8.6% | **no — not a task variety** | | EG Egyptian | 28,197 | 8.1% | yes (train + dev + test) | | LB Lebanese | 23,467 | 6.7% | yes (train + dev + test) | | JO Jordanian | 21,185 | 6.1% | yes (train + dev + test) | | TN Tunisian | 15,204 | 4.4% | yes (train + dev + test) | | OM Omani | 13,812 | 4.0% | yes (train + dev + test) | | LY Libyan | 13,587 | 3.9% | yes — **test-only**, so this is its only training signal | | SD Sudanese | 12,251 | 3.5% | yes — **test-only**, so this is its only training signal | | YE Yemeni | 12,031 | 3.4% | yes (train + dev + test) | | MR Mauritanian | 2,151 | 0.6% | yes (train + dev + test) | Saudi and Syrian are clipped at 50,000; Mauritanian Hassaniya is the scarcest variety here by an order of magnitude, exactly as it is in the task data — back-translation did not fix the long tail. ## How it was built The full pipeline is in this repo as **[`build_backtranslated_pairs.py`](./build_backtranslated_pairs.py)**, extracted from the original Colab notebook (`AlexandriaX_NB1_Preprocessing.ipynb`). 1. **Harvest.** A monolingual corpus was assembled from public dialectal Arabic sources: IADD, QADI, NADI-2021, MADAR, and Egyptian, Saudi, Moroccan, Levantine, Libyan, Sudanese and Yemeni web and transcript collections. Ingestion is **audio-free** — for speech corpora only the transcript column is read, by column projection. 2. **Clean**, aggressively, because this is target-side text rather than parallel data. Result: **358,483** sentences across 14 varieties. 3. **Back-translate** each sentence to English, then invert the pair. 4. **Render** as an instruction prompt with placeholder metadata. **348,787** rows survived — the shortfall against 358,483 is the 50,000-per-dialect cap biting on SA (52,411 available) and SY (57,283). ### Cleaning parameters, exactly | Step | Setting | |---|---| | HTML unescape | yes | | URLs | `https?://\S+|www\.\S+` → space | | @-mentions | `@\w+` → space | | Hashtags | `#\w+` → space (**the whole tag**, not just `#`) | | Timestamps | `\b\d{1,2}:\d{2}(:\d{2})?\s?[ap]m?\b` → space | | Emoji | stripped (5 Unicode blocks) | | Tatweel `ـ` | removed | | Character runs | 3+ repeats of any character collapsed to 1 | | Diacritics (tashkeel) | **kept** (`REMOVE_DIACRITICS = False`) | | Latin letters | **deleted** (`REMOVE_LATIN_TOKENS = True`) — see the bias note below | | Punctuation | `_ / \ ~ @ # $ % ^ & * ( ) - + = [ ] { } \| ; : " ' < > , . ?` → space | | Unicode | NFKC normalisation, whitespace collapsed | | Length filter | 3 ≤ characters ≤ 1,000, ≥ 1 word | | Arabic-ratio filter | ≥ **0.50** — but applied *after* Latin removal, so in practice it only drops rows left with no Arabic at all | | Near-duplicates | dropped per dialect on a key of (tashkeel-stripped, whitespace-removed, lowercased) text | ### Back-translation parameters, exactly | Setting | Value | |---|---| | Model | **`facebook/nllb-200-distilled-600M`** (the distilled 600M, *not* the 1.3B used for the forward-direction fine-tune) | | Precision | `float16`, single CUDA device | | Direction | dialect → English, `forced_bos_token_id = eng_Latn` | | Decoding | **greedy** — no beams, no sampling | | `max_new_tokens` | 128 | | Source truncation | 128 tokens | | Batch size | 256 (sized for an L4) | | Cap per variety | **50,000** (`BT_PER_DIALECT`) | | `conv_id` | `BT-{CC}-{md5(text)[:8]}` — also the resume key | | Output | JSONL, appended and flushed per row so an interrupted run resumes | Per-variety **source** codes for the dialect→English pass. Note these differ from the codes used to fine-tune NLLB in the forward direction: here LY and SD get dedicated codes, while OM and MR fall back to MSA. | EG | MA | TN | LY | SD | SA | YE | OM | JO | LB | SY | PS | MR | DZ / other | |---|---|---|---|---|---|---|---|---|---|---|---|---|---| | `arz` | `ary` | `aeb` | `ayl` | `apd` | `ars` | `acq` | `arb` | `ajp` | `apc` | `apc` | `ajp` | `arb` | `arb` | (all `_Arab` script) ## Measured effect Same base model, same QLoRA hyperparameters, one epoch, greedy decoding; scored country-macro on the official AlexandriaX dev set (12,250 turns, 11 countries) and on an internal hold-out of 3,350 turns carved from the training conversations. | Training data | dev spBLEU | dev chrF++ | hold-out spBLEU | hold-out chrF++ | |---|---|---|---|---| | 63,130 real turns, no context | **23.54** | **39.68** | **24.84** | **40.36** | | 63,130 real turns, with context | 22.87 | 39.11 | 23.37 | 39.35 | | + **348,787 rows of this dataset**, with context | 22.77 | 38.71 | 24.36 | 40.16 | The two evaluation sets disagree: on the internal hold-out the augmentation gains **+0.99** spBLEU over the context baseline, on the official dev set it loses **0.10**. The hold-out shares conversations, speakers and phrasing with the training data, so it flatters anything that adds volume. Per country on official dev, the augmentation helped where real data is scarce (TN +1.42, OM +0.87, EG +0.34) and hurt where it is plentiful (SY −0.93, PS −0.83, SA −0.84, MA −0.82). Trained checkpoint: [`alexandriax-nilechat-ctx-aux`](https://huggingface.co/NAMAA-Space/alexandriax-nilechat-ctx-aux). ## Known limitations - **The English side is machine-generated** by a **600M distilled** translator and is not human-verified. Some of it is visibly disfluent or semantically drifted; models trained on it learn to translate *NLLB-distilled English*, which is not the register of the task's hand-written dialogue turns. - **Latin script is deleted from the targets**, not merely filtered. `REMOVE_LATIN_TOKENS=True` strips every `A-Za-z` character before back-translation, so **no row contains a single Latin token**. AlexandriaX gold does the opposite: 33.8% of Moroccan and 39.1% of Tunisian gold turns carry Latin-script French or English borrowings. Training on this data therefore pushes a model *away* from the reference style of exactly the varieties the augmentation was meant to help — and it mutilates code-switched sentences rather than dropping them, since the Arabic-ratio filter runs afterwards and no longer sees any Latin. - **Punctuation is stripped from the targets** but not from the English prompts, so a model trained here learns to drop sentence-final periods, commas and question marks against punctuated references. (ASCII `!` and the Arabic `؟` happen to survive the filter, which makes the loss inconsistent rather than cleanly systematic.) - **No conversation structure.** Every row is a first turn with empty history and placeholder metadata, so this data cannot teach context-aware behaviour — which is what the task rewards. - **Metadata fields are fake** apart from `country`. Do not treat `Domain`, `Speaker` or `Speaker Direction` as labels. - **DZ (Algerian) is out of task scope** — 8.6% of the rows target a variety AlexandriaX never evaluates. - **Variety labels are inherited, not verified.** They come from the source corpora's own country labels; dialect identification noise in those corpora propagates here, and country-level labels flatten real sub-dialect variation. - **Provenance is coarse.** Per-row source attribution was not retained, so a row cannot be traced back to IADD vs QADI vs a web dump. Redistribution terms of the underlying corpora differ; check them before any use beyond research. - **Non-commercial.** Web and corpus provenance plus the NLLB licence make this research-only. --- ## The shared task **AlexandriaX-2026** (ArabicNLP 2026 / EMNLP) — *Context-Aware Dialectal Arabic MT and MT Evaluation*. This model was built for **Subtask 1: Context-Aware English-to-Dialectal Arabic Dialogue Translation**. Given one **English dialogue turn** together with its **conversation history** and metadata — target country/dialect, domain, participant roles, speaker, and speaker→addressee gender direction — the system must produce the turn in the requested country's spoken Arabic, preserving meaning while adapting lexical, morphological, pragmatic and sociolinguistic choices to that variety. Two tracks: **constrained** (provided data only, ≤5B parameters) and **unconstrained** (any external data or model). Ranking is by **spBLEU** (primary) and **chrF++** (secondary), each macro-averaged over countries. ### Official data (`UBC-NLP/alexandria`) Split sizes in **turns**, as published by the organisers: | Split | EG | JO | LB | LY | MA | MR | OM | PS | SA | SD | SY | TN | YE | **Total** | |---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| | train | 3,108 | 5,501 | 8,906 | 0 | 2,573 | 5,515 | 6,280 | 14,933 | 8,470 | 0 | 6,071 | 2,034 | 3,089 | **66,480** | | dev | 1,113 | 1,113 | 1,118 | 0 | 1,110 | 1,114 | 1,109 | 1,110 | 1,110 | 0 | 1,119 | 1,116 | 1,118 | **12,250** | | public test | 1,118 | 1,107 | 1,106 | 1,109 | 1,115 | 1,112 | 1,118 | 1,109 | 1,113 | 1,106 | 1,114 | 1,109 | 1,106 | **14,442** | | private (blind) test | 1,113 | 1,109 | 1,110 | 1,309 | 1,111 | 1,119 | 1,107 | 1,111 | 1,114 | 915 | 1,114 | 1,114 | 1,113 | **14,459** | **Libyan (LY)** and **Sudanese (SD)** appear only at test time — they are **zero-shot** for every system trained on this data. Conversation-level counts: **21,146** train / **3,963** dev / **4,706** public-test conversations; mean **3.13** turns per conversation (range 1–5). Mean length 102 characters of English source, 74 characters of dialectal target. **Dialects (13 countries).** Egyptian, Jordanian, Lebanese, Libyan, Moroccan, Mauritanian, Omani, Palestinian, Saudi, Sudanese, Syrian, Tunisian, Yemeni. Labels are country + **sub-dialect**, and several countries carry more than one: Palestinian 10 (Nabulsi and Albira urban, plus Falahi varieties of Surif, Kobar, Noba, Ni'lin, Shuqba, Aboud, Silwad, Ramallah), Omani 5 (Suri, Rustaqi, Al-Wafi, Ibri, Seebi), Saudi 3 (Southern, Hijazi, Khaleeji), Yemeni 3 (Taiz, San'ani, Central), Syrian 2 (Levantine Standard, Homsi). The remaining countries carry one label each (e.g. *Egyptian Arabic (Cairene)*, *Moroccan Standard Darija*, *Mauritanian Hassaniya*, *Libyan Arabic (Misrati/Central)*). **Domains (11, near-uniform).** Agriculture and farming, Commerce and transactions, Construction and real estate, Education and academia, Energy and resources, Everyday and social, Healthcare and medical, Legal and financial, Logistics and transportation, Professional and workplace, Tourism and hospitality. **Speaker direction** (turns, train+dev+public test): female→male 30,636 · male→female 30,203 · male→male 20,465 · female→female 11,868. The corpus carries 76 distinct translator IDs and 44 reviewer IDs. **Code-switching in the gold** is strongly dialect-specific — the share of gold turns containing Latin characters runs from **TN 39.1% / MA 33.8% / LB 18.1%** down to **SY 1.2% / YE 0.8%**. Systems that normalise every borrowing into Arabic script are penalised hardest on Maghrebi references (see *Known limitations*). ### Evaluation protocol - **spBLEU** — `sacrebleu.BLEU(tokenize="flores200")`, corpus-level per country, then averaged over countries. - **chrF++** — `sacrebleu.CHRF(word_order=2)`, same averaging. - Decoding is **turn-by-turn**: at turn *n* the conversation history contains the system's **own** previous outputs, never the gold ones. (An early evaluation harness in this project leaked gold previous-turn Arabic into the prompt and inflated scores by ≈2.4 spBLEU; every number reported here comes from the corrected, self-conditioned harness.) --- ## The collection All released artefacts live in [**NAMAA at AlexandriaX-2026**](https://huggingface.co/collections/FatimahEmadEldin/namaa-at-alexandriax-2026): | Repo | What it is | |---|---| | [`alexandriax-arat5v2-base`](https://huggingface.co/NAMAA-Space/alexandriax-arat5v2-base) | AraT5v2-base full fine-tune — **best small fine-tune**, 25.12 dev / 23.26 blind spBLEU | | [`alexandriax-arat5v2-balanced`](https://huggingface.co/NAMAA-Space/alexandriax-arat5v2-balanced) | the same recipe on a temperature-rebalanced dialect mixture — **void run**, released for the post-mortem and the fixed script | | [`alexandriax-nilechat-lora`](https://huggingface.co/NAMAA-Space/alexandriax-nilechat-lora) | NileChat-3B QLoRA, context-free — best of the three NileChat variants, 23.54 dev spBLEU | | [`alexandriax-nilechat-ctx-aux`](https://huggingface.co/NAMAA-Space/alexandriax-nilechat-ctx-aux) | NileChat-3B QLoRA, context + back-translation — the augmentation ablation, 22.77 dev spBLEU | | [`alexandriax-nllb-1.3b-lora`](https://huggingface.co/NAMAA-Space/alexandriax-nllb-1.3b-lora) | NLLB-200-1.3B QLoRA with per-dialect language codes, 21.83 dev spBLEU | | [`alexandriax-mt5-large-balanced`](https://huggingface.co/NAMAA-Space/alexandriax-mt5-large-balanced) | mT5-large on the rebalanced mixture — **partial run** (2,500/31,568 steps), never evaluated | | [`alexandria-backtranslated-pairs`](https://huggingface.co/datasets/NAMAA-Space/alexandria-backtranslated-pairs) | 348,787 synthetic EN→dialect pairs over 14 varieties | Every model repo above carries a single-file `train_*.py` reproduction script with the exact hyperparameters that produced its checkpoint; the dataset repo carries `build_backtranslated_pairs.py`. Official task data: [`UBC-NLP/alexandria`](https://huggingface.co/datasets/UBC-NLP/alexandria). Base models: [`UBC-NLP/AraT5v2-base-1024`](https://huggingface.co/UBC-NLP/AraT5v2-base-1024), [`UBC-NLP/NileChat-3B-Base`](https://huggingface.co/UBC-NLP/NileChat-3B-Base), [`facebook/nllb-200-1.3B`](https://huggingface.co/facebook/nllb-200-1.3B), [`google/mt5-large`](https://huggingface.co/google/mt5-large). --- ## Team **NAMAA Community** — Fatimah Emad Eldin (Cairo University) · Omer Nacar (Tuwaiq Academy) · Khloud Al Jallad (Arab International University) · Mona Abdelazim (Ain Shams University). ## Citation **Coming soon.** The NAMAA system-description paper for AlexandriaX-2026 is under review for the ArabicNLP 2026 (EMNLP) proceedings; this card will be updated with the final ACL Anthology reference and DOI when the proceedings are published. Until then, please cite as: ```bibtex @inproceedings{namaa-alexandriax-2026, title = {{NAMAA} Community at {AlexandriaX-2026}: Prompting, Fine-Tuning and Agreement Voting for Dialectal Arabic Translation and Evaluation}, author = {Emad Eldin, Fatimah and Nacar, Omer and Al Jallad, Khloud and Abdelazim, Mona}, booktitle = {Proceedings of the Fourth Arabic Natural Language Processing Conference (ArabicNLP 2026)}, year = {2026}, note = {To appear. Citation coming soon.} } ``` Please also cite the shared task and the base model: ```bibtex @inproceedings{alexandriax2026, title = {{AlexandriaX-2026} Shared Task: Context-Aware Dialectal Arabic Machine Translation and MT Evaluation}, author = {El Mekki, Abdellah and Elmadany, AbdelRahim A. and Magdy, Samar M. and Ezzini, Saad and El-Haj, Mo and Jarrar, Mustafa and El-Beltagy, Samhaa and Abbas, Mourad and Zaraket, Fadi and Al Mandhari, Salim and Alyafeai, Zaid and Ghanem, Bernard and Abdul-Mageed, Muhammad}, booktitle = {Proceedings of the Fourth Arabic Natural Language Processing Conference (ArabicNLP 2026)}, year = {2026}, note = {Overview paper. Citation coming soon.} } ``` ## Acknowledgements Thanks to the AlexandriaX-2026 organisers for the data, the evaluation infrastructure and their responsiveness during the evaluation phases.