ChatGPT has put together a fantastic 2-hour tutorial where he builds a Generative Pretrained Transformer He goes through a step-by-step walkthrough starting from the basics, and following OpenAI's GPT2/GPT3 paper - Attention is All You Need