All posts

"When the model should say 'I don't know': confidence gates and human-in-the-loop design"

Models are trained test-takers: a wrong guess and "I don't know" score the same, so they guess. If a confident wrong answer costs you money or trust, abstention has to be engineered in, real confidence signals, a measured threshold, and a review queue that actually gets worked.

AI engineering5 min read14 July 2026by Ahmed
"When the model should say 'I don't know': confidence gates and human-in-the-loop design"

If an AI system has ever burned you, it probably wasn't because the model refused to answer. It answered, fluently, confidently, in perfect grammar, and it was wrong. The invoice total off by a digit, the customer detail that was invented, the classification that sent the wrong email to the wrong person. The damage wasn't the error itself; it was that nothing in the system's tone gave you any reason to doubt it.

You cannot prompt this away, and it is worth understanding why. Models are trained and benchmarked as test-takers, and on most benchmarks a wrong guess scores the same as "I don't know": zero. OpenAI's researchers made the argument formally in their 2025 paper "Why Language Models Hallucinate", binary, accuracy-only grading rewards confident guessing and penalises abstention, so guessing is what models learn. You can ask a model to admit uncertainty, but its expressed confidence is only loosely tied to its actual accuracy, and the fine-tuning that makes models pleasant to talk to has been shown to make that calibration worse.

So abstention has to be engineered in from outside the model. The pattern is simple to describe: attach a confidence score to each field or decision the system produces, set a threshold, and route anything below it to a human review queue instead of letting the system act. Above the line, the system proceeds automatically. Below it, a person looks. The model never gets to be quietly wrong about the cases it was least equipped to handle.

"When the model should say 'I don't know': confidence gates and human-in-the-loop design"

The first practical question is where that confidence number comes from, because the obvious answer, ask the model to rate itself, is the weakest. Self-reported confidence runs high regardless of correctness, and token probabilities, where providers expose them at all, tend to saturate near certainty once you use structured outputs. The signals that have held up in systems I run are cheaper and duller: agreement across repeated runs of the same input, a separate verification pass that checks the answer against the source text, and deterministic checks that need no model at all, does the schema validate, do the line items actually sum to the extracted total, does the date parse. A confidence score assembled from evidence like that is worth acting on. A self-reported one is decoration.

The arithmetic behind the whole design is worth stating plainly. A human reviewing five flagged edge cases a day costs a few minutes, and every review is a correct outcome. A model being quietly wrong fifty times a day is fifty small incidents compounding into refunds, apology emails, and a growing suspicion that the system can't be trusted. The review queue isn't an admission that the automation failed; it's what lets everything above the line run unattended with a clear conscience. It's also my working definition of automation that augments people rather than replaces them: the system does the volume, the person does the judgement.

Choosing the threshold is where the engineering gets interesting, and the honest answer is that you don't choose it, you measure it. You need an evaluation set: real inputs with known-correct answers. Run the system across it and you see directly how accuracy varies with confidence, and what any given threshold buys you. Then it becomes an explicit trade: what does a wrong action cost, and what does a review cost? A mispaid invoice means a high bar and more reviews; a slightly worse product recommendation means a low one. The threshold is a business decision expressed as a number, made deliberately, not a vibe.

The second place teams fail is the queue itself. A review queue nobody works is worse than no queue at all, because it launders risk, the architecture diagram looks safe while flagged items quietly age. The queue has to be small, which the threshold controls; prioritised, so the expensive mistakes surface first; and above all it has to carry context. The reviewer should see the input, the model's answer, its confidence, and why it was flagged in one place, so a decision takes thirty seconds rather than five minutes of archaeology. Design the queue as a product for the reviewer, not as an exception log.

There is also a compounding benefit most teams leave on the table: every human correction is labelled data. When a reviewer fixes a flagged answer, that input-and-correct-output pair should flow back into your evaluation set. The cases your system finds hardest become exactly the cases you measure it against, so the eval sharpens precisely where the model is weakest. Over time you watch review rates fall, or catch a regression the moment a model or prompt change pushes them back up.

If you want the pattern in working code rather than prose, my public repo at github.com/afareed007/docextract implements it for document extraction: extracted fields carry confidence scores, anything below the gate is marked needs_review rather than passed downstream, and the eval harness fails CI if a change degrades field-level accuracy. It is a small system, but the shape is the one that holds at scale.

I'll be honest about the limits: confidence scores are estimates, thresholds need re-tuning when models or inputs drift, and no gate catches everything. But the difference between a system with an abstention path and one without is the difference between an occasional review task and an incident channel. This is the kind of work I do, building AI systems that know when to act and when to hand over to a person. If you're automating decisions where a confident wrong answer is expensive, get in touch via the contact form.

Senior engineering roles — or production AI consulting?

I'm open to senior AI and software engineering roles and to selective consulting on agents, RAG, and LLM automation in production. If this post resonates — as a hiring manager or as someone shipping similar work — get in touch.

Get in touch

© 2026 Ahmed Fareed. All rights reserved.

LOADING