Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Principle:Princeton nlp SimPO Model Saving and Evaluation

From Leeroopedia


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:

  1. Save model — Serialize weights, config, and tokenizer to output_dir
  2. Save metrics — Write training metrics (loss, reward accuracies) as JSON
  3. Create model card — Generate a standard HuggingFace model card with provenance info
  4. Evaluate — Run the full eval loop computing SimPO-specific metrics on test data
  5. Push to Hub — Optional upload to HuggingFace Hub with "simpo" tag

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment