← AI glossary

Batch size

How many examples the model processes together in one training step.

Instead of updating after every example, the model looks at a batch and updates once. Bigger batches use the GPU more efficiently but need more memory.

When memory is short, gradient accumulation combines several small batches to act like a large one.

Example

Out of memory on an L4? Drop batch size from 8 to 2 and set gradient accumulation to 4.

বাংলায়: ব্যাচ সাইজ — এক ধাপে মডেল কয়টি উদাহরণ একসাথে দেখে।

Try it on a real AI Computer

JupyterLab opens in about a minute. Pay in taka with bKash, billed by the minute — stop whenever you like.