Principle:Princeton nlp SimPO Model Saving and Evaluation
| Knowledge Sources | |
|---|---|
| Domains | MLOps, Model_Management |
| Last Updated | 2026-02-08 04:30 GMT |
Overview
A post-training workflow that persists trained model weights, runs evaluation metrics, and optionally publishes to the HuggingFace Hub.
Description
After the training loop completes, the model must be saved and optionally evaluated. This involves: (1) saving model weights and configuration to disk, (2) running evaluation on the held-out test split to compute preference metrics (eval_loss, rewards/chosen, rewards/rejected, rewards/accuracies), (3) creating a model card with training metadata, and (4) optionally pushing the trained model to the HuggingFace Hub. The SimPOTrainer also restores the KV cache setting for efficient inference after training. For PEFT models, only the adapter weights are saved (not the full base model).
Usage
Use this principle as the final step of any SimPO training run. Model saving is always performed; evaluation and Hub pushing are controlled by training_args.do_eval and training_args.push_to_hub respectively.
Theoretical Basis
Model persistence follows the checkpoint pattern:
- Save model — Serialize weights, config, and tokenizer to output_dir
- Save metrics — Write training metrics (loss, reward accuracies) as JSON
- Create model card — Generate a standard HuggingFace model card with provenance info
- Evaluate — Run the full eval loop computing SimPO-specific metrics on test data
- Push to Hub — Optional upload to HuggingFace Hub with "simpo" tag