Batch size is the number of training examples used to calculate a gradient before the model updates its parameters. As a training hyperparameter, it influences convergence stability and speed alongside the learning rate and number of epochs. section 8.1.1
Batch size matters because it shapes each optimization step:
- Larger or smaller batches change how many data points contribute to each gradient calculation, affecting convergence stability and speed. section 8.1.1
- Training configuration balances batch size with available memory; gradient accumulation can help fit fine-tuning within limited VRAM. section 7.5
- Batch size works with learning rate, epochs, and regularization choices rather than determining training quality in isolation. section 8.1.1
Translation fine-tuning configuration
A Gemma 3 270M English–Spanish fine-tuning workflow passes a batch-size variable into SFTConfig as per_device_train_batch_size=bs and combines it with gradient_accumulation_steps=gas. The configuration is designed to accommodate limited VRAM while training on formatted OPUS-100 examples. section 7.5











