Pick the sensible `num_train_epochs` for a typical instruction-SFT run on a curated dataset
1 to 3 epochs is the standard SFT range; the base already knows language, so a few passes adjust format and style without overfitting the small curated set.
Think of an expert chef being taught to plate a specific new dish. They already know how to cook, hold a knife, and balance flavors from decades of experience. The new lesson is just about plating style: the specific arrangement, the garnish, the sauce drizzle. You show them the technique once or twice, they pick it up. If you make them practice the exact same plating fifty times in a row, they start producing identical-looking plates every time, even for dishes that should look different. They have stopped learning the principle and started copying the example. SFT works the same way. The model already knows English. One to three passes over the curated examples teach the format. Many more passes turn the model into a parrot.
Detailed answer & concept explanation~11 min readEverything 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. 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: place the 1 to 3 epoch range, explain why the base model's pretraining sets the regime, describe the train versus held-out gap diagnostic, and dispatch the under- and over-training distractors.
Real products, models, and research that use this idea.
- Hugging Face TRL SFTTrainer default num_train_epochs is 3 across many recipe templates for Llama 4 and Mistral fine-tuning.
- Llama 3 and Llama 4 instruction tuning at Meta uses one to two epochs on curated multi-million instruction sets, leaning toward single epoch on large mixes.
- Tulu and Open Tulu recipes from Allen AI fine-tune on around 300K examples for two epochs as their published default.
- DeepSeek V4 distillation recipes use two to three epochs on tens of thousands of student examples, with careful held-out monitoring to detect overfitting early.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow does dataset size affect the optimal epoch count and where is the rough crossover?
QWhat diagnostics tell you that SFT has overfit, and which ones are unreliable?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Treating SFT as if it were pretraining and running it for dozens of epochs. The base model already knows language; SFT only adjusts format and style, and over-training memorises the demonstrations instead of learning the underlying patterns.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.