Building a GPT from Scratch with yoctoGPT in PyTorch (1)
GPT from Scratch: Architecture and Character-Level Training β Session 1 π§ Build a working GPT model from scratch in pure PyTorch β and train it on a free Google Colab T4 GPU in under a minute. In this first session of our free 3-part webinar series, Dr. Yves J. Hilpisch walks through the yoctoGPT project: a minimal, readable GPT implementation with no external model frameworks, no magic, just clear PyTorch code. π Topics in this session: β’ Why build a GPT from scratch? Understanding over abstraction β’ Transformer architecture refresher: self-attention, embeddings, residuals β’ yoctoGPT project overview: modules, CLIs, installation β’ Character-level data preparation pipeline β’ Notebook 1: training a tiny GPT on a philosophy corpus β’ Sampling strategies: temperature, top-k, top-p (nucleus) β’ Text quality metrics: readability, diversity, Char-KL β‘ Measured results on a free T4 GPU: β’ Tiny model (2L/128d): ~40s, val loss 1.36, ~75 it/s β’ Deeper model (6L/384d): ~109s, val loss 1.37, 13.7 it/s β’ Deeper gpt_fast (SDPA): ~219s, val loss 1.41, 10.3 it/s β’ Key insight: on a small corpus, the tiny model wins β more parameters without more data means overfitting π Resources: π Slides: https://tpq.io/tpq_yoctogpt_1.pdf π Notebook repo: https://github.com/yhilpisch/yoctoGPT π TDS: https://thedatascientist.dev π CPF: https://python-for-finance.com π€ TAE: https://theaiengineer.dev βΏ TCE: https://thecryptoengineer.dev π Disclaimer: This content is provided solely for illustration and educational purposes. Training texts consist primarily of public-domain works. No warranties or guarantees of any kind are given. Use at your own risk. #GPT #PyTorch #Transformer #MachineLearning #DeepLearning #CharacterLevel #LanguageModel #GoogleColab #AIEngineering #LLM #AttentionIsAllYouNeed #yoctoGPT