Ster/Docs

ster pairs synthesize

Generate a contrastive pair set with Ster's local runtime or with a hosted model reached through Stado's inference alternatives, dropping refusals and near-duplicates as it goes.

Invocation and purpose#

text
ster pairs synthesize --trait <TRAIT> --count <COUNT> --output <OUTPUT> --generator <local|brama> --retry-multiplier <MULTIPLIER> --dedupe-bits <BITS> --dedupe-bands <BANDS> --max-new-tokens <COUNT> --temperature <TEMPERATURE> --top-p <TOP_P> --seed <SEED> [--generator-model <GENERATOR_MODEL>] [--model <MODEL>] [--revision <REVISION>] [--device <DEVICE>] [--precision <f32|f16|bf16>] [--chat-template <auto|off>] [--trait-name <TRAIT_NAME>] [--opposite <OPPOSITE>]

Derives the opposite of the trait, then spends one attempt at a time: generate a question, answer it in the trait's voice, answer the same question in the opposite's voice, and keep the pair when the writing model judges neither side a refusal and the pair is not a near-duplicate of one already kept. --generator picks who writes that text, and is required: local drives Ster's own runtime on the model --model names; brama hands the same prompts to stado capabilities call inference --consumer ster --json. Steering needs hidden states and so always runs on a local open-weight model, but writing pair text reads no activations, which is why this one writer may be hosted — synthetic pairs documents the order the steps run in and why each rejection exists.

Inputs and options#

InputRequiredMeaning
--generator <GENERATOR>yeslocal drives Ster's own runtime; brama writes the pairs with a hosted model through Stado's inference alternatives and loads no local weights. Neither is assumed: a call without --generator is refused by clap with exit 2, and a pairs/synthesize request body without generator with pairs synthesize requires a generator, local or brama.
--generator-model <GENERATOR_MODEL>with bramaThe route that writes the pairs, for example wisent-backend/chat/primary. Required with --generator brama; the local route takes none.
--model <MODEL>local routeHugging Face model id or local model directory. Required by --generator local; --generator brama loads no weights and takes none.
--trait <TRAIT>yesOne-sentence description of the trait the positive side shows.
--count <COUNT>yesNumber of pairs to keep after refusal and duplicate rejection; must be above zero.
--output <OUTPUT>yesDestination pair-set JSON; missing parent directories are created.
--revision <REVISION>noLocal route only. Immutable Hugging Face revision; Hub resolution defaults to main.
--device <DEVICE>noLocal route only. cpu (default), metal, or cuda.
--trait-name <TRAIT_NAME>noTrait label written into the set; without it the set takes the whole trait description as its name.
--opposite <OPPOSITE>noSkips the opposite-trait generation and uses this text instead.
--retry-multiplier <MULTIPLIER>yesThe attempt budget is --count times this value. Ster assumes none.
--dedupe-bits <BITS>yesA pair within this SimHash Hamming distance of one already kept is dropped.
--dedupe-bands <BANDS>yesThe count must divide the 64-bit fingerprint evenly.
--max-new-tokens <COUNT>yesThe token budget of one generated side. The hosted route sends it as max_tokens, within whatever bounds the answering inference alternative holds.
--temperature <TEMPERATURE>yesMust be above zero. On the hosted route the answering alternative holds it to its own bound.
--top-p <TOP_P>yesThe nucleus the sampler draws from. Local route only: the hosted request carries no such field, so it does not travel.
--seed <SEED>yesOn the local route the seed advances by one on every model call, so one seed reproduces a whole run instead of repeating one continuation. Nothing seed-like travels on the hosted route.
--precision <f32|f16|bf16>nof32 by default. The dtype the base weights are mapped at: f32, f16, or bf16. bf16 is refused on cpu at load with `bf16 has no CPU matmul kernel in this Candle build; use --precision f16 for half precision on cpu, or --device metal for bf16` (precision).
--chat-template <auto|off>noauto by default, and local route only. auto asks the generator through the model's own chat template when it publishes one, off asks it as raw text (chat template). An instruct checkpoint spoken to without its markers answers a pair request with instructions about answering pair requests — "Step 3: Make sure your emojis are visually appealing" — rather than the pair text that was asked for. --generator brama ignores it: the hosted request is already a chat request, so the markers are the answering service's business and not Ster's.

--model, --revision and --device are optional on this subcommand alone — the five model-loading subcommands still require the shared model arguments — because --generator brama loads no weights, resolves no device, and downloads nothing. Every completion is handed to stado capabilities call inference --consumer ster --json, which sends it to the first alternative in Stado's selected order that answers it — Brama, or a statement recorded for that exact request (stado capabilities attestation record) — and prints which alternative answered beside its answer; the report's generator reads <alternative>:<route>, such as brama:wisent-backend/chat/primary. Ster names no model service, gateway, key or provider and reads no bearer: the credentials an alternative needs are Stado's and that alternative's, never Ster's. An alternative Stado adds, or an order it selects, changes what writes the pairs without Ster changing. The real journey is tests/synthesis/resolved.sh.

--generator-model names the route asked for: a Brama alias (wisent-backend/chat/primary is Wisent's own chat alias, wisent-backend/chat/fallback its sibling), a canonical provider/model route such as anthropic/claude-3-5-haiku-latest, or a selector. Whether the answering alternative serves that route is its own decision, and its refusal reaches you in Stado's sentence.

Each generation is one chat-completions request handed to that call, carrying exactly model, messages (one user message), max_tokens, and temperature, which every inference alternative takes. Neither --top-p nor --seed travels, so a hosted run is not seed-reproducible: the answering alternative owns its sampler, and the running deduplicator is what suppresses repeated draws.

Output and state#

Writes the kept pairs to --output as pretty-printed JSON with a trailing newline. Stdout is a pretty JSON document with path and report, where the report carries generator first — local:<model id> or <alternative>:<route> — then trait_name, trait_description, opposite, requested, attempts, kept, rejected_empty, rejected_refusals, rejected_duplicates, refusal_retries, and diversity measured over the generated questions. Stderr gets one line naming the generator and the derived opposite trait, then one progress line per attempt — synthesizing pair 3/20 (attempt 7).

Exhausting the attempt budget is not a refusal: the set is written with however many pairs survived and kept is below requested. Field meanings are tabulated under synthetic pairs.

Refusals#

  • Leaving out --retry-multiplier, --dedupe-bits, --dedupe-bands, --max-new-tokens, --temperature, --top-p or --seed is a usage error that names the flag, exit 2, before anything loads or is called; --refusal-threshold is refused as an unexpected argument, since whether a side refused is the writing model's own judgement.
  • --generator takes local or brama and nothing else; any other value is refused as unknown generator "cloud"; expected local or brama. What each route needs is checked before any model work: pairs synthesize with --generator local requires --model and pairs synthesize with --generator brama requires --generator-model.
  • On the local route the model loads before anything else, so the shared loading refusals come first: unknown devices, GPU backends this binary was built without, and unsupported families (model architecture <TYPE> is unsupported by this Ster build; use a Hugging Face checkpoint whose model_type is one of <FAMILIES>, model resolution). The hosted route loads nothing and raises none of them.
  • Every way the hosted route refuses is ster.inference: a blank route (exit 2); no stado at any place Stado states (STADO_BIN, else PATH, else ${STADO_BIN_DIR:-$HOME/.stado/bin}/stado), a STADO_BIN naming no file, or a stado this account may not run (exit 1); no inference alternative answering (exit 69), its refusal naming the call (stado capabilities call inference --consumer ster --json), every alternative with its cause and the command that answers the request Stado kept; Stado refusing the request itself (exit 1); and an answer without an assistant message at choices[0].message.content.
  • A refusal Stado prints as its --json envelope is relayed with the command line Ster ran, the directory it ran in, Stado's exit status, its cause id and its fix; a successful answer that is not JSON, or carries no answer field, is refused with what was printed.
  • The bounds on max_tokens and temperature are the answering alternative's: an out-of-range value is refused by it on the first pair and reaches you in Stado's sentence.
  • --count 0 is refused as synthesis requires a pair count above zero, and --retry-multiplier 0 as synthesis requires a retry multiplier above zero.
  • Without --opposite, a generator that answers the opposite-trait question with nothing refuses the run as <generator> returned no opposite trait for "<trait>"; state it with --opposite, rather than generating every negative against a trait nobody stated.
  • --temperature 0 is refused as synthesis requires a temperature above zero; argmax generation repeats a single prompt, on either route. Every prompt in the loop is a constant, so argmax generation — Ster's own at or below zero temperature, or a hosted sampler asked for the same — would return one identical pair for the whole run.
  • Dedupe options are checked before the first generation: dedupe band count <N> must divide the 64-bit simhash evenly, such as 4, 8, 16, or 32 and dedupe threshold <N> exceeds the 64-bit simhash width.
  • A run where no pair survived writes nothing: the write validates the set and refuses as pair set <PATH> contains no pairs.
  • --chat-template takes auto or off and nothing else; any other value is refused as unknown chat template mode "<VALUE>"; expected auto or off. On the local route the check happens after the model loads, because the template it names lives in the checkpoint; the hosted route ignores the flag and raises nothing.