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
Machine Learning
Machine Learning Engineer
Amazon
November 29, 2026
Machine Learning Engineer
Onsite
Machine Learning
Medium

0

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
Learning rate schedules
Warmup
Large-batch training
Training stability
Cosine decay
How to Approach This
  1. Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
  2. Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
  3. Feature engineering is often more impactful than model selection.
  4. Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
  5. 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 Prep
Sample 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 vtv_t is based on very few steps, so per-parameter step sizes η/v^\eta/\sqrt{\hat v} can be badly wrong. ...


Submit Your Answer
Markdown supported