Batch size, learning rate, and gradient noise: the minibatch is a noisy estimate

Every SGD step uses the average gradient of B examples instead of all N. That estimate is noisy, and the noise sets how SGD behaves: how tightly it settles, why the learning rate should grow with the batch, and which minimum it ends up in.

Gradient noise and SGD Part 1: the loss contours of a two-weight linear regression, with every example's gradient drawn as a faint arrow at the current weights, the full gradient as a thick arrow, and a cloud of minibatch gradients around it; beside it, the size of that cloud against batch size on log axes, falling like one over the square root of B. Part 2: two SGD runs on the same contours with their own learning rate and batch size, and their distance from the minimum against epochs. Part 3: a one-dimensional loss with a sharp basin and a wide basin, and a crowd of SGD runs that start in the sharp one.
batch size B drag the weights to move them
run A: lr B run B: lr B
try
batch size B learning rate 0.01, 3,000 steps, 300 runs