Read each number in its own context
The three primitives expose related numbers with different meanings. A Noul value is the probability of yes for one proposition. Choice probabilities compare supplied options. Score probabilities compare ordered levels, while its score is the probability-weighted average of their indexes.
probability distribution: weights assigned to possible answers that are nonnegative and sum to one. Choice and Score expose the full distribution. Noul exposes the yes side of its binary distribution, so no is 1 - yes for that same evaluation.
confidence: TypeSafe's returned summary of how concentrated a Choice or Score distribution is. The public documentation does not publish the native formula. Confidence is not the probability that the answer is correct.
A probability does not choose an action
For one battery-problem Noul, move the synthetic output and the application's tag policy.
0.68 >= 0.45 → reviewThis example policy keeps the case for a person because it falls inside the review band.
Describes this synthetic answer across yes and no.
Turns an output into review, abstention, or a permitted action.
Required before making calibration or performance claims. This toy does not provide that evidence.
Trace this example from input to result
Customer choice
A notes app suggests a collection for a saved article.
Request or event
Jev returns a Choice winner, option probabilities, and confidence.
Backend behavior
Code interprets those fields by primitive and applies the product's suggestion policy.
Customer sees
The user sees a suggestion, a request to choose, or no suggestion.
Diagnostic reasoning
Inspect the full distribution, state completeness, option set, and policy branch before treating confidence as quality.
Separate probability from policy
Model output describes a judgment. Policy decides what the application does with it. The same probability may support a quiet suggestion but be too uncertain for an automatic change.
function suggestionPolicy(pYes: number) {
if (pYes >= policy.suggestPositive) return "suggest-positive";
if (pYes <= policy.suggestNegative) return "suggest-negative";
return "ask-or-withhold";
}
Notice the two thresholds. If suggestPositive is 0.8, a result of 0.6 means "do not take the positive branch." It does not automatically mean the proposition is false. The middle may be an uncertainty band where the application asks, reviews, or does nothing. Converting every value below one positive threshold into a negative action is a common policy bug.
Thresholds are not built-in meanings. Pick them using labeled examples and the cost of each behavior. A playlist suggestion and an account-changing action should not share a threshold simply because they use the same primitive.
| Customer sees | Application does | Jev returns |
|---|---|---|
| A suggested label | Applies a low-consequence policy | A primitive-specific distribution |
| No suggestion for an uncertain case | Keeps an explicit middle band | No command to treat the case as false |
| A corrected result later | Stores user feedback for evaluation | No guarantee of correctness |
Confidence describes concentration, not truth
For a Choice, [0.92, 0.04, 0.04] is more concentrated than [0.38, 0.34, 0.28]. Confidence summarizes that kind of concentration. A concentrated answer can still be wrong if the right option was omitted or the state lacked a decisive sentence.
Noul has no separate confidence field because its one value already shows the binary balance. A value near 0.5 is balanced between yes and no. Values near 0 or 1 are concentrated on opposite answers.
For Score, confidence and expected score answer different questions. A distribution split across distant extremes can have the same expected score as one split between adjacent levels. Read the full distribution when the shape affects behavior.
A high-confidence category is repeatedly wrong
distribution concentrated · new article type absent from optionsDo not assume the confidence calculation failed. Choice can be concentrated on the best remaining option when the answer space is incomplete. Add the missing option or an other outcome, then reevaluate the question and policy.
Test numbers against outcomes
Probabilities become useful when you compare them with labeled examples from the feature. If many Noul results around 0.8 are evaluated, you can compare the predicted probabilities with how often the label is actually yes. That population-level relationship is called calibration.
calibration: agreement between predicted probabilities and observed outcome frequencies across a group of labeled examples. Calibration does not promise that one specific 0.8 result is correct. It describes a set of predictions under a particular question, state builder, model, and population.
Brier score: the mean squared difference between a binary probability and its actual zero-or-one outcome. It is one way to measure probability quality. Lower values are better; a perfect set of predictions has a score of zero. Compute it over labeled cases rather than interpreting it as confidence in one answer.
type LabeledExample = { probability: number; actual: boolean };
function brierScore(rows: LabeledExample[]) {
if (rows.length === 0) throw new Error("At least one labeled case is required");
return rows.reduce((total, row) => {
const actual = row.actual ? 1 : 0;
return total + (row.probability - actual) ** 2;
}, 0) / rows.length;
}
This metric evaluates binary probabilities. It does not tell you whether retrieval omitted evidence or whether downstream code used the answer correctly. Keep those checks separate.
Dig deeperSynthetic examples versus measured behavior+
The distributions in these lessons are educational examples, not observed Jev performance. TypeSafe describes Jev as calibrated, but each application still needs evaluation on its own states, question definitions, and labels. Wording, data mix, and missing evidence can change results.
Begin with a small labeled set and inspect mistakes. Advanced evaluation, monitoring, and production operation appear later in the course after the primitives and integration paths are familiar.
Write a probability policy
Your answers stay in this browser. Write enough that another engineer could continue the investigation.