save_strategy='steps' vs save_strategy='epoch': what behaviour changes?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
save_strategy controls cadence only: steps saves every N optimizer updates, epoch saves at the end of each pass. Both save the same artifacts.
Imagine writing a long letter and choosing when to hit save in your word processor. One option saves every fifteen minutes regardless of where you are; the other saves only when you reach the end of a chapter. Both produce identical save files. The only difference is the timing. If the power goes out, the every fifteen minutes option loses at most fifteen minutes of work. The end of chapter option might lose hours if you were deep into a long chapter. That is exactly the trade-off in fine-tuning checkpoints. Step-based cadence bounds the worst-case loss; chapter-based cadence ties saves to natural data milestones. Pick steps for long runs, chapter-end for short ones.
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.
5 min: what save_strategy controls + steps vs epoch cadence + identical artifacts saved + worst-case loss math + interactions with save_total_limit and save_only_model + independence from best by metric.
| Aspect | save_strategy='steps' | save_strategy='epoch' |
|---|---|---|
| Cadence trigger | Every save_steps optimizer updates | End of each full data pass |
| Artifacts saved | Model + optimizer + scheduler + RNG | Same |
| Best for | Long runs, large datasets, spot instances | Short fine-tunes, small datasets |
| Worst-case loss on crash | save_steps * step_time | Up to a full epoch |
| Disk pressure | Higher (more frequent saves) | Lower (one per epoch) |
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.
Reading the two strategies as different in what they save. They save the same thing (weights, optimizer, scheduler, RNG); only the cadence differs.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.