Train loss drops while eval loss climbs at step 1200: name it and the standard fixes
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
During an SFT run, train loss keeps dropping smoothly but eval loss bottoms out around step 1200 and starts climbing while train loss continues down. Name what this pattern is and walk through the two standard responses an engineer should take.
This is overfitting. Two responses: ship the checkpoint at the eval-loss minimum (early stopping), and reduce effective capacity or add regularization for the next run.
Imagine a student cramming for an exam by memorizing every practice question word for word. They get faster and faster on the practice set, but when the real exam shows even slightly different questions, they start failing because they never learned the underlying ideas. That gap between practice scores rising and exam scores falling is the signal that memorization has taken over from real learning. Two fixes work. First, stop them cramming the moment their practice and exam scores diverge, and use the version of them from that moment, not the over-crammed one. Second, give them fewer practice questions to obsess over, or harder questions that punish memorization, so they have to learn the ideas instead.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
4 min: naming the overfit pattern, early stopping mechanics with load_best_model_at_end, the next-run capacity and regularization levers, when more data is the deeper fix, and the leakage diagnostic to rule out first.
| Symptom | Likely cause | First action |
|---|---|---|
| Train down, eval up (this case) | Overfitting | Early stop at eval min; lower capacity next run |
| Train flat, eval flat | Optimization broken (zero LR, masked labels) | Diagnose gradient path before changing capacity |
| Train down, eval flat | Eval set too easy or leaked | Verify eval set is held out and harder than train |
| Train down then spikes, eval also spikes | Numerical instability (fp16 overflow) | Switch to bf16, add gradient clipping |
| Train down, eval down (healthy) | Healthy generalization | Continue training to schedule end |
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Shipping the final-step checkpoint because the training loss looks best. The model that overfit hardest is not the model you want in production; the eval-minimum checkpoint is.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.