Epoch
An epoch is one complete pass through a training dataset, in which a model has processed every training example once.
Models rarely learn from a whole dataset in one go. The data is split into batches, and the model updates its parameters after each batch. An epoch is finished when every example in the training set has been through the model once. Training for ten epochs means the model has seen each example ten times.
Google's machine learning glossary gives the arithmetic. One epoch takes the number of examples divided by the batch size in iterations. With 1,000 examples and a batch size of 50, one epoch is 20 iterations, so 10 epochs is 200 updates to the model.
In classic machine learning, models are often trained for many epochs, and choosing how many is part of the job. Too few and the model has not learned enough; too many and it starts to memorise the training data and does worse on new data. Developers watch performance on a validation set and use early stopping to pick a sensible point.
Large language models are different, because they are trained on so much text that seeing it all even once is expensive. Data repetition has become a live question as developers approach the limits of available text. A 2023 study by Niklas Muennighoff and colleagues, covering 400 training runs on models up to 9 billion parameters, found that training on the same data for up to four epochs changed loss very little compared with fresh data, while further repetition brought steadily less benefit until extra compute added nothing.
A note for news readers: Epoch AI is a research group that publishes work on AI trends. Its name borrows the word, but stories about it are not about training epochs.
It is one full pass through the training data, so that the model has processed every example once. Training is usually measured in epochs, and a model may be trained for one epoch or for hundreds, depending on the task and the amount of data. A batch is the group of examples the model processes before one update. An iteration is that single update. An epoch is enough iterations to cover the whole training set once, which is the number of examples divided by the batch size. There is no fixed number. Developers track performance on validation data and stop when it stops improving. Small datasets often need many epochs, while large language models are trained on so much text that they see most of it only once or a few times. Yes, and that is what multiple epochs means. For language models, a 2023 study found that up to four epochs of repeated data worked almost as well as unique data, but the benefit of further repetition shrank towards nothing.Common questions
What is an epoch in machine learning?
What is the difference between an epoch, a batch and an iteration?
How many epochs should a model be trained for?
Can a model be trained on the same data more than once?
Search for "epoch vs batch vs iteration" or "number of training epochs" for the basics, and "data repetition language models" for the research on large models. Google's machine learning glossary and Crash Course and the documentation for training libraries are reliable on definitions; papers on arXiv cover the research. Remember that Epoch AI is a research organisation, so filter searches to avoid mixing the two.Finding more
Working out what this means for your business?
Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.