sumanentc/attention-span — explained in plain English
Analysis updated 2026-05-18
Study a from-scratch implementation of a GPT-124M style model.
Reproduce pretraining on the TinyStories dataset.
Learn how instruction fine tuning changes model behavior with before and after results.
Review documented training optimizations like mixed precision and gradient accumulation.
| sumanentc/attention-span | agostynah/distributed-vector-memory-routing | akashsingh3031/python-libraries | |
|---|---|---|---|
| Stars | 0 | 0 | — |
| Language | Jupyter Notebook | Jupyter Notebook | Jupyter Notebook |
| Last pushed | — | — | 2020-12-03 |
| Maintenance | — | — | Dormant |
| Setup difficulty | hard | moderate | easy |
| Complexity | 4/5 | 3/5 | 1/5 |
| Audience | researcher | researcher | vibe coder |
Figures from each repo's GitHub metadata at analysis time.
Training was run on an A100 GPU via Google Colab, reproducing it costs roughly $1.50 in compute.
attention-span is a personal learning project that builds small language models from scratch and documents everything the author learns along the way. It is organized as a collection of training scripts, Jupyter notebooks, and written notes rather than a packaged tool, so it reads more like a study log than a product. The first and main model in the repository is a GPT-124M style model, meaning it has roughly 124 million parameters, built with 12 layers and 12 attention heads. It is trained on TinyStories, a public dataset of short, simple children's stories designed for training small models that can still write coherent narrative text. The notebooks walk through building the model architecture step by step, then take that pretrained model and instruction fine tune it on a synthetic set of instruction and response examples generated from the same TinyStories dataset. The repo includes before and after results from this fine tuning process. Before fine tuning, the model ignored instructions entirely and produced unrelated text. After two epochs of fine tuning on a single A100 GPU, it consistently followed the expected instruction and response format and its ROUGE score, a measure of how closely generated text matches a reference, roughly doubled. The author also notes clear remaining weaknesses, including trouble following multiple required keywords at once and a tendency to repeat similar characters and plots under simple decoding. Beyond the core training script, the project documents a long list of performance optimizations it applies, such as mixed precision training, gradient accumulation to simulate larger batches, and techniques borrowed from Andrej Karpathy's nanoGPT project. The full training run described costs roughly a dollar and a half in cloud GPU time on Google Colab. The full README is longer than what was shown.
A personal project documenting a from-scratch build of a small GPT-style language model, including pretraining and instruction fine tuning on TinyStories.
Mainly Jupyter Notebook. The stack also includes Python, PyTorch, Jupyter Notebook.
The README does not state a license.
Setup difficulty is rated hard, with roughly 1h+ to a first successful run.
Mainly researcher.
This repo across BitVibe Labs
Verify against the repo before relying on details.