
Arabic is one of the most spoken languages on Earth, and one of the worst served by AI. The problem...
Arabic is one of the most spoken languages on Earth, and one of the worst served by AI. The problem is not a lack of speakers or text. The problem is that "Arabic" is not one language in practice. A user in Riyadh, a user in Cairo, and a user in Karachi typing Urdu in Arabic script all write differently — and most models handle that reality poorly.
rihla-llm is my attempt to build a multilingual model pipeline for Arabic, Urdu, and English that respects how people actually write. This article shares the lessons that mattered most, because they generalize to anyone building AI for under-served languages.
Urdu and Arabic share a script, so naive pipelines lump them together. That is a mistake. The same characters carry different vocabularies, different grammar, and different cultural context. A model trained on mixed data without language awareness produces answers that drift mid-sentence — Arabic words in Urdu grammar, or formal Modern Standard Arabic where the user wrote casual dialect.
In rihla-llm, language identification happens early and explicitly. Every training example is tagged, and the model learns to stay in the language the user chose. It sounds obvious. Almost nobody does it carefully.

Script is not language: dialect, script, numerals and morphology all sit between text and understanding.
Most Arabic training data is Modern Standard Arabic — news, books, formal writing. But people do not chat in Modern Standard Arabic. They write Gulf dialect, Egyptian dialect, Levantine slang, and Roman Urdu mixed with English words. A model that only understands formal Arabic feels foreign to the very users it claims to serve.
The practical fix is unglamorous: collect and clean real conversational data, normalize the wild spelling variation of dialect text (the same word can be spelled five ways), and evaluate on dialect test sets, not just formal benchmarks. My rule became simple: if a native speaker would not write it that way in a WhatsApp message, the model should still understand it — and reply naturally.
Tokenizers trained mostly on English split Arabic words into many small pieces. That means Arabic text costs more tokens, fills context windows faster, and gives the model less room to think. It is an invisible tax on every Arabic user.
When building rihla-llm, measuring tokens-per-word for Arabic and Urdu versus English was one of the first diagnostics. If your tokenizer needs three tokens for a common Arabic word, your effective context and your inference bill both suffer. Choosing a base model and vocabulary with decent Arabic coverage is not a detail — it is a budget decision that compounds with every request.

Tokenization decides the budget: sequence length, cost and quality all follow.
I did not train a foundation model. I fine-tuned one, using QLoRA so the work fits on modest hardware, then applied preference tuning (DPO) to push outputs toward helpful, in-language, culturally appropriate responses. For a domain assistant — travel, local services, everyday questions in Arabic and Urdu — a well-tuned smaller model beats a giant general model that answers in stiff formal Arabic.
The pipeline matters more than the parameter count:
Benchmarks translated from English do not tell you whether Arabic users will be satisfied. I evaluate with native-speaker-style test prompts: dialect questions, code-switched Urdu-English messages, and requests where the correct answer requires local context. A model can score well on translated benchmarks and still fail every one of these.
If you build for a language, test in that language, the way its speakers actually write. Everything else is theater.

The rihla-llm pipeline: real text, QLoRA fine-tuning, DPO, retrieval with native-speaker evaluation.
Hundreds of millions of people speak Arabic and Urdu. Their AI tools should understand them as they are — dialect, code-switching, script and all. rihla-llm is a small step, built with open techniques: QLoRA fine-tuning, DPO alignment, and retrieval grounding. The larger lesson is for every builder working in an under-served language: respect the language's real usage, measure honestly, and tune for your users instead of for a leaderboard.
Muhammad Faizan is an AI engineer and full-stack developer based in Saudi Arabia. He builds ML systems and developer tools including PocketBot and Gale Download Manager. More at faizzyhon.com.
Originally published at faizzyhon.com.