Home / Insights / Building an Arabic SLM
AI · 7 min readBuilding an Arabic SLM, Locally
By Ibrahem Qusay · · Updated
At a Glance
Most language model tooling assumes English, generous compute, and a cloud connection. Building Razi SLM meant working against all three: Arabic morphology, a small local model, and hardware that couldn’t just scale up.
Why local, why small
A cloud LLM is easy to reach for, but for a domain like simplifying medical language, sending patient-adjacent text off-device raises real privacy questions, and a general-purpose model has no reason to be careful about medical claims. A small, local model narrows the job: explain, don’t diagnose, and stay auditable.
Arabic is not an afterthought
Arabic's rich morphology and dialectal variation mean tokenization and normalization choices matter more than they would in English. A lot of the early work was less about model architecture and more about building clean, representative training and evaluation data — including Iraqi-dialect phrasing, not just Modern Standard Arabic.
Where the model has to say no
A refusal isn’t a failure state here — it’s a feature. Red-flag symptoms, requests for a diagnosis, or anything resembling a prescription need a safe, clear refusal rather than a confident-sounding guess. Designing that refusal behavior took as much iteration as the explanatory capability itself.
Takeaway: constraints — local hardware, a narrow domain, a language with less tooling — often produce a more disciplined product than an unconstrained one would.
Razi SLM is still an active research project; the case study on the Work page covers its current capabilities and boundaries.
Frequently Asked Questions
Why build a small, local Arabic model instead of using a cloud LLM?
For a domain like simplifying medical language, sending patient-adjacent text off-device raises privacy questions, and a general-purpose cloud model has no reason to be careful about medical claims — a small local model narrows the job to explaining, not diagnosing.
Why does Arabic need special tokenization work?
Arabic's rich morphology and dialectal variation mean tokenization and normalization choices matter more than in English — much of the early work went into building clean, representative training data, including Iraqi-dialect phrasing.
When does the model refuse to answer?
Red-flag symptoms, requests for a diagnosis, or anything resembling a prescription trigger a safe, clear refusal instead of a confident-sounding guess — refusal is treated as a feature, not a failure.