Epoch

IntermediateDeep Learning

Last updated October 1, 2026

What is an Epoch in simple terms?

In simple terms, an epoch is one full pass of an AI through all its training data — like reading a textbook cover to cover once. Models usually read it many times over, learning a bit more on each pass.

Epoch explained

An epoch is one complete pass of a machine learning model through the entire training dataset during training; models typically train for many epochs, seeing the same data repeatedly so they can keep refining what they've learned.

Training a machine learning model means showing it the training data and letting it adjust itself to do better. An epoch is the unit that counts how many times it has been through all of that data. One epoch means the model has seen every example in the training set exactly once. Almost always, a single pass isn't enough — just as you rarely master a subject by reading the textbook through only once — so training runs for many epochs, looping over the same data again and again, with the model getting a little better each time. The number of epochs is a setting chosen in advance (a hyperparameter), and it's essentially a measure of how long the model trains.

It helps to see how an epoch relates to a couple of neighboring ideas. Within one epoch, the data is usually processed in smaller groups called batches rather than all at once, and the model makes an adjustment after each batch — so one epoch contains many small updates, and the whole training run contains many epochs. The textbook analogy stretches nicely here: an epoch is one read-through of the entire book; a batch is one chapter you absorb before pausing to take stock; and the full course of study is many read-throughs. Each complete pass deepens your grasp, but only up to a point.

That "up to a point" is the crux of choosing how many epochs to run, and it's a genuine balancing act. Too few epochs and the model hasn't had enough exposure to learn the patterns properly — it underfits, like skimming the book once and missing half of it. Too many epochs and the model starts memorizing the exact training examples, quirks and all, rather than learning the general lesson — it overfits, like a student who has reread the same practice questions so many times they can recite the answers but can't handle a new question. The skill is stopping at the sweet spot, where the model has learned the real pattern but hasn't started memorizing. In practice this is often handled by watching performance on held-out data and stopping training when it stops improving — a tactic called early stopping — rather than guessing the perfect number of epochs in advance.

Real-world example of an Epoch

An agricultural startup trains a model to spot a fungal disease in photos of wheat leaves, using 20,000 labeled images. The team sets the run for 40 epochs, so the model will work through all 20,000 photos forty times, and after each epoch the software checks it against 2,000 photos it never trains on. The log tells the story. Accuracy on those held-back photos climbs quickly over the first dozen epochs, peaks around epoch 17, then starts slipping, even though accuracy on the training photos keeps rising. From that point on, the model is learning the quirks of its own photo set rather than the disease. So the team keeps the copy of the model saved at epoch 17 and discards the rest, a routine practice known as early stopping.

Frequently asked questions about Epochs

What is the difference between an epoch and a batch?

They're nested units of training. A batch is a small group of training examples the model processes before making one adjustment to itself. An epoch is one complete pass through the entire training dataset — which means a single epoch is made up of many batches, one after another, until all the data has been seen once. So a batch is a chunk within a pass, and an epoch is a whole pass. Training typically runs for many epochs, and within each one the model works through every batch in turn.

How does an epoch work?

In one epoch, the model goes through the whole training dataset, usually a batch at a time, making a small adjustment to its internal settings after each batch. Once every example has been seen once, that epoch is complete and the next one begins, looping over the same data again. With each epoch the model generally improves, because the repeated exposure lets it keep refining what it learned. Training continues for a set number of epochs, or until performance on separate held-out data stops improving, at which point it's usually stopped to avoid overdoing it.

What is an epoch used for?

The number of epochs is used to control how long a model trains, making it one of the standard settings every training project decides. Choosing it well is a balance: too few and the model underfits, never learning the pattern properly; too many and it overfits, memorizing the training data instead of generalizing. Practitioners tune the number of epochs alongside batch size and learning rate, and frequently use early stopping — halting once a model stops improving on unseen data — to land near the right amount automatically.