Learning Rate Warmup › Linear Warmup
Language AI HandbookAll chapters Learning Rate Warmup › Linear WarmupOne section · Sections in this chapter5 / 16 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
The most common warmup strategy is linear warmup, where the learning rate increases from zero (or a small initial value) to the target learning rate in a straight line over steps.
At training step , the learning rate during warmup is computed as a simple linear fraction of the peak learning rate:
where:
- is the learning rate at step
- is the target (peak) learning rate, the value you have tuned for stable training
- is the total number of warmup steps (the duration of the warmup phase)
- ranges from to
At step , the learning rate is , which is nearly zero for typical warmup durations. At step , the fraction equals 1 and the learning rate reaches its peak value .
After warmup completes (at ), the learning rate transitions to a decay schedule. If using cosine decay (covered in the next chapter), the combined schedule becomes:
where:
- is the minimum learning rate at the end of training (often )
- is the total number of training steps across the entire training run
The cosine term evaluates to at the start of the decay phase (progress ), giving , and evaluates to at the end (progress ), giving . This creates a smooth, S-shaped transition from peak to minimum.

Why Linear and Not Exponential?
You might wonder why linear warmup is preferred over exponential warmup, where the learning rate would grow multiplicatively. The answer comes down to how quickly the learning rate reaches its peak and how the optimizer benefits from spending time at intermediate learning rates.
Exponential warmup spends most of its budget at very low learning rates and reaches the peak only in the final few steps. Concretely, if you use a warmup factor of 10 and double the learning rate every step during warmup, the learning rate at the midpoint of warmup is only , but the Adam statistics accumulated during those slow early steps are dominated by tiny gradients that may not represent the true gradient scale at the peak learning rate. Linear warmup strikes a better balance, growing steadily so that the model is training at a reasonable pace throughout the warmup phase, and Adam's statistics are built up from a representative mix of learning rate levels.
Some practitioners use square-root warmup, where , which is a middle ground between linear and exponential. The original Transformer paper "Attention Is All You Need" used an inverse-square-root schedule that starts high and then decays, which is mathematically equivalent to warmup followed by decay but expressed as a single formula. The schedule from the original paper combines the model dimension and step count:
where:
- is the model's hidden dimension (a constant that scales the overall learning rate magnitude)
- is the current step number (1-indexed)
- is the warmup duration in steps
To understand this formula, note that the selects the smaller of two expressions. For small (during warmup), the term is smaller, and the schedule grows linearly in . For large (after warmup), the term becomes smaller, and the schedule decays as the inverse square root of . The crossover point between the two regimes occurs exactly at .
Despite its elegance, this schedule has been largely replaced by explicit linear warmup followed by cosine decay in modern practice, because the explicit version gives you direct control over the peak learning rate and the warmup duration independently. With the original Transformer schedule, changing changes the peak learning rate as a side effect, making it harder to tune.

