Skip to content

solvi.core.deciders.wire

What the scorer sees: items, passes, prompts, logits, the pointer's spans.

Part of solvi.core.deciders, which re-exports every name; import from there.

What the scorer sees: items, passes, prompts, logits, the pointer's spans and evidence. (Part of solvi.core.deciders, which re-exports every name.)

Item dataclass

Item(task: str, options: tuple, descriptions: tuple | None, text: str, multi: bool = False, kind: str = '', pointer: bool = False, unknown: bool = False, max_len: int = 0)

One question to score: the scorer returns one logit (or a row of logits, one column per mode) per option, or {"logits": ..., "act": logit} when it has an act head.

Pass dataclass

Pass(text: str, items: tuple)

Several questions about one input, scored in one forward pass (checkpoints with multi-question support).

Logits

Bases: ndarray

A question's logits [K] with an answer-primitives checkpoint's extra outputs: unknown (the "not stated" logit) and pointer (decoded: {"null": p(null span), "spans": [(p, start, end, text)]}, most probable first) — and from a scorer that can fail on one question (solvi.core.deciders.llm): escalate (why the output is not usable: the decision escalates with it), transient (not cached: ask again next time) and info (recorded in the decision's extra).

prompt

prompt(task, options, descriptions=None, multi=False, mode=None, markers=None)

A question's segment: "[mode] task[opt] option ..." (an option with a description is "label: description").

pass_prompt

pass_prompt(items, markers=None)

The first segment of a pass: the questions' segments joined by a space.

decode_pointer

decode_pointer(ptr, text, max_span=40, top=20, temperature=1.0)

The pointer's raw output → {"null", "spans"}: a span's score is start_i + end_j over the input's tokens i ≤ j < i + max_span, the null span's start_m + end_m at the mode marker; p = softmax over the null span and every span (exactly span_dist of the training code). A span's text is the input's characters from token i's start to token j's end, without surrounding whitespace — so it is literally in the input. ptr: {"start": [T], "end": [T], "offsets": [(char start, char end)] per token, "null": [start_m, end_m] (or their sum)}. temperature (the checkpoint's temperature.span) divides every start / end score, the null span's too, before the softmax — as the answer-primitives calibration fitted it.

pointer_evidence

pointer_evidence(ptr, threshold=0.15, max_spans=3)

Evidence quotes from a decoded pointer: greedily up to max_spans non-overlapping spans with p ≥ threshold; none when the null span is at least as probable as the best span (the answer-primitives contract's evidence).