· Updated
Beyond Confidence Scores: Measuring the Reliability of LLM Extraction
By Arshad Ansari
A model's confidence score does not tell you whether the extracted value is correct. It tells you how sure the model sounds. Those are different things, and the gap between them is where extraction pipelines fail quietly.
This post is part of a series on meaning in data systems. The last two covered extraction pipelines and the gap between claims and facts. This one is about knowing whether extraction works.
Why confidence alone fails
An LLM can return an invoice total with high confidence and be wrong. It can return the same field with low confidence and be right. The score reflects how the model read the text. It does not reflect how often that kind of read is correct on your documents.
Three things make the score unreliable on its own:
- It is not tied to your data. The model has never seen your suppliers, your layouts or your odd scans. Its confidence comes from general training, not from your error rate.
- It differs by field. A model may be right almost every time on a date and wrong far more often on a line-item split. One global threshold hides that.
- It drifts. A new supplier, a new template or a model upgrade changes how the score maps to accuracy. A threshold that worked last quarter may not work now.
A wrong value that looks confident is the worst case. It passes your checks and lands in a table that someone later trusts.
Start with labeled examples
The fix starts with a small set of documents where a person has written down the correct answer for every field. This is the labeled set. Everything else depends on it.
Keep it honest:
- Draw it from real documents, not clean samples.
- Include the awkward ones: poor scans, unusual layouts, missing fields.
- Keep a part of it aside and never tune on that part. It is your test.
- Add to it each time a reviewer corrects the pipeline in real use.
With a labeled set you can measure, per field, how often the extraction is right. That is the number the confidence score was supposed to stand in for.
Calibrate the score against reality
Now compare the two. Group the extractions by the confidence the model gave. For each group, count how many were actually correct on your labeled set.
If the model says it is highly confident and is right nearly every time, the score is useful at that level. If it says it is highly confident and is wrong often, the score is not safe to act on, and you set your threshold higher or ignore the score for that field.
Do this per field. Set a threshold for each one based on what a wrong value costs you. A wrong date on an internal report is cheap. A wrong amount that triggers a payment is not.
Let the pipeline abstain
A pipeline that must always answer will sometimes guess. Give it a way to say "I do not know".
Abstention means the field stays empty and the document goes to a person, with the reason attached. It can come from several signals, and the model's score is only one of them:
- Confidence below the threshold you calibrated for that field.
- Two extraction passes that disagree.
- A value that fails a rule: a total that does not equal the sum of its lines, a date in the future, a tax id with the wrong shape.
- A document type the pipeline has not seen before.
Checks that come from your own data model are often stronger than the model's score. They do not depend on how sure the model feels.
Send people the right documents
Review everything and you have built an expensive manual process. Review nothing and you have built a risk. Targeted review sits between the two.
Send a person only the documents the pipeline abstained on, plus a small random sample of the ones it accepted. The sample matters. It is how you catch a field where the pipeline is confidently wrong, because those never trigger an abstention.
Every correction goes back into the labeled set. Over time the set grows toward your real documents, the thresholds get better, and the review queue shrinks for the right reasons.
This is the same idea I use for AI workflows in general: a consequential action waits for a human, and the data work underneath is what tells you when to ask. If you want to check your own workflow against that, the AI Workflow Teardown is free and ungated: https://hikmahtechnologies.com/ai-workflow-teardown/
What to measure on an ongoing basis
Reliability is not a one-time test. Track these each week:
- Accuracy per field on the held-back labeled set.
- The share of documents the pipeline abstains on, per document type.
- The disagreement rate between reviewers' corrections and accepted values in the random sample.
- Any change after a model or prompt update, measured on the same labeled set before the change goes live.
A rising abstention rate is not always bad. It can mean the pipeline is correctly noticing a new kind of document.
Who this is not for
If you extract a few documents a month and a person already reads each one, you do not need this. Read them. A labeled set, thresholds and a review queue are worth building when volume is high enough that nobody can check everything, and when a wrong value costs real money or trust.
I am one person, so I take on a small number of engagements at a time. If your extraction pilot works in a demo and you cannot say how often it is right on your own documents, that is the gap this post describes, and the teardown above is the place to start.
Common questions
- Can I trust the confidence score an LLM gives for an extracted field?
- Not on its own. A confidence score says how sure the model sounds. It does not say how often the model is right. You only learn that by checking its answers against labeled examples.
- What is calibration in LLM extraction?
- Calibration means that when a field is marked with a given confidence, it is correct about that often. You measure it on labeled examples and adjust the threshold until the score means something.
- What should an extraction pipeline do when it is unsure?
- It should abstain: leave the field empty and send the document to a person. A blank with a reason is cheaper than a wrong value that flows into a table.
Get new posts by email
Data engineering notes like this one — what breaks and what it costs, in production.
What breaks and what it costs — pipelines, warehouse bills, and the failures that only show up in production. A few a month, never padded to hit a schedule. No sequence, no pitch deck. Reply 'stop' once and you're off — it reaches me, not a queue.
Want the whole playbook?
If this was useful, the long version is my book. Local-First Analytics — 313 pages, runnable code for every chapter — is the full build: DuckDB, Parquet and Arrow, from install to production. On Amazon, and chapter 1 is free to read here.
Not ready to buy? Read chapter 1 free — the whole chapter, no email required.
Rather talk it through? Book a free 30-minute call. No slot that suits your time zone? Email info@hikmahtech.in.