What optimization challenges arise when you use a batch size equal to the entire training set?

Quick Overview

Explain the problems that come with training a model using the entire training set as a single batch. Tests reasoning about compute per update, data redundancy, the role of gradient noise, curvature limits on the step size, and when full-batch methods are still a good choice.

What optimization challenges arise when you use a batch size equal to the entire training set?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

What optimization challenges arise when you use a batch size equal to the entire training set? ```hint Count the updates Compare how many parameter updates one pass over a million examples buys with a batch of 256 versus a batch of the whole set. ``` ```hint Think about what noise does Minibatch gradients are noisy estimates of the full gradient. Ask what that noise does for the optimizer that an exact gradient cannot. ``` ### What a Strong Answer Covers - The compute and memory cost of each full-batch update, and the resulting number of updates per unit of time - Why redundancy in real data makes most of that per-step compute wasted - The effects of having no gradient noise on saddle points, the minima found and generalization - How curvature limits the step size, and what that means on ill-conditioned problems - When full-batch training is a reasonable choice ### Follow-up Questions - How does the variance of a minibatch gradient scale with batch size, and what does that imply about increasing the batch beyond some point? - If you are forced to train with very large batches, what would you change in the optimizer setup? - Why does L-BFGS work well with full-batch gradients but poorly with small minibatches? - Would adding random noise to full-batch gradient descent recover the benefits of SGD?

Overview: Explain the problems that come with training a model using the entire training set as a single batch. Tests reasoning about compute per update, data redundancy, the role of gradient noise, curvature limits on the step size, and when full-batch methods are still a good choice.

General logo
General
Nov 25, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

What optimization challenges arise when you use a batch size equal to the entire training set?

What a Strong Answer Covers Guidance

  • The compute and memory cost of each full-batch update, and the resulting number of updates per unit of time
  • Why redundancy in real data makes most of that per-step compute wasted
  • The effects of having no gradient noise on saddle points, the minima found and generalization
  • How curvature limits the step size, and what that means on ill-conditioned problems
  • When full-batch training is a reasonable choice

Follow-up Questions Guidance

  • How does the variance of a minibatch gradient scale with batch size, and what does that imply about increasing the batch beyond some point?
  • If you are forced to train with very large batches, what would you change in the optimizer setup?
  • Why does L-BFGS work well with full-batch gradients but poorly with small minibatches?
  • Would adding random noise to full-batch gradient descent recover the benefits of SGD?