Sub topic 5
How Costly Are Wrong Answers?
Assume you understand how software features are built, have a general idea of machine learning and large language models, and can read short Python snippets. This chapter focuses on deciding what to do when an AI feature can produce incorrect results.
Separate error types
An AI system is probabilistic. It produces an answer based on patterns, not a guaranteed proof. A wrong answer can have different forms:
- A false positive treats a safe or valid case as problematic.
- A false negative misses a real problem.
- A factual error gives an incorrect statement.
- An unsafe action changes data, sends a message, or makes a decision without enough evidence.
- An inconsistent answer behaves differently for similar inputs.
The same accuracy rate can be acceptable in one feature and dangerous in another. A wrong movie recommendation wastes a few seconds. A wrong medication instruction can cause serious harm.
| Feature | Possible wrong result | Reasonable control |
|---|---|---|
| Search suggestions | Irrelevant result | Let the user try another query |
| Support triage | Ticket sent to the wrong team | Allow reassignment and monitor delays |
| Account deletion assistant | Account deleted incorrectly | Require confirmation and human review |
| Medical guidance | Unsafe recommendation | Do not allow autonomous diagnosis or treatment |
Estimate expected harm
Start by listing the possible errors and assigning each one an approximate cost. A simple expected-cost estimate is:
expected cost = error probability × cost per error
Use this estimate to compare designs, not to pretend that risk is perfectly measurable. Include financial loss, user frustration, delayed work, safety impact, legal exposure, and damage to trust.
For example, suppose an AI classifier routes 1,000 support tickets. It misroutes 8 percent of tickets, and each misroute costs the team an average of $4 in extra work. The expected operational cost is $320. If a human review step reduces the error rate to 2 percent but adds $180 in labor, the combined expected cost is $260. The review step may be worthwhile, even before considering customer satisfaction.
def expected_cost(number_of_cases, error_rate, cost_per_error):
return number_of_cases * error_rate * cost_per_error
ai_cost = expected_cost(1000, 0.08, 4)
reviewed_cost = expected_cost(1000, 0.02, 4) + 180
print(f"AI-only expected cost: ${ai_cost:.2f}")
print(f"Reviewed expected cost: ${reviewed_cost:.2f}")Match oversight to the failure
Design the feature around its worst credible failure, not only its average score. A low average error rate can hide a small group of severe failures.
A fallback is a safe alternative when the model is uncertain or unavailable. Examples include returning search results, asking a clarifying question, routing to a human, or leaving the original workflow unchanged. A fallback should be usable, not merely an error message.
Set an error budget
An error budget is the maximum acceptable level of failure for a feature. Define separate limits for ordinary errors and severe errors. For example:
- At least 95 percent of low-risk classifications must be correct.
- No high-risk action may run without confirmation.
- Every low-confidence result must use a fallback.
- Users must be able to undo an automated change.
These rules turn vague concern into a launch decision. If the feature cannot meet the limit, reduce its scope, add oversight, improve the baseline, or do not use AI.
Exercise
An AI feature makes 3 percent errors. Each ordinary error costs $2, but one rare error could cost $10,000. Should the 3 percent rate alone determine whether to launch?
Show answer
No. Measure ordinary and severe errors separately, then add controls such as confirmation, human review, or a blocked high-risk action.