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

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
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
preprint

Building a Small Marathi GPT Language Model from Scratch

Purushottam Patil, Yogesh Shinde, Kuldeep Bhise, Aditya Patil et al.
Zenodo (CERN European Organization for Nuclear Research)
Topic Modeling
preprint

Building a Small Marathi GPT Language Model from Scratch

Purushottam Patil, Yogesh Shinde, Kuldeep Bhise, Aditya Patil, Digambar Takale
preprint en

Abstract

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.

Zenodo (CERN European Organization for Nuclear Research)
Topic Modeling
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon