AIExplainer
Machine Learning Intermediate 2 min read

What is mini-batch?

A small subset of data used for training AI models

In AI, a mini-batch is a small group of data samples that are used to train a model at one time. This approach helps to speed up the training process and reduce the risk of overfitting.

Think of a mini-batch like a small class of students. Just as a teacher might divide a large group of students into smaller classes to make learning more manageable, a mini-batch divides a large dataset into smaller groups to make training an AI model more efficient.

Imagine training a self-driving car to recognize stop signs. A mini-batch might include 32 images of stop signs from different angles and lighting conditions. The model would process these 32 images, learn from them, and then move on to the next mini-batch.

Mini-batches are used in stochastic gradient descent, a popular algorithm for training neural networks. The model processes one mini-batch at a time, making predictions and adjusting its parameters based on the results.

Some people think that using mini-batches means the model is only trained on a small portion of the data. However, the model typically processes many mini-batches, each with a different subset of the data, to ensure it learns from the entire dataset.

The concept of mini-batches has been around since the early days of neural networks. However, it gained popularity with the development of stochastic gradient descent and the rise of deep learning.

batch mini-batch gradient descent stochastic batch

Three products for different needs — explore what’s relevant to you.