Skip to content

10 · G · Step

AdamW, clip, and the schedule

Turning a gradient into a new θ without destroying a billion-parameter run.

Vanilla SGD is not what runs

(10.1)

Raw gradients in a Transformer have wild scale differences across layers. LLMs use AdamW: per-parameter adaptive steps, decoupled weight decay, a warmup-cosine schedule, and global-norm clipping.

AdamW

Let at optimizer step .

(10.2)
scheduled learning rate
first-moment decay, typically 0.9
second-moment decay, 0.95 or 0.999
weight decay, applied to θ directly (the “W”)
10^{-8}, avoid divide-by-zero
elementwise square

Warmup then cosine decay

(10.3)

Gradient clipping

Before AdamW:

(10.4)
clip threshold, often 1.0
global L2 norm of the concatenated gradient

Why it mattersAdam normalizes per-parameter. Weight decay stops ‖θ‖ drifting. Clipping stops rare batches from destroying the run. The schedule starts gentle, then anneals so the model settles.