AI GLOSSARY · AI CONCEPTS

Batch size

Markdown version

Definition

In machine-learning training, batch size is the number of examples used in one training iteration before a parameter update; it may be one, a subset, or the full training set.

In plain language

Training can calculate an update from one example, from a smaller group called a mini-batch, or from the full training set. Batch size is the number of examples included in that calculation. Smaller groups produce more updates while processing a dataset; full-batch training uses all examples for one update. Batch size is a hyperparameter chosen for the training procedure, not a value learned by the model. It is distinct from an epoch, statistical sample size and an API batch of requests.

Technical definition

Google defines a batch as the examples used in one training iteration and batch size as the number of examples in that batch. A size of 1 corresponds to stochastic gradient descent; full-batch training uses the entire training set; mini-batch training uses a subset. Stanford's CS231n material illustrates computing a gradient over a sampled mini-batch and then performing a parameter update. For a training set containing N examples and batch size B, the number of batches needed to cover one epoch is ceil(N / B) when the final partial batch is retained. Here the denominator is B, the number of examples per batch; data-loader choices can instead discard a partial final batch.

Worked examples in this catalogue

Catalogue examples point at a skill, guide or coding tool listed on this site, with what to run and what you see. An example marked illustrative describes the item from its own documentation; it was not executed for this page. Platform Scores are our assessment under a published method, not a safety guarantee.

  1. Skill by Skill Almanac · Illustrative, not executed

    sample-size-calculator 41/100 · Provisional, not yet measuredScored · Method v0.2 · How we score

    What you see
    Illustrative contrast: calculate the planned number of subjects per group for specified statistical designs, effect sizes, alpha and power assumptions.
    Why it exercises the concept
    This clarifies a frequent terminology error: study sample size concerns how much data to collect, while training batch size concerns how many existing examples contribute to one update. The skill does not select or test an optimizer batch size.

How it shows up when you use agents

This entry uses the machine-learning training sense of batch size. A batch is the set of examples used in one training iteration, and batch size is the number of examples in that set. An agent may encounter the setting while explaining a training configuration, reviewing a training loop or diagnosing why the expected number of updates does not match the dataset size.

The setting covers three cases. A batch size of one uses one example for an update and corresponds to stochastic gradient descent in Google's glossary. A mini-batch uses a subset of the training data. Full-batch training uses the entire training set for an update. For N training examples and a batch size B, covering the data takes ceil(N / B) batches when a final partial batch is retained. In that formula, the denominator B is explicitly the number of examples per batch. A training pipeline may instead discard the final partial batch, so inspect that choice before reconciling counts.

A useful reader action is to write down the training-set size, configured batch size and treatment of the final partial batch, then compare the expected count with the training log. The sample-size-calculator skill is an illustrative catalogue contrast: it estimates subjects per group for specified statistical study designs. It does not choose or benchmark a training batch size.

Common confusions

Batch size versus epoch. Batch size counts examples per training iteration. An epoch is one pass over the training set. Several batches usually make up an epoch.

Mini-batch versus batch size. A mini-batch is a subset used for an update. Batch size is the count of examples in whichever batch strategy is used.

Batch size versus sample size. Statistical sample size concerns the observations collected for a study or dataset. Training batch size partitions available training examples for parameter updates.

Training batch versus API batch. An API may group independent requests for scheduling or processing. That operational use of “batch” is not the optimizer setting defined here.

One universally correct value. Batch size is a hyperparameter. The supplied sources define the strategies and show mini-batch updates, but they do not establish one value that is best across models, datasets or hardware.

Terms that mention Batch size

4 terms mention this one

More in AI concepts

Next steps

  1. sample-size-calculator A skill that exercises it.
  2. Epoch (machine learning) Related term.
  3. Stochastic gradient descent (SGD) Related term.
  4. All glossary terms A to Z and by family.

Sources

Definitions are written by Skill Almanac from these sources and were checked against them on 2026-11-25. Wikipedia is never the only source.

Review record

Last verified

Drafted by claude-sonnet-5-5; revisions: OpenAI Codex (configured gpt-5.6-sol); sources and example targets checked by Independent automated source review (OpenAI Codex); not human peer review on 2026-11-25. Last verified .

Change log (5)
  • : Independent automated factual/example/alias correction review closed with transparent bounded followups and simulated-reader blocker closure. Cached broad US definition demand; AI-exclusive share unmeasured. Final runtime gate separate; publication disabled.
  • : Private correction of independent source/example/alias and reader findings; exact-version closure and runtime gates pending. Cached broad US definition demand, not AI-exclusive traffic.
  • : First version.
  • : Verifier pass: applied wording corrections from the verification list.
  • : Automated review completed; approved for the staged public release. Search indexing is controlled by the release configuration.