Build nanoGPT is an educational reproduction of GPT-style language-model training built step by step from an initially empty file. Its Git history is intentionally organized so learners can follow each architectural and training improvement as it is introduced. The accompanying video lecture explains how the code develops into a reproduction of the 124-million-parameter GPT-2 model. The project covers tokenization, transformer architecture, optimization, distributed training, data loading, and performance improvements. It includes FineWeb data preparation and HellaSwag evaluation utilities. With sufficient computing resources, the same general code can scale toward larger GPT-3-style configurations. The repository focuses on pretraining rather than instruction tuning or conversational fine-tuning.
Features
- GPT-2 reproduction from scratch
- Step-by-step educational Git history
- Transformer model implementation
- FineWeb training data preparation
- HellaSwag model evaluation
- GPU and distributed training optimizations