presentsUNAIVERSE
The UN AI timeline

Learn AI /How Machines Learn /Epoch, batch and iteration

Epoch, batch and iteration

Also called: epoch, batch, mini-batch, iteration.

Detail

In five seconds

What it is

These words describe units within training: a batch groups examples, an iteration is an update step, and an epoch is one full dataset pass.

In plain words

Think of training as studying from a large stack of examples. A batch is one small pile you look at at a time. An iteration is one study-and-adjust step using that pile. An epoch is finishing the whole stack once.

An everyday example

Amina is tuning a radio to get a clear signal during a long drive. She does not listen to the whole programme before touching the dial again. Instead, she listens for a few seconds, notices the static, makes a small adjustment, then listens to the next few seconds and adjusts again. After she has sampled short sections from the whole programme once, that is like one full pass; if the signal is still not clear enough, she repeats the cycle.

Where the story stops working

A radio signal already exists, and Amina is adjusting a receiver to match it. In model training, the parameters are changed using mathematical gradients from many examples, not by human listening. Also, batches are usually selected from stored data, often shuffled, rather than arriving as fixed time slices of a broadcast.

Remember thisA batch is the group of examples used for one parameter update, an iteration is that update step, and an epoch is one complete pass through the training set.

Understand it

Understand it

Why it matters

These words affect time, cost, stability and quality during training. If you hear that a model trained for 20 epochs, that does not tell you much unless you also know the batch size and dataset size. A small batch can make updates noisier but sometimes helps generalisation; a very large batch can be efficient on some hardware but may need different learning settings. Iteration counts matter for progress monitoring, while epoch counts matter for judging how many times the model has revisited the data. For non-specialists reviewing a project, these terms help you ask better questions: How many examples were used per update? How many full passes were made? Was the model checked on validation data, or did it simply train for more epochs and risk overfitting?

How batch, iteration and epoch fit together

After viewing, the reader should be able to explain that one iteration uses one batch for one update, and one epoch is the set of iterations needed to cover the whole training dataset once.

  1. 01

    Full dataset

    Start with the complete training set, shown as 12 example cards.

    Draw 12 small rectangles in one container labelled “training data: 12 examples”. Number them 1 to 12.

  2. 02

    Split into batches

    Choose a batch size of 4, so the 12 examples are processed as 3 batches.

    Group the 12 rectangles into three outlined groups of four, labelled “batch 1”, “batch 2”, and “batch 3”.

  3. 03

    One iteration

    For each batch, the model makes predictions, calculates error, and updates parameters once.

    From each batch, draw an arrow to a box labelled “forward pass + error + update”. Under each arrow, label “1 iteration”.

  4. 04

    One epoch

    After all 3 batches have been used once, the model has completed one epoch.

    Bracket the three iteration boxes together with a label above: “1 epoch = 3 iterations here”.

  5. 05

    Repeat if needed

    Training usually continues for multiple epochs, often with examples reshuffled between epochs.

    Show a second row for “epoch 2” with the same 12 examples in a different order and the same three-batch structure. Add a small note: “same data, new pass”.

Show a dataset of 12 examples split into 3 batches of 4. Read left to right: each batch feeds one update step, and all three updates together make one epoch. Then show the sequence repeating for epoch 2, with the same count structure but a note that order may be shuffled.

On hover or tap, highlight one batch and show the formula: iterations per epoch = number of examples divided by batch size, rounded up when needed.

Describe this without the diagram

The diagram explains the relationship between dataset size, batch size, iteration and epoch using 12 training examples. First, 12 examples are shown as the full dataset. Next, they are divided into three batches of four examples each. Each batch goes through one update step, labelled as one iteration. Because there are three batches, there are three iterations in total. A bracket groups those three iterations and labels them as one epoch, meaning one complete pass through all 12 examples. A second row shows epoch 2, where the same 12 examples appear again, possibly in a different order, to show that another epoch repeats the process over the full dataset.

With reduced motion: A static two-row diagram. Row one shows 12 examples split into 3 batches, each batch connected to one update step, with a brace marking all 3 updates as epoch 1. Row two repeats the same structure for epoch 2 with the example order changed.

When a model learns from examples, the training data does not always go through all at once. A batch is a group of training examples processed together. A mini-batch is just a batch that is smaller than the whole dataset; in practice, most modern training uses mini-batches, so people often say “batch” when they mean “mini-batch”.

An iteration usually means one parameter update step. In that step, the model takes one batch, makes predictions for those examples, compares them with the target signal, computes an error, and adjusts its internal numbers, called parameters. What goes in is one batch of examples, often with features and labels in supervised learning. What comes out is an updated model.

An epoch means one full pass through the entire training dataset. If a dataset has 1,000 examples and the batch size is 100, one epoch contains 10 iterations. If the batch size is 1, one epoch contains 1,000 iterations. If the batch size is 1,000, one epoch contains 1 iteration.

These terms are related but not interchangeable. Batch size tells you how many examples are used per update. Iteration tells you how many update steps have happened. Epoch tells you how many times the full dataset has been seen. People sometimes use the words loosely, so it helps to check which definition a course, paper or software library is using.

How “Tuning a radio station in small adjustments” maps onto the real thing

In the storyIn the AI system
a few seconds of audio checked at one timeone batch or mini-batch of training examples
one small turn of the tuning dialone iteration with a parameter update
sampling short sections across the whole programme onceone epoch across the full dataset
repeating the cycle several timestraining for multiple epochs

A worked example

Training a classifier to sort sanitised multilingual helpdesk summaries into broad cyber-event categories for an aggregate progress report.

Starting from: 1,200 labelled summaries, a batch size of 100 and a training run of 5 epochs.

  1. The 1,200 summaries form 12 batches of 100. If the final batch were incomplete, it would still count as an iteration.
  2. At each iteration, the model makes predictions for one batch, calculates the loss, backpropagates the gradients and updates its parameters once.
  3. After 12 iterations, the model has used every training summary once, completing one epoch.
  4. The summaries are commonly shuffled before the next epoch, but they remain the same training set.
  5. Five epochs produce 60 parameter updates: 12 iterations per epoch multiplied by 5.

Result: The run ends after five complete passes through the training set and 60 updates. The resulting model is then assessed on separate validation or test data before any aggregate figures are included in the progress report.

In a United Nations workplace

A security analyst in Panama City is testing a classifier that sorts sanitised helpdesk summaries in English, French and Spanish into broad cyber-event categories. The aggregate results are needed for a quarterly progress report to a donor, due to the front office for clearance at close of business.

With 1,200 labelled summaries and a batch size of 100, each epoch takes 12 iterations. Knowing the distinction lets the analyst estimate whether five epochs, meaning 60 parameter updates, will finish before the reporting deadline and interpret whether a training chart records loss after each update or after each full pass.

Before you try thisRaw security logs, staff identifiers, access details and operational incident records must not be entered into a tool that has not been approved for such material. Training must use an approved secure environment and appropriately minimised data, because disclosure could expose individuals, systems or security controls.

Where you may hear it

  • A vendor demonstration to an ICT governance board
  • A model-tuning review before a progress report is cleared
  • A technical discussion with an implementing partner
  • A procurement evaluation of proposed training infrastructure

Avoid confusion

Avoid confusion

Often confused with

Common misconceptions

  • Common misconception: An epoch, a batch and an iteration are three words for the same thing.

    Correction: They measure different parts of training. A batch is the group of examples used together. An iteration is one update step using one batch. An epoch is the collection of iterations needed to use the full training dataset once. They are linked, but they are not interchangeable.

  • Common misconception: More epochs always mean a better model.

    Correction: More epochs mean the model sees the training data more times, but performance on new data may stop improving or even get worse. That is why teams watch validation results, not just training progress. Extra epochs can lead to overfitting, where the model matches the training set too closely.

  • Common misconception: Batch size only changes speed, not learning behaviour.

    Correction: Batch size affects both computation and the pattern of updates. Smaller batches usually produce noisier gradient estimates, which can change convergence behaviour and sometimes help or hurt generalisation. Larger batches can be more hardware-efficient, but they may require different learning rates or schedules.

  • Common misconception: One iteration means one example was processed.

    Correction: That is only true when batch size is 1. In most modern systems, one iteration uses many examples at once, often tens, hundreds or more, depending on the task and hardware.

Quick check

A dataset has 10,000 training examples and batch size 500. If the model trains for 4 epochs, how many iterations happen in total?

Go deeper

Go deeper

The simple version

Think of training as studying from a large stack of examples. A batch is one small pile you look at at a time. An iteration is one study-and-adjust step using that pile. An epoch is finishing the whole stack once.

The technical version

Let a training set contain N examples and let batch size be B. In mini-batch gradient-based training, each iteration performs a forward pass on one batch, computes a loss, backpropagates gradients, and updates parameters once. An epoch is one complete pass through the training set, so it takes about N/B iterations per epoch, or ceil(N/B) if the last batch is smaller. In practice, data are often shuffled between epochs. The terms are also used somewhat differently across tools: some logs report progress by iteration or step, others by epoch, and some use “batch” loosely to mean any update unit. These terms describe training procedure, not inference. They also do not by themselves tell you whether the learning is supervised, self-supervised or another training setup.

Reviewed external resources

Where this came from

Drafted with a language model through an offline pipeline, checked against this site's schema, and every external link above fetched to see whether it answers. Treat it as a starting point and check anything that matters against the primary sources. How this site is built and what that means.

The one thing to remember

A batch is the group of examples used for one parameter update, an iteration is that update step, and an epoch is one complete pass through the training set.