Cosine learning-rate schedule

Optimization · Formula · Not yet linked from a lesson

ηt=ηmin⁡+12(ηmax⁡−ηmin⁡)(1+cos⁡tπT)\eta_t = \eta_{\min} + \tfrac{1}{2}(\eta_{\max} - \eta_{\min})\left(1 + \cos\frac{t\pi}{T}\right)

Decays the learning rate along a cosine curve from its peak to its floor. It holds a high rate early, then eases off smoothly rather than dropping in steps, and it is the schedule nearly every large language model is trained under.

Symbols

tt
The current step.
TT
The total number of steps in the schedule.
ηmax⁡\eta_{\max}
The peak learning rate, reached after warmup.
Esc
↑↓ navigate↵ open? shortcuts

Keyboard shortcuts

Press Esc to close

Anywhere

⌘K
Search and commands
/
Search
?
This sheet
Esc
Close

Reading a lesson

J
Next lesson
K
Previous lesson
B
Bookmark