Welcome to 10 Days of AI Basics. If you do not know me, I’m Harper. I have a decade of experience in AI: a M.S. & B.S. from Stanford University in computer science for artificial intelligence, 4 years building AI at Meta, and was Founding Engineer and then Head of AI/ML at a startup acquired by NVIDIA. I also love to teach, and at Stanford I TAed CS courses, including a PhD-level core AI course called Decision Making Under Uncertainty.
Welcome back to 10 Days of AI Basics. Yesterday, on Day 4, we discussed model training. If you haven’t yet read that, I recommend reading it first. Today, on Day 5, we’re exploring the mechanics of the training process: epochs, batches, iterations, and validation.
If you’d like to see my YouTube video on this, you can watch it below. You can also watch the 90-second overview here.
An “epoch” is one full pass through the entire training dataset. If your training data were a book, one epoch would be reading it cover to cover. After one epoch, the model has seen every single example in your set. Most models train for many epochs - reading that book over and over - getting a little better at understanding the plot each time.
An “iteration” (often called a step) is when the actual learning happens. It’s the moment the model adjusts its internal parameters based on data. While you could read the whole book before taking notes (one epoch = one iteration), that is very slow and memory-heavy for computers. Instead, we use batches.
A batch is a small slice of your data, like 32 images out of a set of 1,000. The model looks at one batch, updates its parameters (one iteration), then moves to the next batch. For example, if you have 1,000 images and a batch size of 50, it takes 20 iterations to finish 1 epoch. The model updates its brain 20 times before it finishes the book once.
Validation is the process of periodically testing the model on data it has never seen before. We set aside a separate validation set that stays hidden during the learning process. This is used to catch overfitting. Overfitting happens when a model memorizes the specific examples in the training set instead of learning the underlying patterns. It is like a student memorizing the specific answers to a practice test instead of learning the actual math formulas. If training performance is high but validation performance is low, the model is overfitting.
Putting it all together: we divide the data into batches, process a batch and update parameters (one iteration), repeat until the whole dataset is seen (one epoch), and run a validation check to assess whether the model is actually performing well. We repeat this for many epochs and stop when validation performance stops improving.
(Image created in one shot by Google’s Nano Banana Pro!)
Everything else in AI is just optimizing and refining this loop. Please leave your questions in the comments, and I’ll see you tomorrow for Day 6.
No posts

Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.