This notebook builds a complete GPT (Generative Pre-trained Transformer) model from scratch using PyTorch. It covers tokenization, self-attention, multi-head attention, transformer blocks, and text generation and all explained step-by-step with a simple nursery rhyme corpus.
attention gpt attention-mechanism attention-is-all-you-need multi-head-attention multi-head-self-attention generative-pretrained-transformer generative-pre-trained-transformer gpt-from-scratch generative-pretrained-transformers gpt-training
-
Updated
Dec 16, 2025 - Jupyter Notebook