Training a large model takes days or weeks, and anything can break in that time: a server, a disk, a job in the queue. A checkpoint is a snapshot written to disk every few hundred or few thousand steps, so that you don’t have to start over and can later pick the best moment.
What is inside
The word “checkpoint” is used in two senses. A full training checkpoint is needed to resume work from the same point. A “weights only” checkpoint is needed to run the model or publish it.
| Part | What it is for |
|---|---|
| Model weights | the parameters themselves: inference runs on them too |
| Optimiser state | accumulated values (for AdamW, two numbers per parameter); without them the optimiser starts accumulating from scratch, and training cannot resume from the same point |
| Learning rate scheduler | the current step of the learning rate schedule |
| Random number state and step | so that the data and the order of batches are neither repeated nor thrown off |
That is why a full checkpoint is noticeably larger than the published model: the optimiser usually keeps its numbers in FP32, and for a model with 9 billion parameters the two AdamW states add 9 × 8 = 72 GB to the 18 GB of BF16 weights.
Working with checkpoints in Transformers
The Trainer from the Transformers library saves directories such as checkpoint-500 according to save_strategy and save_steps. With save_only_model=True, only the weights go into the checkpoint: it is smaller, but training cannot be resumed from it. save_total_limit caps the number of checkpoints kept and deletes the old ones, load_best_model_at_end=True loads the best one by metric at the end (it is not deleted in the process), and an interrupted training run can be resumed like this:
trainer.train(resume_from_checkpoint=True)The value True takes the latest checkpoint from output_dir, while a string names a specific directory. The final model is made from the best checkpoint (a LoRA adapter can be merged into the base model first): it is saved in safetensors and, if needed, converted to GGUF.
Sources
the term is written from these pagesVerified 18 Nov