AI engineering glossary · Calculus optimisation

What is gradient accumulation?

Gradient accumulation: A technique that sums gradients from several small mini-batches before making one parameter update, imitating a larger batch when memory is limited. The effective batch size is the micro-batch size times the number of accumulation steps.

Level: intermediateTopic: Calculus optimisation

Gradient accumulation: an example

A GPU that fits 8 examples at a time can run 4 micro-batches and then update once, giving an effective batch size of 32.

Related terms

More Calculus optimisation terms

Where you learn it

Gradient accumulation is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.