Diagnose Loss Spikes During a Large-Scale Pretraining Run
Last updated: November 29, 2026
Quick Overview
Midway through pretraining a multi-billion-parameter model on thousands of GPUs, the training loss shows sudden spikes, some recovering within a few hundred steps and one that diverges; explain how you would diagnose the causes and what you would change.
Mistral AI
November 29, 20260
0
0 solved
Midway through pretraining a multi-billion-parameter model on thousands of GPUs, the training loss shows sudden spikes, some recovering within a few hundred steps and one that diverges; explain how you would diagnose the causes and what you would change.
Mistral AI trains its own foundation models on large GPU clusters, where a diverged run wastes enormous compute. The interviewer looks for a systematic separation of data, optimization and hardware causes, knowledge of standard stabilizers, and a practical recovery plan.
What the Interviewer Expects
- Separate data issues, optimizer or numerics issues, and infrastructure faults
- Use logged signals: gradient norm, per-layer norms, Adam second moments, attention logit magnitudes
- Replay the exact batch from a checkpoint to test data versus nondeterminism
- Name concrete mitigations: learning-rate and warmup changes, gradient clipping, QK-norm or logit soft-capping, z-loss, skipping bad batches
- Describe a recovery procedure that rolls back and resumes with minimal lost compute
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 do you tell a bad data shard from a flaky GPU?
- Why do attention logits grow and how does QK normalization help?
- How would you change epsilon or beta2 in Adam and why?
- What monitoring would you add before the next run?
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: model size and precision (bf16 with fp32 master weights?), learning-rate schedule and where we are in it, batch size, whether spikes line up with data shard boundaries, and whether any nodes were...
Approach
Three hypothesis buckets.
- Data: a shard of repeated, garbled or extremely long-token content.
- Optimization: learning rate too high for the current state, Adam second moment decayed too sma...