Zero Labs
Industry News / AI

One Model’s Confidence Was Honest. The Other Said 100% on Its Mistakes.

Source · Towards AI By Abdul M.

From the publisher’s feed, collected in the ZeroLabs newsroom.

I tested five ways to tell when an LLM’s extraction is wrong, on 200 receipts and invoices. Which one worked depended on the model, and the obvious ones failed in specific ways.Every document extraction system ends up with the same question. The model read the invoice; do you trust it, or does a person look at it? If you could tell which outputs are wrong, you could let the rest straight through and send only the doubtful ones to review. That’s the whole economics of automating this kind of work.So I measured it. Two models extracted every field from 200 test documents, and for every field I computed five signals that might predict an error: the model’s own stated confidence, arithmetic checks, agreement between repeated samples, agreement with a second model, and a combination of all of them. Then I asked how many documents each signal lets through untouched at a fixed error rate.The short version: the model’s own confidence was the best signal for one model and nearly useless for the other, a second model was the best signal only when it was the stronger one, and the arithmetic checks scored below chance. The details are more useful than the summary, so here they are.This uses the same harness and runs as my previous article on per-field regression tests. The code and every number are in extraction-evals.The setupDocuments. 100 real receipts from CORD (Park et al., 2019) and 100 generated invoices with exact labels, the test split. That’s about 2,000 scored fields per model.Models. Gemini 3.1 Flash-Lite and Gemini 3.5 Flash-Lite. On these documents 3.1 gets 4.0% of fields wrong and 3.5 gets 1.4%. At the document level, where every field must be right, 32% of 3.1’s documents have an error and 10.5% of 3.5's.The signals, each a score per field where higher means “more likely right”:stated: the model’s own confidence, a number from 0 to 1 it returns for every field.checks: domain checks on the output, such as line totals summing to the subtotal, or subtotal plus tax equalling the total. A field gets 0 if a failed check touches it, 1 if only passing checks do, and 0.5 if no check covers it.consistency: 3.5 was run 5 times on every document. The score is the share of the other samples that give the same value (Wang et al., 2023; Manakul et al., 2023).cross_model: 1 if the other model gives the same normalised value, 0 if not.combined: a logistic regression over all of the above. It’s cross-fitted: documents are split into 5 folds, and each fold is scored by a model fitted on the other four, so no document is scored by a model that saw it.Token log-probabilities would be a sixth signal, but the Gemini models I used don’t return them.How each signal is scored. Three numbers:AUROC: the probability that a wrong field gets a lower score than a right one. 0.5 is chance.ECE, expected calibration error (Guo et al., 2017), for signals that are probabilities: when the signal says 0.9, are 90% of those fields right?Coverage at a fixed risk (Geifman and El-Yaniv, 2017): sort documents from most to least confident, accept from the top, and stop before the accepted ones contain more than 5% errors. A document’s confidence is its least confident field, and a document counts as correct only if every field is right. This is the number that matters in practice: what share of documents never needs a person.The resultsAUROC ECE docs auto-accepted at 5% errorGemini 3.1 Flash-Lite stated 0.67 0.037 0% checks 0.41 - 0% cross_model 0.88 - 0% combined 0.93 0.007 58.5%Gemini 3.5 Flash-Lite stated 0.79 0.004 52.5% checks 0.41 - 0% consistency 0.76 0.009 0% cross_model 0.65 - 0% combined 0.76 0.005 7%Risk against coverage at the document level. Accept the most confident documents first; the y-axis is the share of accepted documents with at least one wrong field.Each line has a story behind it.1. Stated confidence: honest in one model, not in the otherThe research I’d read going in says that when you ask a language model how sure it is, it tends to say “very” whether it’s right or not (Xiong et al., 2024). Tian et al. (2023) found that verbal confidence can be better calibrated than token probabilities for models tuned with human feedback. Both turned out to be true here, one per model.Gemini 3.1 Flash-Lite said 1.0 on 96% of fields. About 50 of its 80 errors came with that 1.0. On the 21 fields where it said 0.9, it was right on 57%.Gemini 3.5 Flash-Lite used the range, and the range meant something. At 0.9 it was right 90% of the time, at 0.95 96%, at 0.99 99%. Its expected calibration error is 0.004. Ranking documents by its least confident field auto-accepts 52.5% of them at a 5% error rate, with nothing else involved.Stated confidence against the share actually correct. The dashed line is perfect calibration. 3.5 sits on it; 3.1 says 0.9 and is right 57% of the time.I don’t know why the two differ this much. They’re from the same family and the same prompt. My guess is a mix of training and difficulty: the task is harder for the smaller model, and in human calibration studies overconfidence is also worst on the hardest questions. But that’s a guess, and the practical point doesn’t depend on it: whether stated confidence is usable is a property of the model, and you only find out by measuring it on your documents. A threshold tuned on one model doesn’t transfer to the next one, even within a family.2. A second model: only as good as the other modelWhen 3.1 and 3.5 gave the same value for a field, which happened on 96.2% of fields, that value was wrong about 1% of the time (19 of 1,922 for 3.1). When they disagreed, on 76 fields, 3.1 was the one wrong 61 times, 3.5 9 times, and both once.So for 3.1, disagreement with 3.5 finds 61 of its 80 errors. That’s why its AUROC is 0.88, the best single signal for the smaller model. For 3.5 the same disagreements flag only 9 of its 27 errors, because most of the disagreements are 3.1’s mistakes. Its AUROC is 0.65. A second model is a good error detector exactly when it’s at least as good as the first. Checking a strong model with a weaker one mostly finds the weaker one’s errors.The 19 errors where both agree are the interesting ones. They’re the shared mistakes, and when I audited them against the images they were mostly the same few things: zero-priced toppings listed as items, a total filled in on a receipt that doesn’t print one, a brand name taken for the legal name. Both models are from the same family, and I’d expect two models from different vendors to share fewer of these. I couldn’t test that here.Why it accepts 0% of documents. Agreement is a yes-or-no signal. At the document level there are only two groups: documents where the models agree on every field (141 of 200) and the rest. Among the 141, 11 still had an error in 3.1’s output, 7.8%. With nothing to rank inside that group, the signal can’t get under 5%. It’s a good filter and a bad ranker, and you need something continuous next to it.3. Asking the same model five times3.5 was sampled 5 times per document. The consistency score has an AUROC of 0.76, close to its stated confidence, at five times the calls.The weak point: on 1,970 of about 2,000 fields, all 5 samples agreed, and 13 of 3.5’s 27 errors are among them. Half of the model’s mistakes are mistakes it makes every time. Self-consistency catches the errors that come from sampling noise, a digit misread on one pass and not on another. It can’t catch a systematic misreading, like reading the brand in the header as the company name, because the model makes that one every time. For extraction, where most of the inputs are clear and most errors are systematic, I think that limits it a lot.4. The checks scored below chance, and that’s not a bugArithmetic checks feel like the most trustworthy signal: subtotal plus tax either equals the total or it doesn’t. Yet their AUROC is 0.41 for both models, below a coin flip.Breaking it down for 3.1:fields wrong error ratea failed check touches 15 7 47%only passing checks 1,203 64 5.3%no check covers it 780 9 1.2%A failed check is a strong signal: almost half the fields it flags are wrong. It just almost never fires, on 15 fields out of 2,000, partly because a failed check triggers a repair turn first. And the checks cover the amount fields, which are the ones that go wrong most. Fields with no check at all are nearly always right. So “covered by a passing check” ends up meaning “this is a field that goes wrong”, and the ranking comes out inverted.The lesson I take from it: a check tells you about the documents it fails on, and nothing about the ones it passes. Most errors pass every check, because a misread subtotal and a misread total can still add up, and a field the checks don’t touch can’t fail one. Checks are worth running for the repair turn and as a hard flag, but not as a confidence score.5. Combining them: big gain for one model, a loss for the otherFor 3.1 the combined score works. AUROC 0.93, calibration error 0.007, and it auto-accepts 58.5% of documents at a 5% error rate, where no single signal accepts any. I’d guess most of the work is done by agreement with 3.5, with stated confidence and the checks breaking ties inside the agreeing group, though I haven’t inspected the weights fold by fold.For 3.5 the combination accepts 7% of documents at 5% error, against 52.5% for stated confidence alone. I think the reason is simple: 3.5 makes 27 errors in 2,000 fields, and a regression fitted on four fifths of that has about 20 errors to learn from. It learns weights for signals that are noisy for this model (cross_model, checks), and they drown out the one that works. Cross-fitting keeps the number honest, but it doesn’t make 20 examples enough. On a model this accurate, I’d keep the single signal that’s calibrated and stop there, until there’s enough labelled data to fit something better.What I’d doMeasure stated confidence before using it, per model. It was the best signal for one model and nearly useless for the other, with the same prompt.Use a second model as a filter, not a score, and pick a strong one. Agreement removes most errors when the checker is at least as good as the model being checked. Use something continuous to rank inside the agreeing group.Don’t expect resampling to find systematic errors. Half of the better model’s errors were the same in all five samples.Treat checks as flags. A failed check means look at it. A passed check means very little.Report coverage at a fixed risk, at the document level. AUROC on fields looked good for several signals that, at 5% document error, accepted nothing.Don’t fit a combination on a handful of errors. With 27 errors it did worse than one good signal.All of this is two small models from one family on 200 documents, so I’d treat the specific numbers as one data point and the method as the part worth reusing. Different-vendor cross-checks and token probabilities are the two signals I’d most like to add.The signals, the risk-coverage code and every number above are in github.com/abdulm-ai/extraction-evals. python -m xeval report rebuilds them from the committed predictions without an API key.ReferencesXiong, M. et al. (2024). Can LLMs Express Their Uncertainty? An Empirical Evaluation of Confidence Elicitation in LLMs. ICLR 2024.Tian, K. et al. (2023). Just Ask for Calibration: Strategies for Eliciting Calibrated Confidence Scores from Language Models Fine-Tuned with Human Feedback. EMNLP 2023.Guo, C., Pleiss, G., Sun, Y. and Weinberger, K. Q. (2017). On Calibration of Modern Neural Networks. ICML 2017.Geifman, Y. and El-Yaniv, R. (2017). Selective Classification for Deep Neural Networks. NeurIPS 2017.Wang, X. et al. (2023). Self-Consistency Improves Chain of Thought Reasoning in Language Models. ICLR 2023.Manakul, P., Liusie, A. and Gales, M. J. F. (2023). SelfCheckGPT: Zero-Resource Black-Box Hallucination Detection for Generative Large Language Models. EMNLP 2023.Park, S. et al. (2019). CORD: A Consolidated Receipt Dataset for Post-OCR Parsing. Document Intelligence Workshop at NeurIPS. CC BY 4.0.One Model’s Confidence Was Honest. The Other Said 100% on Its Mistakes. was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.