Ster/Docs

Synthetic pairs

Synthetic pairs are a contrastive pair set Ster generated for itself instead of one somebody wrote by hand. ster pairs synthesize takes a one-sentence trait description and a count, generates on the route --generator picked, and writes a pa

Overview#

Synthetic pairs are a contrastive pair set Ster generated for itself instead of one somebody wrote by hand. ster pairs synthesize takes a one-sentence trait description and a count, generates on the route --generator picked, and writes a pair set plus a report of what it kept and what it threw away. It is a port of Wisent's synthetic pair generator onto Ster: the same prompts and the same cleaning rules, driven either by a local open-weight model on Ster's own runtime or by a hosted model reached through Stado's inference alternatives.

A generated set is an ordinary pair set. It loads, trains, optimizes, evaluates, and inspects exactly like a hand-written one, and it is subject to the same invariants.

The two generator routes#

Steering needs hidden states, so every command that reads or applies a direction runs on a local open-weight model. Writing pair text reads no activations at all, which makes the writer of the training data the one model in Ster that may be hosted — and a hosted model is reached through Stado's inference alternatives, never through a provider SDK, a gateway address or a raw API key of Ster's. --generator picks between the two routes, local and brama, and names one every time; nothing is assumed.

  • `local` — drives Ster's own runtime. It needs --model, honours --revision, --device, --precision and --chat-template, and generates exactly the way ster generate does. Without a model it refuses as pairs synthesize with --generator local requires --model.
  • `brama` — writes with a hosted model through Stado's inference alternatives. It takes --generator-model in place of the model arguments: no weights are loaded, no device is resolved, and nothing is downloaded. Without a route it refuses as pairs synthesize with --generator brama requires --generator-model. 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 — and the report's generator reads <alternative>:<route>. 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.

--chat-template belongs to the local route and defaults to auto, which asks the generator through the checkpoint's own conversation format when it publishes one. Every prompt in this loop is an instruction — derive an opposite trait, write a question, answer it in a voice — and 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. Synthesis is the first step of the funnel and everything downstream inherits what it writes, so the default matters more here than anywhere. --generator brama accepts the flag and ignores it: the hosted request is already a chat request, so the markers are the answering service's business (chat template).

Each generation on the hosted route is one chat-completions request handed to that call, with a body of exactly model, messages (one user message), max_tokens, and temperature, which every inference alternative takes — which is why --top-p and --seed stay behind. A hosted run is therefore not seed-reproducible: the answering alternative owns its sampler, and the running deduplicator, not the seed, is what suppresses repeated draws.

--generator-model names the route asked for: a Brama alias, such as Wisent's own chat alias wisent-backend/chat/primary or its sibling wisent-backend/chat/fallback; 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. A blank route never reaches Stado: it is refused before the call (exit 2).

Every way this route refuses is ster.inference: a blank route; 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; no inference alternative answering (exit 69, because asking again once an alternative is reachable or a statement is recorded can help), its sentence naming every alternative in Stado's order with its cause and the stado capabilities attestation record inference --consumer ster <request> command that answers the request it kept; Stado refusing the request itself; and an answer with no assistant message at choices[0].message.content. The bounds on max_tokens and temperature are the answering alternative's.

The order it runs#

  1. Derive the opposite trait. One generation asks the model for the opposite of --trait, described in one sentence and specific about words, style, and tone. --opposite supplies the text and skips this step. An empty answer refuses the run as <generator> returned no opposite trait for "<trait>"; state it with --opposite, because every negative would otherwise answer as a trait nobody stated.
  2. Generate a question. One fixed instruction produces the short user question the pair answers.
  3. Answer it twice. The same question is answered once in the trait's voice and once in the opposite's, through the same prompt shape both times, one or two sentences each.
  4. Fold the question into both sides. Each side is stored as Question: <question> and Answer: <answer> on the next line, the shape the README's own example uses. Folding it in identically is what keeps the two sides matched on topic, wording, and length, so the only difference left between them is the trait.
  5. Keep it, or drop it. A side the model returned empty, a side the writing model judges a refusal, or a pair that is a near-duplicate of one already kept ends the attempt; anything else is kept.

The attempt budget is --count times --retry-multiplier, which the caller states, and the loop stops the moment --count pairs have survived rather than generating a batch and cleaning it afterwards. Every attempt prints one line to stderr — synthesizing pair 3/20 (attempt 7) — which is what the desktop streams while a run is in flight.

Why the opposite is derived first#

The negative side has to be a real answer that lacks the trait, not the absence of an answer. Asking the model to describe the opposite trait first turns "not calm" into a specific instruction about words, style, and tone, and that instruction is then used exactly like the positive one: same question, same prompt shape, opposite persona. That is what makes the two sides differ along the trait and nothing else. A caller who already knows the opposite states it with --opposite and saves one generation per run.

Refusal repair#

Safety-tuned open-weight models answer "write a response that lacks this trait" with a refusal surprisingly often, and a refusal is a useless negative: it differs from the positive along the refusal axis rather than the trait axis. Each answer is judged by the same generator that wrote it, which must reply exactly {"refuses": true} or {"refuses": false}; any other reply stops the run (verdict-malformed for one that is not JSON, verdict-shape for JSON of another form). No list of refusal phrasings is consulted, so a refusal worded any way, in any language, is judged the same. A negative judged a refusal is asked again exactly once with a repair instruction; if it still refuses, the pair is dropped. A refusing positive is dropped at once, because the trait itself is what the model declined.

  • A refusing negative is asked again exactly once, with a repair instruction that asks for a single concise response exemplifying the undesired trait, fictional, safe, and non-actionable. refusal_retries counts these.
  • If the repair comes back empty or is still judged a refusal, the pair is dropped and rejected_refusals counts it. There is no loop: one repair, then the attempt ends.
  • A refusing positive is dropped immediately with no repair attempt. The trait itself is what the model declined to roleplay, so asking again would refuse again.

Why the deduper drops a pair#

Sample one model a hundred times for one trait and a large share of the answers are paraphrases of each other. Paraphrases are worse than useless for training a direction: they weight one phrasing heavily and make the training margin look better than it is. Each candidate is fingerprinted with a 64-bit SimHash over both normalized sides, bucketed into the stated --dedupe-bands bands, and compared against the pairs already kept. A pair identical after normalization, or within the stated --dedupe-bits Hamming distance of an earlier kept pair, is dropped and rejected_duplicates counts it.

First occurrence wins, which decides which of two near-identical pairs survives: the earlier one. During synthesis the survivor is whichever pair the model produced first; in `ster pairs inspect`, where nothing is dropped and both pairs are reported, the survivor is whichever pair comes first in the file and the later one carries the duplicate flag.

Why temperature zero is refused#

Every prompt in the loop is a constant: one fixed question instruction, one prompt shape per side. A greedy decoder — Ster's own argmax path at or below zero temperature, and any hosted sampler asked for the same — would return the identical question and the identical two answers on every attempt, and the whole run would deduplicate down to one pair. The reason belongs to the loop rather than to a runtime, so the refusal holds for either generator, and synthesis refuses before generating anything: synthesis requires a temperature above zero; argmax generation repeats a single prompt. --temperature and --top-p are the caller's; Ster assumes neither.

Sampling also has to vary between calls, not only within one. On the local route Ster builds a fresh sampler from --seed for every generation call, so one fixed seed would replay one continuation for one prompt and collapse the run the same way; the seed therefore advances by one on every model call, and a single --seed still reproduces the whole local run. Nothing seed-like travels on the hosted route, so a hosted run is not reproducible from --seed at all and relies on the answering alternative's own sampler plus the running deduplicator.

The report#

FieldMeaning
generatorWhat wrote the pairs: local:<model id> for Ster's own runtime, <alternative>:<route> for the inference alternative Stado says answered. First field in the report, so a set can be read against its writer.
trait_nameThe label written into the set: --trait-name, or the whole trait description when none is given.
trait_descriptionThe --trait text, verbatim.
oppositeThe opposite-trait description every negative was generated from, whether derived or supplied.
requested--count.
attemptsAttempts consumed: requested when nothing was rejected, at most requested times --retry-multiplier.
keptPairs written. Below requested when the attempt budget ran out first.
rejected_emptyAttempts where the model returned nothing for the question or for one of the two answers.
rejected_refusalsAttempts dropped because the positive was judged a refusal, or the negative still was after its single repair.
rejected_duplicatesAttempts dropped as a near-duplicate of a pair already kept.
refusal_retriesNegatives that were asked again. A repair that succeeded is counted here and nowhere else.
diversityunique_unigrams, unique_bigrams, avg_jaccard, mean_simhash_hamming, and min_simhash_hamming over the generated questions: the answers inherit their variety from the question that produced them.

Every attempt ends in exactly one of four outcomes, so kept, rejected_empty, rejected_refusals, and rejected_duplicates sum to attempts. refusal_retries is not one of them; it counts a repair, which may still end in a kept pair. A low kept against a high attempts is the signal to read the counters: mostly duplicates means the trait description is too narrow or the temperature too low, mostly refusals means the model will not roleplay the opposite.

Boundary#

The generator is whichever route --generator picked: Ster's own runtime, on the model --model names and the device --device selects, or a hosted model reached through Stado's inference alternatives. Pair quality therefore follows whichever generator wrote the set — the opposite trait, the question, and both answers are all one model's output, local or hosted — and generator in the report names which one it was. ster pairs inspect is how the result is checked rather than trusted.

Hosted model routing is Stado's: the hosted writer is whichever inference alternative Stado's selected order answers with, never a provider SDK or a raw API key, and the credentials that alternative needs are Stado's and its own, never Ster's. Release delivery is Stado's and works: Ster installs through the stado-release recipe in its own .wisent-release.json. Fleet placement is Stado's in principle and declares nothing for Ster. Steering itself stays local — only the writer of the training data may be hosted, because a pair is plain text and no hidden state is read to produce it. Synthesis writes exactly one file, the pair set at --output, and validates it first, so a run that kept nothing refuses as pair set <PATH> contains no pairs instead of writing a document no loader would accept.