Learn the primitives / Lesson 8 of 24

Read probability and confidence

Interpret each primitive's numbers, separate distribution concentration from correctness, and write explicit policy bands.

After this moduleYou can explain Jev's probabilities and confidence without turning them into universal action or correctness claims.

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.

Probability + policy

A probability does not choose an action

For one battery-problem Noul, move the synthetic output and the application's tag policy.

Synthetic teaching data
Jev output0.68Synthetic probability that the review describes a battery problem
Abstain
Review
Tag
Application actionSend to human review0.68 >= 0.45 → review

This example policy keeps the case for a person because it falls inside the review band.

Model outputProbability distribution

Describes this synthetic answer across yes and no.

Application policyThresholds + consequences

Turns an output into review, abstention, or a permitted action.

Evaluation evidenceHeld-out labeled cases

Required before making calibration or performance claims. This toy does not provide that evidence.

Trace this example from input to result
01

Customer choice

A notes app suggests a collection for a saved article.

02

Request or event

Jev returns a Choice winner, option probabilities, and confidence.

03

Backend behavior

Code interprets those fields by primitive and applies the product's suggestion policy.

04

Customer sees

The user sees a suggestion, a request to choose, or no suggestion.

05

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 seesApplication doesJev returns
A suggested labelApplies a low-consequence policyA primitive-specific distribution
No suggestion for an uncertain caseKeeps an explicit middle bandNo command to treat the case as false
A corrected result laterStores user feedback for evaluationNo 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.

Applied diagnosis

A high-confidence category is repeatedly wrong

distribution concentrated · new article type absent from options

Do 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.

Saved locally

Write a probability policy

Your answers stay in this browser. Write enough that another engineer could continue the investigation.

Knowledge check

Check your understanding

Interpret probabilities by primitive, treat confidence as concentration, and keep model output separate from action policy.
Module quiz

0/3 answered

01A positive threshold is 0.8 and a Noul returns 0.6. What follows?
02What does high Choice confidence indicate?
03What does calibration describe?
Sources and verification notes 7
Probability and confidencepublic-contract

Distribution concentration is distinct from empirical correctness. The exact native confidence formula is not published.

Noulpublic-contract

Probability for the stated binary condition, optional true/false criteria and no separate confidence field.

Choicepublic-contract

Relative selection, labels, descriptions, full probabilities and confidence.

Scorepublic-contract

Ordered rubric, weighted expected index, legend, probabilities and confidence; numerical calibration has documented limitations.

Guo et al.: neural network calibrationhistorical

Defines and studies calibration and post-hoc temperature scaling on tested models; no Jev validation.

Kull et al.: beta calibrationhistorical

Post-hoc probability calibration methods and limitations; not evidence that Jev needs or benefits from a particular calibrator.

Nixon et al.: measuring calibrationhistorical

ECE depends on measurement choices and can obscure error; no Jev-specific experiments.

Further learning

Optional references

These resources provide public documentation and examples for readers who want them.

Official documentationConfidenceResearch paperOn Calibration of Modern Neural Networks