github MakazhanAlpamys/Soup v0.40.0
v0.40.0 — Preference Variety

latest releases: v0.78.0, v0.77.2, v0.77.1...
6 months ago

What's New

v0.40.0 — Preference Variety: BCO trainer + a unified preference-loss surface so DPO / SimPO / ORPO / IPO / BCO live behind one config knob. Adds two opt-in DPO controls (β-schedule + ref-model regen) and a forward-looking multi-objective preference-loss surface.

  • BCO Trainer — task: bco for Binary Classifier Optimization. Same input format as DPO (prompt + chosen + rejected); rows split internally to TRL's BCO unpaired schema. New training.bco_beta (default 0.1, gt=0). Template: soup init --template bco.
  • Unified preference dispatcher — task: preference + training.preference_loss: dpo|simpo|orpo|ipo|bco to pick the loss without renaming your task. Legacy task: dpo, task: simpo, etc remain first-class — additive surface, not a breaking collapse.
  • KL-controlled DPO variants — anneal β over training with training.dpo_beta_schedule: linear|cosine|exponential + training.dpo_beta_end. Periodically refresh the frozen reference via training.dpo_ref_regen_epochs: 2. Both gated to DPO-family tasks; transformers backend only.
  • Multi-objective preference loss — define training.preference_loss_weights: {dpo: 0.7, bco: 0.3} to blend losses. 2–5 entries, weights sum to 1. Schema-level surface ships now; live runtime weighted-loss combination deferred to v0.40.1.
  • Net +118 tests (4538 → 4656). All four review-agent waves clean (Python / Code / Security / TDD).

Install / Upgrade

pip install --upgrade soup-cli
# or
docker pull ghcr.io/makazhanalpamys/soup:v0.40.0

Security

All v0.40.0 schema fields are Pydantic-bounded with explicit bool rejection where int / float is expected (matches v0.30.0 Candidate policy):

  • preference_loss_weights: 2–5 entries, key allowlist {dpo, simpo, orpo, ipo, bco}, explicit null-byte rejection on keys, per-value bounds (0, 1], weights must sum to 1.0 (±1e-6).
  • dpo_beta_schedule Literal closed enum; dpo_beta_end gt=0; dpo_ref_regen_epochs bounded [1, 1000].
  • compute_beta_at_step rejects bool on step and total_steps.
  • RefModelRegenCallback._regenerate uses load_state_dict(strict=True) with WARNING-on-mismatch (closes a first-cut silent partial-copy hazard where strict=False could produce a hybrid old-base + new-LoRA reference).
  • BetaScheduleCallback resolves total_steps lazily in on_train_begin so the schedule sees the real state.max_steps (closes a first-cut silent-no-op bug).
  • Cross-validators reject every new field on the mlx backend with distinct error messages (matches v0.34.0 distinct-reason policy).

Known Limitations

  • BCOTrainerWrapper._setup_transformers still hardcodes trust_remote_code=True. This is a carry-over of the v0.36.0 #63 known-gap family across non-SFT trainers (DPO / GRPO / KTO / ORPO / SimPO / IPO / PPO / RewardModel / Pretrain / Embedding all share the same gap). Tracked under #63.
  • Multi-objective preference_loss_weights is config-level only in v0.40.0. Live runtime weighted-loss combination (subclassing TRL preference trainers to override compute_loss) is wired in v0.40.1 — PreferenceTrainerWrapper.setup raises NotImplementedError with a friendly message until then. Mirrors the v0.27.0 MII / v0.37.0 multipack / v0.38.0 quant menu / v0.39.0 ReLoRA stub-then-live pattern.

Don't miss a new Soup release

NewReleases is sending notifications on new releases.