Project case study · Flagship model · Persian NLP · From-scratch training
Persian GPT from scratch: a Persian language model
An end-to-end Persian language-modeling experiment, from preparing a cleaned Wikipedia corpus and building a tokenizer to training a decoder-only Transformer and comparing held-out perplexity against n-gram baselines.
01 · Context
Research question
Persian has fewer openly documented from-scratch training examples than high-resource languages. The goal here was to build a transparent, reproducible baseline workflow and document what the resulting language-model metric does and does not establish.
02 · Methods
Approach
- Cleaned and prepared 855,724 Persian Wikipedia documents, totaling about 244 million training tokens.
- Trained a custom 32,000-token byte-pair encoding tokenizer on the prepared corpus.
- The model card describes a 12-layer decoder-only Transformer trained in PyTorch for two epochs; a separate public safetensors-header audit found 134,994,432 stored tensor elements versus the card's intended 110.4M design.
- Evaluated the held-out split with loss and perplexity, then compared perplexity with unigram and interpolated 5-gram baselines.
03 · Evaluation
Reported results
- Held-out test perplexity: 14.52; validation perplexity: 14.02.
- The held-out interpolated 5-gram baseline perplexity was 171.60, and the unigram baseline was 1,590.26.
- At published revision b443d45edab7a464edb25f49d0c4b44f05f4a739, the public checkpoint stores 134,994,432 tensor elements, independently enumerated from its safetensors header; this does not resolve runtime tying.
04 · Scope
Limitations
This small research portfolio model is trained on Wikipedia rather than a broad conversational distribution. The independently inspected file stores 134,994,432 tensor elements; the model card states 110.4M, and the output head is explicitly stored. Weight equality and runtime tying have NOT been checked, and the author-reported perplexity 14.52 is not independently reproduced. No factuality, safety or downstream usefulness has been established.