Chapter 4: Implementing a GPT Model from Scratch to Generate Text