struct Chosen textChoose scores each text’s legal choices, one byte each, through one forward of the byte decoder, a softmax over that item’s choices alone at its question type’s calibrated inverse temperature.
The call appends the mask byte, and a text longer than the context loses its head, never its end.
A model whose choiceTemperatureGroups is zero carries no byte decoder and refuses with unsupported.
let chosen = try model.textChoose(
["keep this candidate? ", "expand which neighbor? "],
choices: [Array("yn".utf8), Array("ABCD".utf8)],
temperatureGroups: [0, 1],
arena: arena)
let keep = chosen.probabilities[0][0] // one Float per choice, in the order offeredAPI
StructChosenWhat one choose call wrote into its arena, read in place until the arena's next call.2
probabilitiesOne probability per choice, in the order each item offered them.
let probabilities: Tape statsWhat the call counted on the way.
let stats: EncodeStats StructChoicesCalibrated choices over the byte decoder: each choice item scores the soft cross-entropy of its legal bytes' softmax, plus brierWeight times its Brier score.3
weightThe loss weight; zero trains no choices.
var weight: Float brierWeightThe Brier term's weight beside the soft cross-entropy; zero derives 0.5.
var brierWeight: Float initTakes every field by name; a zero derives as its field documents.
init(weight: Float = 0, brierWeight: Float = 0)