Best-of-N & Evol-Instruct (v0.71.31)
Two soup data subcommands that put an LLM judge in the loop to build training data, the data side of the v0.71.31 judge-in-the-loop suite.
No competitor (Unsloth, Axolotl, LLaMA-Factory, OpenPipe) ships this as an integrated CLI suite.
soup data best-of-n — rejection sampling (BOND-lite)
Sample N completions from a base model, let a judge score each one, keep the winner as a clean SFT row. With --emit-pairs it also writes winner-versus-loser DPO pairs, so one pass bootstraps both an SFT set and a preference set.
soup data best-of-n --base HuggingFaceTB/SmolLM2-135M-Instruct \
--prompts prompts.jsonl --n 8 --judge ollama://llama3.1 \
-o best_of_n.jsonl --emit-pairs pairs.jsonl| Flag | Default | Meaning |
|---|---|---|
--base | required | Model to sample from (loads locally; bounded by your GPU). |
--prompts | required | Prompt JSONL (cwd-contained, symlink-rejected). |
--judge | required | Judge URL, SSRF-validated. |
--n | 8 | Candidates per prompt (2..64). |
-o, --output | required | SFT output JSONL; each row carries a _best_of_n provenance object (n, winner_idx, judge_model, scores). |
--emit-pairs | off | Also write winner-vs-loser DPO pairs to this path. |
--temperature | 1.0 | Sampling temperature (0..2). |
--max-new-tokens | 256 | Tokens per candidate (1..4096). |
--seed | 0 | Sampling seed. |
--plan-only | off | Print the plan and exit without sampling. |
Judging is pointwise (one judge call per candidate, argmax), so cost scales with --n.
soup data evolve — Evol-Instruct (WizardLM)
Grow instruction diversity by mutating seed prompts, completing the synthetic-data suite (Magpie, Forge, Persona, evolve). depth deepens an instruction (adds constraints, concretizes, adds reasoning steps); breadth creates a new sibling instruction in the same domain.
soup data evolve --input seeds.jsonl --provider ollama --model llama3.1 \
--strategy depth --rounds 2 -o evolved.jsonl| Flag | Default | Meaning |
|---|---|---|
--input | required | Seed instructions JSONL. |
--provider | required | ollama or vllm (the raw-completion providers; anthropic is rejected). |
--model | required | Generator model id. |
--strategy | depth | depth (deepen) or breadth (diversify). |
--rounds | 1 | Evolution rounds (1..5). |
-o, --output | required | Evolved output JSONL. |
--max-tokens | 512 | Generation budget (1..16384). |
Each round evolves every live instruction and drops empty, unchanged, or meta-prompt-echo outputs; if a round eliminates everything, the previous generation carries forward.
Security
Both write atomically (mkstemp + os.replace) with cwd containment re-validated to close a symlink-swap window; every judge / provider URL is SSRF-validated; --base loads with trust_remote_code=False (probe + warn); dataset-derived text is escaped before it is echoed. Prompts / seeds are capped at 100,000 rows.
See also
- Online DPO — train on-policy against the same judge.
- soup ship — decide SHIP with a pairwise judge win-rate.
- Data Forge & quality moat and Data engineering pro — the rest of the synthetic-data and quality surface.