Custom tokenizer
SentencePiece Unigram tokenizer, frozen at 24k vocabulary, built for Arabic, Darija, Latin Darija, English and mixed text.
MoroLM is a from-scratch language-model research project focused on Moroccan Darija, Arabic script, Arabizi, code-switching, English and French — designed to run locally and eventually power privacy-first Moroccan applications.
The project is no longer just an idea. A custom tokenizer, Llama-like model implementation, training pipeline, fixed evaluation sets, local inference path and a clean base-model lineage now exist.
SentencePiece Unigram tokenizer, frozen at 24k vocabulary, built for Arabic, Darija, Latin Darija, English and mixed text.
MoroLM-56M Base v0.6 was initialized from random weights and trained using the corrected next-token causal objective.
The target stack is browser UI → Go backend → llama.cpp → GGUF, with no cloud inference required.
The working system is being built as a full language-model pipeline rather than a wrapper around another hosted model.
Earlier base checkpoints appeared to improve by loss while generation stayed broken. An audit found a double label shift: the dataset shifted targets once, and the model shifted them again. The effective task was two-token-ahead prediction. v0.6 starts over from random weights with the corrected one-token-ahead objective.
dataset: x = A B C D
dataset: y = B C D E
model shift: logits A B C vs labels C D E
A → C B → D C → E ✗dataset: x = A B C D
dataset: y = A B C D
model shift: logits A B C vs labels B C D
A → B B → C C → D ✓Darija is widely used in everyday Moroccan life but underrepresented in language-model tooling, especially in mixed Arabic/Latin writing and code-switching. MoroLM explores whether a compact local model can become genuinely useful for Moroccan institutions, education and private on-premise applications.