What is the distinction between an epoch, a batch, and an iteration?

Quick Overview

Asks for the difference between an epoch, a batch and an iteration when training a model with gradient descent. It tests the definitions, the arithmetic linking dataset size, batch size and number of updates, and why a batch size change affects training schedules.

What is the distinction between an epoch, a batch, and an iteration?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: easy

Interview Round: Other

What is the distinction between an epoch, a batch, and an iteration? ```hint Count the updates Relate the three terms through the number of training examples $N$ and the batch size $B$, and ask how many parameter updates one pass over the data produces. ``` ### What a Strong Answer Covers - A precise definition of each term - How the batch size maps to batch, stochastic and mini-batch gradient descent - The arithmetic linking dataset size, batch size, iterations and epochs - Why the distinction matters when you change the batch size or set schedules ### Follow-up Questions - With 10,050 examples and a batch size of 100, how many iterations are in one epoch, and what happens to the last batch? - You double the batch size and keep the number of epochs fixed. What changes, and how might you adjust the learning rate? - With gradient accumulation over 4 micro-batches, what counts as one iteration? - When the dataset is a stream or too large to pass over even once, how would you measure training progress?

Overview: Asks for the difference between an epoch, a batch and an iteration when training a model with gradient descent. It tests the definitions, the arithmetic linking dataset size, batch size and number of updates, and why a batch size change affects training schedules.

PracHub logo
General
Nov 25, 2026
easyMachine Learning EngineerOtherMachine Learning
0
0

What is the distinction between an epoch, a batch, and an iteration?

What a Strong Answer Covers Guidance

  • A precise definition of each term
  • How the batch size maps to batch, stochastic and mini-batch gradient descent
  • The arithmetic linking dataset size, batch size, iterations and epochs
  • Why the distinction matters when you change the batch size or set schedules

Follow-up Questions Guidance

  • With 10,050 examples and a batch size of 100, how many iterations are in one epoch, and what happens to the last batch?
  • You double the batch size and keep the number of epochs fixed. What changes, and how might you adjust the learning rate?
  • With gradient accumulation over 4 micro-batches, what counts as one iteration?
  • When the dataset is a stream or too large to pass over even once, how would you measure training progress?