Why Large-Batch Transformer Training Needs Learning Rate Warmup
Last updated: November 29, 2026
Quick Overview
Explain why training a transformer with a large batch often diverges at the start without learning rate warmup, and design a full learning rate schedule for a multi-day training run.
Amazon
November 29, 20260
0
0 solved
Explain why training a transformer with a large batch often diverges at the start without learning rate warmup, and design a full learning rate schedule for a multi-day training run.
Amazon trains large models across many accelerators, where a diverged run wastes expensive compute. This question checks understanding of early training instability, Adam's second-moment estimate, and how batch size relates to learning rate.
What the Interviewer Expects
- Explain instability from large early updates
- Connect warmup to Adam's noisy variance estimates at the start
- Describe linear warmup then cosine or inverse square root decay
- Relate batch size scaling to learning rate
- Describe how to detect and recover from divergence
Key Topics to Cover
How to Approach This
- Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
- Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
- Feature engineering is often more impactful than model selection.
- Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
- Handle class imbalance with SMOTE, class weights, or appropriate loss functions.
Possible Follow-up Questions
- How would you pick the warmup length?
- What would you do if loss spikes at step 50,000 of the run?
- Does warmup matter for fine-tuning a pretrained model?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Explore ML Interview PrepSample Answer
Clarify
Ask about model size, global batch size, total steps, optimizer (assume AdamW) and whether this is pretraining or fine-tuning....
Approach
At initialization, gradients are large and poorly conditioned, and Adam's second-moment estimate is based on very few steps, so per-parameter step sizes can be badly wrong. ...