Building a Small Marathi GPT Language Model from Scratch
This paper reports how we built a small GPT language model for Marathi from scratch, withoutusing existing model or tokenizer libraries. We started with a tiny autograd engine and moved up througha bigram model, an MLP, batch normalisation, hand-written backpropagation and a WaveNet-style modelto a transformer, following Andrej Karpathy's Zero to Hero lectures. For Marathi we trained our ownbyte-pair-encoding tokenizer with 2,048 tokens on Marathi Wikipedia text (about 2.96 million characters),and it compresses text 6.83 times compared with raw bytes. The final model has 1.73M parameters. After5,800 training steps its validation loss is 3.87 (perplexity 47.99, 2.16 bits per character) and it shows nosign of overfitting. Its samples stay on topic and get proper nouns and dates right, but the model is small,so longer outputs drift and it makes up facts. Everything ran on one laptop GPU. We also describe threeproblems that slowed us down: a biased sample when training the tokenizer, a decoding bug withmulti-byte Devanagari characters, and GPU power throttling. The zip file includes the source code and training dataset.
Authors
- Purushottam Patil
- Yogesh Shinde
- Kuldeep Bhise
- Aditya Patil
- Digambar Takale
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-12-03
- DOI
- https://doi.org/10.5281/zenodo.24782215
- Primary Topic
- Topic Modeling
- Type
- preprint