Why are LLM confidence scores unreliable?
A general-purpose LLM like GPT-4 has no internal signal for how certain it is about a value it extracted. When you add a confidence field to your output schema, the model generates that number the same way it generates every other token — by predicting what looks plausible. It is not measuring anything, so the score is uncalibrated and can be confidently wrong.
Last updated 2026-07-20
What people usually try
The common approach is to add a `confidence` property to the structured-output schema and ask the model to fill it in. Every model will comply and return tidy numbers like 0.98 next to each field. It looks like confidence.
It isn't. The model produced that 0.98 by the same next-token prediction that produced the field value itself. There is no separate act of measurement happening.
Why the number is fake
A calibrated confidence score has to reflect something real — for document extraction, how legible a character actually was on the page. A general LLM has no access to that. It sees the image, produces text, and produces a confidence token, all from the same probability distribution.
Token log-probabilities are a partial exception, but they measure how sure the model was about its own text, not whether the reading is correct — and most vision/extraction endpoints don't expose per-field log-probs anyway. A fluent wrong answer often carries high log-probs.
What a real confidence score requires
You need a model that runs an actual OCR (or detection) engine whose certainty about each word is a measured quantity, and that reports it. Interfaze is a hybrid model that does exactly this: it returns a `precontext` array with the OCR engine's per-word confidence and bounding boxes alongside the normal structured answer.
The tell is where the number comes from: if confidence is a field in your schema, it's the LLM guessing. If it arrives as separate metadata the API returns regardless of your schema, it's the encoder measuring.
FAQ
Can I use token logprobs as a confidence score?
Only weakly. Logprobs tell you how sure the model was about its tokens, not whether the extracted value is correct, and many vision endpoints don't expose per-field logprobs.
Does a higher confidence number mean the answer is right?
Not from a general LLM. The number and the value are produced by the same guessing process, so a confident answer can still be wrong.