SML
(2025)
A small GPT-style language model written and trained from scratch, to understand what actually happens inside one rather than calling an API. It is a decoder-only transformer with 6 layers, 6 attention heads, 384-dimensional embeddings and a 128-token context window, using the GPT-2 byte-pair tokenizer through tiktoken.
It was trained on the TinyStories dataset on a single GPU for 20,000 steps, with AdamW and weight decay, a linear warm-up into cosine decay, gradient clipping and mixed precision. The training loop follows the structure of Karpathy’s nanoGPT; the point was to build and debug each piece by hand.
Given “Once upon a time there was a pumpkin.” it carries on with short, mostly grammatical story sentences before drifting, which is about what a model this size can do. Next steps are rotary position embeddings for longer context and a conversational fine-tune.

