All articles
March 8, 2026 6 min read

Does an LLM know when it's unsure? Confidence, self-reflection, and logprobs

An LLM states a wrong answer with the same fluency as a right one — it has no built-in confidence. So how do you get a usable confidence signal? Self-reflection, token logprobs, and their limits.

Written forEngineering
LLMReliabilityEvals

Here's a challenge that trips people up: an LLM has no native confidence. It doesn't emit a calibrated probability that its answer is correct — it emits fluent text whether it's right or wrong. So any confidence signal is something you build on top, and there are two main ways to do it, each with real limits worth knowing.

The problem: fluency isn't confidence

A model states a hallucination in exactly the same confident tone as a fact — fluency and correctness are unrelated. And asking it directly, 'how confident are you?', just produces more generated text, not a measured probability; models are systematically overconfident when self-reporting, so a stated '95%' means little. If you want a confidence number you can act on, you have to derive it, not ask for it.

Self-reflective scoring

The first approach is to have a model evaluate the answer — ideally a separate pass, or a second model — against the source context: 'is every claim here supported by the retrieved passages?' This is LLM-as-judge applied to confidence (the eval-discipline post covers its biases), and it's genuinely useful for grounding checks. But it's still an LLM's judgment, subject to the same position, verbosity, and self-preference biases, so treat its score as a signal, not as truth.

Logprob-based probability

The more grounded signal is the model's own token log-probabilities. For a constrained or classification answer, the probability the model assigned to the token it chose is a real (if imperfect) confidence measure: a 'Yes' emitted at 0.98 probability is more trustworthy than one at 0.55. You can pull logprobs from the API and turn them into a confidence layer for structured decisions — a Yes/No/Partially label, an extracted field, a routing choice. It works best exactly where you most need it: constrained outputs. For long free-form text it's much noisier, because the probability is spread across many tokens.

Use confidence to route, not to trust

Whichever signal you build, its value is in routing, not in believing the number itself. Low confidence should trigger an action — escalate to human review, retrieve more context, or abstain (the grounding and human-in-the-loop posts). And confidence is only meaningful if it's calibrated: a 0.8 score should mean right about 80% of the time. Measure that correlation on a golden set (the classical-NLP post covers calibration) before you wire the number into a decision, or you've just built a more elaborate way to be overconfident.

An LLM won't tell you when it's unsure — it'll say the wrong thing just as smoothly as the right one. Confidence is something you extract, calibrate, and route on, never something you take the model's word for.
Building something with LLMs?
I help teams ship GenAI that’s reliable and cost-efficient.
Let’s talk