LIVE · Thursday 3 December

LLM Classifier Confidence Calibration: How to Get Reliable Scores and Escalate to a Human When Unsure

Raw LLM confidence is overconfident or coarse, whether it comes from token logprobs or a stated percentage. Calibrate it on held-out data, then set the escalation rule from a target error rate.

By Surya10 min read

To build an LLM classifier with reliable confidence scores, calibrate whatever score the model gives you on held-out labelled data, then choose the escalation threshold from a target error rate. Cases below the threshold go to a human. Raw scores are not reliable on their own: Guo and colleagues found modern neural networks poorly calibrated, and Xiong and colleagues found verbalized LLM confidence overconfident. Which signal works best, whether token logprobs, verbalized confidence, self-consistency or a fine-tuned decision model, has not been measured on business decision tasks, so you have to test the candidates on your own data.

Raw confidence from neural networks and LLMs is usually miscalibrated

A score is calibrated when it matches how often the model is right. The scikit-learn developers give the standard example. Among cases that a calibrated classifier scores near 0.8, about 80% should be correct. A threshold has a clear meaning only when this holds.

Modern networks often fail this test. In "On Calibration of Modern Neural Networks," presented at ICML 2017, Chuan Guo, Geoff Pleiss, Yu Sun and Kilian Weinberger found that recent networks are poorly calibrated, unlike networks from a decade earlier. Depth, width, weight decay and Batch Normalization all affected calibration in their experiments.

LLMs add problems of their own. Three studies cover the main signals:

  • Xiong and colleagues, in a paper accepted at ICLR 2024, found that verbalized confidence tends to be overconfident across five LLMs, including GPT-4 and LLaMA 2 Chat. Sampling several answers and measuring their agreement reduced the overconfidence, and no single method was best everywhere.
  • Tian and colleagues, at EMNLP 2023, found the opposite ranking for models tuned with human feedback. On TriviaQA, SciQ and TruthfulQA, ChatGPT, GPT-4 and Claude gave stated confidences that were better calibrated than their token probabilities, often cutting expected calibration error by a relative 50%.
  • Merdjanovska, Zaidan and Rücklé, in Findings of ACL 2026, found that verbalized scores cluster on very few values. Qwen3-32B used only eight distinct confidence values on SST-2, and more than half of its answers were exactly 95%.

The studies disagree about which raw signal is better calibrated, so the ranking on a new task has to be tested rather than assumed.

An LLM classifier can produce four kinds of confidence score

Each signal comes from a different part of the system, and each has a different cost. A team can build any of these four options today:

  1. Asking the model to state a confidence next to its label is the simplest approach and works with any API. The result is coarse, because the values cluster.
  2. Reading the log probability of the label token gives a continuous score from a single call. It needs an API that returns log probabilities. OpenAI's Chat Completions API offers a logprobs flag and up to 20 top_logprobs per position. Google's Gemini API offers responseLogprobs. Anthropic's Messages API reference does not mention log probabilities.
  3. Sampling the model several times and measuring agreement across samples works without log probabilities. It multiplies the cost of every decision by the number of samples.
  4. Training a classifier-style decision model on your own past decisions gives one probability per allowed label. It needs labelled history and a training step.

Parsec, a small language model lab, publishes one example of the fourth kind. Its TOD model ranks a list of allowed actions and returns one probability per option, summing to 1. According to Parsec's TOD page, a confidence gate lets TOD handle a decision when its confidence is high and passes the rest to a larger model. The page lists a flat price of $0.30 per 1,000 decisions, which is separate from any parent-model cost. TOD can be fine-tuned on a team's own decisions with the MIT-licensed openjev-sdk from Parsec's open-source code. The TOD page reports calibration error from Parsec's own evaluation, but it does not report how many decisions TOD can handle at a fixed target error rate. On Parsec's own JevBench test, TOD scored below its untrained base model. According to the TOD page, a fix for that regression is planned for the next release.

Calibration on held-out data turns a raw score into a usable probability

Calibration fits a small correction on labelled cases that the model never trained on. The correction changes the scores but leaves the ranking of cases mostly intact. The scikit-learn class CalibratedClassifierCV offers three standard methods:

  • Temperature scaling divides the model's logits by one learned number before the softmax. Guo and colleagues found it effective on most of their datasets. The scikit-learn developers note that it does not change accuracy and handles many classes naturally.
  • Platt scaling, which scikit-learn calls sigmoid, fits a logistic regression to the scores. It is the default method in CalibratedClassifierCV.
  • Isotonic regression fits a flexible step function. According to the scikit-learn documentation, it tends to overfit with far fewer than 1,000 calibration samples.

For an LLM, the raw score is the label probability, the stated confidence or the agreement rate. You can treat that number as a feature and fit the calibrator on it. In scikit-learn 1.9.1, a model that you have already trained is wrapped in FrozenEstimator. The user must then keep the training and calibration data separate by hand. A calibrator fit on training-set outputs would be biased, because a model performs better on data that it has already seen.

You check the result on a third, untouched test set. A reliability diagram plots the fraction of correct answers against the average score in each bin. Expected calibration error summarizes the gap between the two. The Brier score is useful too, but the scikit-learn developers caution that a lower Brier score can come from better discrimination rather than better calibration.

A threshold chosen from a target error rate decides how much the model handles alone

Calibration makes the scores meaningful. A threshold then turns them into a routing rule. Yonatan Geifman and Ran El-Yaniv gave the standard method in "Selective Classification for Deep Neural Networks" at NIPS 2017.

Their algorithm, called SGR, takes a target error rate and a confidence level. It sorts a labelled sample by confidence and searches for the lowest threshold that keeps the error on accepted cases below the target. The guarantee holds with the chosen probability. Cases below the threshold receive "don't know," which in a business system means escalation. The share of cases above the threshold is called coverage.

The method needs only a score that ranks cases, so it works with any of the four LLM signals. The authors' results show how strongly coverage depends on the task. With a confidence level of 99.9% and about 5,000 samples, the authors report these test results:

Dataset Target error Test error Share decided automatically
CIFAR-10 1% 0.92% 78.6%
CIFAR-10 5% 4.86% 96.0%
CIFAR-100 2% 1.87% 21.3%
CIFAR-100 5% 4.13% 44.5%

The same target error let the model handle most of an easy task and only a fifth of a hard one. On ImageNet, the authors guaranteed 2% top-5 error with 99.9% probability while covering almost 60% of cases. A risk-coverage curve, which plots error against coverage, shows this trade-off for your own task before you commit to a target.

A conformal prediction set gives a second escalation rule

Conformal prediction wraps any trained model and outputs a set of labels instead of one. Anastasios Angelopoulos and Stephen Bates describe the method in "A Gentle Introduction to Conformal Prediction," posted to arXiv in 2021 and revised through December 2022.

The recipe for classification has three steps:

  1. Score each calibration case as one minus the model's probability for the true label.
  2. Take a quantile of those scores, adjusted slightly upward for the sample size.
  3. For a new case, keep every label whose probability is at least one minus that quantile.

The set contains the true label with at least the probability that you chose, such as 90% or 95%. The escalation rule is direct. If the set holds exactly one label, the system decides. If it holds several labels, a human decides, and the reviewer can see the plausible labels. Sets grow larger when the input is hard, so set size works as a measure of uncertainty. The authors suggest about 1,000 calibration points as a rough guide.

Learning to defer accounts for cases where the reviewer is stronger

A threshold assumes that the human is always better than the model on uncertain cases. Real reviewers are stronger on some kinds of case than others. Hussein Mozannar and David Sontag addressed this in "Consistent Estimators for Learning to Defer to an Expert" at ICML 2020.

Their method uses records of past expert decisions to learn a classifier and a rejector together. The training loss generalizes cross entropy and comes with a consistency guarantee. The system learns to defer where the expert is actually more accurate. This step becomes practical once a team has logged enough human decisions on escalated cases.

No published study has compared the four signals on business decisions

Each of these papers solves one part of the problem. None of them compares verbalized confidence, label logprobs, self-consistency and a fine-tuned decision model on the same business tasks. Coverage at a 1%, 2% or 5% target error has not been measured for ticket routing, refund approval or carrier-exception triage. Latency per 1,000 decisions has not been measured for these signals either.

List prices settle part of the cost question. Assume 900 input tokens per decision on OpenAI's gpt-6-luna, which lists $0.10 per million input tokens and $0.50 per million output tokens. The cost per 1,000 decisions then works out as follows:

  • A label-only call with 5 output tokens costs about $0.09.
  • A label plus a stated confidence, at 15 output tokens, costs about $0.10.
  • Five independent samples for self-consistency cost about $0.46.

The larger cost is usually human review, and it depends on coverage. At an assumed 2 minutes per review, a signal that escalates 30% of 1,000 cases creates 10 hours of review. A signal that escalates 15% creates 5 hours. On these assumptions, the signal with higher coverage at the same target error saves the most money, even if it costs more per call.

A fair test on your own data needs the same split for every signal, the same calibrator and the same threshold rule. Merdjanovska and colleagues found that a small evaluation choice can reverse rankings. Consistency sampling went from best to worst when they changed the interpolation method in the accuracy-rejection curve. They recommend stepwise interpolation, which matches the way a real threshold behaves.

The guarantees hold only while production data looks like the calibration data

Both the SGR threshold and the conformal set assume that new cases come from the same distribution as the calibration cases. Angelopoulos and Bates state the assumption as independent and identically distributed data. Their guarantee is also marginal, which means that it holds on average across all cases. It promises nothing for a particular customer segment, product line or language, and the authors show that per-subgroup coverage is impossible in general. Adaptive prediction sets reduce the gap between easy and hard groups without closing it.

A production system that relies on these guarantees should follow five practices:

  1. Split labelled history into separate training, calibration and test sets before any fitting, and never reuse calibration cases for evaluation.
  2. Track the escalation rate and the error on reviewed cases each week, because a change in either one signals drift.
  3. Send a small random sample of confident decisions to review. Escalated cases are the hard ones, so recalibrating on them alone would bias the calibrator toward hard cases.
  4. Refit the calibrator and the threshold on fresh labelled cases when drift appears, and test the new fit on cases that it did not see.
  5. Set the target error from what mistakes cost compared with what a review costs, and read the expected review workload from the risk-coverage curve.

How often an LLM classifier needs recalibration in production has not been measured in any study found.

Sources

More in Research

All Research →