Skip to main content

Batch Size and Epochs

Batch Size and Epochs

  • Core concepts
  • Stage 4 · Under the Hood
  • refs checked 2026-11-17
What problem it solves

Batch size is how many examples one update sees; an epoch is one full pass over the data.

What it is
Batch size affects gradient noise, memory use and throughput; epochs affect how often the model sees the data. Both couple with the learning rate: change the batch size and the suitable learning rate usually changes too.
An epoch is one pass over the dataset; batch size sets how many examples each update sees. Together they set the number of updates.
An epoch is one pass over the dataset; batch size sets how many examples each update sees. Together they set the number of updates.
Why it matters

“Train for three epochs” is not a universal recipe. Data volume, task difficulty and overfitting signals decide how many passes are right.

Chinese aliases

Sources
  • PyTorch datasets and DataLoader tutorial ↗
  • PyTorch optimization loop tutorial ↗
Use this term in a task

Don’t stop at the definition: use the task handbook for the order and checks, or filter three tool candidates for the job at hand.

Task handbooks → · Filter three candidates →