Your mini-GPT is built and gradient-checked — now train it. Learn batching and data loading, the Adam optimizer, the training loop that actually drops the loss, and how to monitor training and overfitting — then train your GPT on the Lantern Bay corpus in NumPy until it learns the text.
Welcome to Training a Tiny GPT, the seventh module — the moment the model stops being a static piece of math and starts learning. You’ve built the mini-GPT and proven every gradient correct. Now you’ll feed it data, run the optimization, and watch the loss fall from the random baseline of about 3.18 toward a model that has genuinely absorbed the Lantern Bay text.
You’ll build each piece of the training machinery from scratch. Batching and data loading samples random fixed-length chunks from the corpus and shifts them into input/target pairs. The Adam optimizer — with its running averages of the gradient and its square, plus bias correction — is what makes transformer training converge quickly, and you’ll implement it yourself. Then the training loop ties it together: forward, loss, backward, update, repeat — and you’ll run it for real and see the loss drop. Finally you’ll learn to monitor training, splitting train from validation to watch overfitting on the small corpus and reading the loss curves the way a practitioner does. The guided project runs a complete training session and hands you a trained model, ready to generate text in Module 8.
Start with Lesson 1, where the corpus becomes a stream of training batches.
Complete all 5 lessons to finish the Training a Tiny GPT module.