A contract-clause classifier built on a closed frontier model now needs calibrated confidence scores; how does that requirement push the sourcing choice?
answer
- a probability you can check
- what log-probabilities the API returns
- multi-token labels and top few
- sampling costs calls, stated confidence misleads
- full logits and probes need weights
basics
~20 sCalibration needs a per-label probability that can be checked and rescaled on held-out data. If the closed API returns too few log-probabilities or none, the team is left with costly sampling or unreliable stated confidence; open weights give the full label distribution.
solid answer
~50 sA **calibrated** score means that of the clauses scored 0.8, about 80% are labelled correctly. The usual route is to read the model's probability for each label, normalise across labels, then fit a rescaling such as **temperature scaling** on held-out labelled clauses. So the first question is what the closed API exposes. If it returns log-probabilities and every label is one token that reliably appears among the top few, the team can stay closed. If labels span several tokens, fall outside the top few, or the API returns none, the fallbacks are weak: sampling many times costs that many calls and gives coarse scores, and asking the model to state a confidence is often poorly calibrated. Then the requirement points to **open weights**, which give the full distribution over every label and hidden states for a probe, or to a separate open-weight scorer beside the closed model.
code
pseudocode · 11 lines# needs a log-probability for EVERY label, which open weights always give
labels = [indemnity, termination, liability_cap, other]
for clause in held_out_clauses:
lp[clause] = [logprob_of_label(clause, label) for label in labels]
# fit one temperature T on held-out clauses to minimise negative log-likelihood
T = argmin over t of sum over clauses of -log softmax(lp[clause] / t)[true_label[clause]]
# serve: scale, then normalise across the label set
scores = softmax(logprobs_for_new_clause / T)
# check: reliability diagram and expected calibration error on unseen clausesgo deeper
Recall what calibrated means: a score of 0.8 should be right about 80% of the time. Probabilities summing to one is not the same thing.
Explain the recipe of per-label log-probabilities, normalising and temperature scaling on held-out data, and why it needs a probability for every label.
Check what the closed API actually returns against the label set, price the fallbacks, and state when the requirement forces open weights or an open scorer.
Weigh moving the whole classifier against a hybrid with an open-weight scorer, and who owns recalibration when either model changes.
## What "calibrated" asks for A classifier is **calibrated** when its scores match how often it is right: among clauses it scores 0.8, about 80% carry the correct label; among those at 0.5, about half. Teams check this with a **reliability diagram**, which bins predictions by score and compares each bin's average score with its accuracy, and summarise it with **expected calibration error**, the weighted average gap across bins. Calibration matters when a person or process acts on the number: reviewers sort clauses by score, a report states how sure the system is, or an auditor asks why one clause was trusted and another sent for checking. A raw **softmax** probability is normalised, so it sums to 1, but that does not make it calibrated; large models are often overconfident. ## How scores are built from log-probabilities The standard recipe needs the model's probability for each label: 1. Prompt the model so the answer is a label from a fixed set. 2. Read the **log-probability** of each label's tokens at the answer position. 3. Normalise across the label set, so the scores sum to 1. 4. Fit a rescaling on a held-out set of labelled clauses. **Temperature scaling** divides the log-probabilities by one fitted number `T` before normalising; `T` above 1 softens overconfident scores. 5. Re-check the reliability diagram on data the fit did not see. ```pseudocode # illustrative log-probabilities read for one clause label_logprobs = {indemnity: -0.22, termination: -1.9, liability_cap: -3.1, other: -4.0} # step 3: normalise across labels (T = 1) # -> indemnity 0.790, termination 0.147, liability_cap 0.044, other 0.018 # step 4: temperature T = 1.6 fitted on held-out clauses scores = softmax(label_logprobs / T) # -> indemnity 0.621, termination 0.217, liability_cap 0.103, other 0.059 ``` The figures are this example's; the shape is general. The recipe works only if the team can read a log-probability for **every** label. ## What a closed API may or may not expose Closed APIs differ, and the same API can differ between models: - Many return log-probabilities for the sampled token and a **few top alternatives** per position. - Some models return **none**. - Many do not score text you supply, so you cannot ask directly for the probability of each label string. Whether that is enough depends on the label set: | Label set | With a top-few API | With open weights | |---|---|---| | A handful of single-token labels | Usually workable if each appears among the top few | Workable | | Dozens of labels | Many fall outside the top few, so their probability is unknown | Score every label directly | | Labels spanning several tokens | Later tokens are seen only along the sampled path | Score every full label string | | No log-probabilities returned | Not possible | Workable | ## The fallbacks on a closed model, and their costs - **Sampling agreement**: ask the same question several times with sampling on and use the share of answers that agree as the score. With ten samples that is ten times the calls per clause, and scores move only in steps of 0.1. It can be calibrated, but it is expensive and coarse. - **Stated confidence**: ask the model to write a number. That number is generated text rather than a probability, and it is often clustered near the top of the scale and poorly calibrated. - **A separate scorer**: keep the closed model for anything it is best at, and score labels with a smaller open-weight classifier tuned on the team's clauses. This is a hybrid, and it is often the cheapest way to satisfy the requirement. Two more facts push in the same direction. A calibration fit belongs to one model; if the hosted model changes, the fit must be redone. And with open weights a team can also train a **probe** on hidden states, which sometimes tracks correctness better than output probabilities do. ## How the requirement moves the decision Once the constraints are stated, the reasoning has one defensible answer: - If calibrated per-label scores are a hard requirement, and the closed API exposes a usable log-probability for every label, stay closed and calibrate. - If it does not, the requirement forces weights access, either by moving the classifier to open weights, if they meet the accuracy bar on the team's evals, or by adding an open-weight scorer next to the closed model. - Sampling agreement is a stopgap to price, not a plan, and stated confidence is not a calibrated score.
- Why is a softmax probability over labels not calibrated by default?Normalising makes the scores sum to 1, which says nothing about whether 0.8 means right 80% of the time. Large models are often overconfident, so their top probabilities exceed their accuracy. A rescaling fitted on held-out labelled data, such as temperature scaling, and a reliability check on unseen data are what make the scores calibrated.
- What happens to the calibration if the provider updates the hosted model?The fitted temperature belonged to the old model's probabilities, so it may now be wrong in either direction. The team has to re-run the reliability check and refit on held-out data. With open weights the team decides when the model changes, so recalibration happens on its own schedule.
- Asking the model to state its confidence gives calibrated scores.
- A softmax probability is calibrated because it sums to one.
- The top few log-probabilities are always enough for any label set.
- Sampling the model ten times gives a cheap, fine-grained confidence score.
- Calibration fitted once stays valid when the hosted model is updated.