DEV Community

Cover image for Does your AI feature ever say "I don't know"? (Friday AI question)

Does your AI feature ever say "I don't know"? (Friday AI question)

M.T.Ramkrushna on November 13, 2026

Friday AI Question. This week's question is one I think most teams never ask out loud: When your AI feature doesn't know the answer, what does it ...
Collapse
 
izgorodin profile image
Edward Izgorodin •

D, with one more split for features that answer from a store that changes over time. Some confident wrong answers are not guesses at all: retrieval found a record, the model quoted it faithfully, and the record had been replaced since. A similarity threshold will not catch it, because the old record often scores as high as the new one, both being about the same thing. If the eval counts it as its own class, a bad week tells you whether to fix retrieval or to fix how replacements are written, and the answer itself can say the useful thing: there are two records, and the newer one disagrees.

Collapse
 
m_t_ramkrushna profile image
M.T.Ramkrushna •

Good point: stale-but-faithful answers are a separate failure class. I'd store a version or updated_at on each chunk and have retrieval flag when a newer record supersedes the one it cites, so the answer can surface both instead of quoting the old one.

Collapse
 
izgorodin profile image
Edward Izgorodin •

A version or updated_at tells you which record is newer, but not which one it replaces. Two records about the same customer can both be current, one about the plan and one about the address, and a newer timestamp on the second says nothing about the first. What lets retrieval flag the stale one without guessing is a link written at update time, saying this record replaces that one, so the old record can be shown as replaced instead of being ranked against the new one by score or date.

Thread Thread
 
m_t_ramkrushna profile image
M.T.Ramkrushna •

That replaces-link is the right fix: a timestamp only orders records, it can't say which one supersedes which. I'd write a supersedes_id at update time and have retrieval drop or flag any chunk that a newer record points to before ranking.

Thread Thread
 
izgorodin profile image
Edward Izgorodin •

Dropping before ranking is the right default for questions about the current state. For questions about what it used to be, the same link is what lets the old record come back on purpose, so I would keep a replaced record out of ranking rather than out of the store. And if a newer record is linked by mistake, a flag shows the reviewer which record was hidden and by what, which a silent drop does not.

Collapse
 
recallrundev profile image
RecallRun •

D, mostly. The thing I'd add to C is that "evidence is weak" needs a number picked from labelled data, not a feeling.

I tried a top-1 cosine threshold on the FastAPI docs (MiniLM, 2,808 chunks) with 30 answerable and 30 unanswerable questions. At 0.40 it refused 24 of the 30 unanswerable ones and still answered 29 of 30 answerable.

The unrelated questions (boiling eggs, tides) were easy: all of them scored below 0.30, under the weakest real question at 0.39. The hard part was near-domain stuff like rate limiting or Prometheus metrics. Those scored up to 0.51 and overlapped the lowest answerable queries, so no single threshold separates them. That's where your answer-level check has to take over.

One trap: "retrieval returned nothing" doesn't work as the abstain signal with BM25. It returned candidates for all 60 queries, because words like "how" and "do" always match something.

Collapse
 
m_t_ramkrushna profile image
M.T.Ramkrushna •

That overlap in the near-domain questions is the useful finding. When no single threshold separates them, I'd route the 0.35-0.55 band to a second check, like asking the model whether the retrieved chunk actually answers the question, and refuse only if that fails too.

Collapse
 
jes_p_d4f61f7aa2ec405a418 profile image
Dev_PJS •

C, with one amendment from hard experience: the abstention has to show its work or it decays into laziness with good PR. 'I couldn't find this' plus what was searched, where, and what would settle it — that's a useful answer. A bare 'I don't know' is just a refusal wearing the costume. On scoring: D matters more than it looks. In my world the expensive failure was never silence; it was a confident number that turned out to be invented, steering real money before anyone rechecked it. An eval that lumps abstentions with wrong answers trains exactly that failure — it teaches the model that guessing pays better than honesty. Score 'didn't know and said so' as its own class, and price a confident wrong answer at ten times an abstention. The behaviour you want shows up fast once the scoreboard stops punishing it.

Collapse
 
m_t_ramkrushna profile image
M.T.Ramkrushna •

Pricing a confident wrong answer at ~10x an abstention is a great way to make the eval reflect real cost. I'd also have the abstention carry a structured reason (what was searched, what's missing) so you can grade that it was justified, not just that it refused.

Collapse
 
codingwithjiro profile image
Elmar Chavez •

Interesting. Thank you for showing the numbers. I got more in depth knowledge of AI. I think that old reward system has to go. Of course, bots would rather guess (little chance than no chance at all) for the reward. Decisions which require utmost care (i.e. hospital bills) are something the system should not hand off to AI entirely.

Collapse
 
m_t_ramkrushna profile image
M.T.Ramkrushna •

Agreed. The fix I'd start with is routing by stakes: high-cost decisions like billing get an abstain-and-escalate path to a human, and the eval scores a correct "I don't know" higher than a confident guess. That flips the incentive so guessing stops being the best strategy.