Home › Glossary › Fundamentals › Batch

Beginner · Fundamentals

Batch

Visual diagram · (in preparation) · Math · (in preparation) · Worked example · 3 difficulty levels.

TL;DR. A group of training examples processed together in a single forward and backward pass.

Technical Definition

A group of training examples processed together in a single forward and backward pass.

How it works

Batching uses hardware (GPUs, TPUs) efficiently and produces a more stable gradient estimate than single-sample updates. Larger batches give smoother gradients but require more memory and can hurt generalization; smaller batches are noisier but often generalize better.

Related Concepts

  • Gradient Descent — An optimization algorithm that iteratively adjusts model parameters by moving in the direction of steepest decrease of the loss function.
  • Training — The process of adjusting a model's parameters so it learns patterns from labeled or unlabeled data.
  • Mini-batch — A small subset of the training data used to compute one gradient update.