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: bcofor Binary Classifier Optimization. Same input format as DPO (prompt + chosen + rejected); rows split internally to TRL's BCO unpaired schema. Newtraining.bco_beta(default 0.1, gt=0). Template:soup init --template bco. - Unified preference dispatcher —
task: preference+training.preference_loss: dpo|simpo|orpo|ipo|bcoto pick the loss without renaming your task. Legacytask: 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 viatraining.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.0Security
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_scheduleLiteral closed enum;dpo_beta_endgt=0;dpo_ref_regen_epochsbounded[1, 1000].compute_beta_at_steprejectsboolonstepandtotal_steps.RefModelRegenCallback._regenerateusesload_state_dict(strict=True)with WARNING-on-mismatch (closes a first-cut silent partial-copy hazard wherestrict=Falsecould produce a hybrid old-base + new-LoRA reference).BetaScheduleCallbackresolvestotal_stepslazily inon_train_beginso the schedule sees the realstate.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_transformersstill hardcodestrust_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_weightsis config-level only in v0.40.0. Live runtime weighted-loss combination (subclassing TRL preference trainers to overridecompute_loss) is wired in v0.40.1 —PreferenceTrainerWrapper.setupraisesNotImplementedErrorwith 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.