The reward-safety, distillation, and RL-loop surfaces that shipped schema-only in v0.70.0 are now live, validated end-to-end on SmolLM2-135M (RTX 3050, 4 GB).
What's New
soup train --reward-hack-detector info_rm|rm_ensemble(#235) — a live GRPOTrainerCallbackwatches per-step rewards, computes an InfoRM cluster-separation drop (info_rm) or RM-ensemble divergence (rm_ensemble), classifies OK/WARN/HACK, logs the verdict, and halts on HACK with--reward-hack-halt.rm_ensembleneeds ≥2 reward functions. Rewards are captured by wrapping your reward functions through a shared thread-safe buffer — no TRL monkeypatching.soup train --echo-trap-enabled(#240) — catches RAGEN-style degenerate repetition in multi-turn agent RL: per-trajectory n-gram repetition → OK/WARN/TRAP against--echo-trap-threshold, halts with--echo-trap-halt.soup train --rl-checkpoint-save-every-steps N(#238) — mid-epoch RL checkpoints (adapter + optimizer state + manifest) every N steps so a long GRPO/PPO run survives a crash; pruned to--rl-checkpoint-keep-last.task: distillwith--uld-strategy wasserstein|topk_align(#236) — live cross-tokenizer Universal Logit Distillation loss, handling student/teacher vocab-size mismatch.task: distillwith--minillm-enabled(#237) — MiniLLM teacher-mixed length-normalised reverse-KL with an optional pretrain anchor (--minillm-pretrain-anchor-path/--minillm-pretrain-anchor-weight).soup iterative-dpo(#239) — runs the full sample → reward-score → build-pairs → DPO-train loop across rounds; each round samples from the previous adapter and trains a fresh LoRA on the harvested pairs.--plan-onlyrenders the plan without running.- GRPO variant fallback warning (#159) — a
--grpo-variantcustom loss that falls back to the base trainer (installed TRL renamed the loss inputs) now logs a one-shot WARNING instead of silently degrading. - In-place reference-model EMA (#160) —
--ref-model-ema-alphaupdates the reference model in place (no fullstate_dictround-trip), cheap at 70B+ scale; warns once if 0 parameters overlap.
Install / Upgrade
pip install -U soup-cli
pip install -U 'soup-cli[train]' # with the training stackSecurity
- Iterative-DPO config serialisation uses
yaml.safe_dump; per-round paths reject control characters (\n\r\t). - The MiniLLM pretrain-anchor reader and iterative-DPO prompt reader are cwd-contained with TOCTOU symlink rejection and per-line / per-row byte caps.
- The default iterative-DPO trainer spawns
soup trainvia an argv list (no shell).
Known Limitations
- MiniLLM teacher-mix is an offline distribution blend, not on-policy rollout sampling — the paper's true teacher-mixed sampling needs an autoregressive rollout loop on top of the distill trainer (tracked follow-up).
- Cross-tokenizer ULD handles vocab-size mismatch, not fully-disjoint tokenizers — a genuinely different BPE needs a token-sequence alignment step (tracked follow-up).
rm_ensemblerequires ≥2 reward functions — with one RM the detector is a no-op (divergence is undefined for one RM).- The
#159fallback WARNING fires only when the installed TRL renames thecompute_lossinputs (covered by a unit test; can't be forced from a tiny-model smoke).
Full changelog: https://github.com/MakazhanAlpamys/Soup/blob/main/CHANGELOG.md