What's New — RAG family goes live
v0.71.10 lifts four v0.62.0 schema-only stubs to fully live implementations, completing Soup's retrieval-augmented + activation-steering stack.
- RAFT span-mask trainer (#199) —
data.format='raft'now trains with an answer-only loss mask over golden + distractor documents, deterministic[doc-N]citation ids, and a per-token loss-weight boost on cited spans.build_raft_promptshuffles distractors reproducibly by(raft_shuffle_seed, row_index). Recipe:raft-llama3-8b. - Two-stage RA-DIT orchestrator (#200) —
soup ra-dit --retriever-config r.yaml --generator-config g.yamltrains the retriever, auto-links it into the generator config, and runs stage 2 in one shot. Generator-stage configs also auto-link the latest registered RA-DIT retriever duringsoup train. - Live activation steering (#201) —
soup steer train --method caa|iti|repenow fits real CAA / ITI / RepE direction vectors from contrastive pairs and attaches them to the Registry.soup serve --steer <name> --steer-strength <s>installs a live decode-time forward hook (residual for CAA/RepE, attno_proj-input for ITI). - Citation-faithful eval + diagnose (#202) — new
soup eval citation <data> [--style bracket|inline|footnote]scores citation precision/recall/F1;soup diagnosegains a 7th failure mode (citation) that checks whether the golden[doc-N]is actually cited.
Install / Upgrade
pip install --upgrade soup-cli # 0.71.10
pip install 'soup-cli[train]' # + torch/transformers/peft/trl for live trainingSecurity
No new CVEs. All new file I/O (RAFT contrastive pairs, RA-DIT YAML configs, steering vectors, citation eval data) is cwd-contained with O_NOFOLLOW + os.fstat symlink/TOCTOU rejection, size caps, and the shared enforce_under_cwd_and_no_symlink helper. Steering vector names reject path separators and shell metacharacters; --steer/--base inputs are length-capped, null-byte-rejected, and Rich-markup-escaped before any error panel.
Known Limitations
- RAFT distractor shuffle is deterministic, not per-epoch — order is fixed for a row across epochs; vary
data.raft_shuffle_seedbetween runs for different permutations. - RA-DIT records the paired retriever, it does not fuse weights — stage-2 generator training is RAFT-style robustness training; the linked retriever is used at deploy/serve time per the Meta RA-DIT recipe.
soup eval citationon RAFT rows needs the train-time--shuffle-seed— the golden[doc-N]id depends on the shuffle permutation.citation_faithfulis gated totask in {sft, pretrain}— DPO/GRPO/etc. rejected at config load.soup steer applyis preview-only — the live decode hook lives insoup serve --steer; standaloneapplyrenders the resolved plan.soup serve --steerrequires--backend transformers.
Full changelog: https://github.com/MakazhanAlpamys/Soup/blob/main/CHANGELOG.md