faTok: A Persian-First Tokenizer for Standard, Colloquial and Latin-Script Persian and the Iranian Languages
Multilingual tokenizers split Persian into 1.7–3.1 tokens per word, and they do worse on colloquial Persian, on Persian written in Latin letters (Finglish) and on the Iranian languages spoken alongside it. We present faTok, a 64K byte-level BPE tokenizer trained on 1.3 GB of standard, colloquial and classical Persian, Finglish, eleven Iranian languages and South Azerbaijani. On held-out text it needs 1.30 tokens per word for standard Persian, against 1.56 for PersianMind and 1.72 for Gemma-3, the best multilingual tokenizer we tested, and it is lossless in every script. Two pre-tokenization rules matter for Persian: a lossless dummy prefix makes the first word of a line tokenize like any other word (15–20% fewer tokens there), and splitting inflectional suffixes at the zero-width non-joiner cuts wrongly segmented ZWNJ words from 31% to 21% for 1% more tokens. Because no real corpus of chat-style Finglish exists, we build one by transliterating colloquial Persian. Finally, we train the same small language model on the same 200 MB of Persian with four tokenizers. With faTok it reaches 1.31 bits per byte on standard Persian, against 1.37–1.54 for the others; it is best on all six test sets across three seeds and with a byte-matched context, and it trains 2–5× faster than the large-vocabulary baselines. Tokenizer, code and evaluation sets are released under the MIT license. Files: fatok.pdf (the paper, CC BY 4.0) and fatok-0.3.0.tar.gz (the faTok Python package with the tokenizer, MIT license).
Authors
- Hassan Bazai (ORCID: https://orcid.org/0000-0001-9102-3715)
Institutions
- Persian Gulf University (IR)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-12-03
- DOI
- https://doi.org/10.5281/zenodo.24774186
- Primary Topic
- Natural Language Processing Techniques
- Type
- preprint