Build a failure taxonomy that changes the next experiment

Technical deep dive · Published · 6 min read

A taxonomy is useful when a label changes what the team does next. If every failure ends in "improve the prompt", the categories are decoration.

Diagram for Build a failure taxonomy that changes the next experiment: approved hand-drawn card
Diagram for Build a failure taxonomy that changes the next experiment: approved hand-drawn card Enlarge

I would build an AI product taxonomy from annotated examples, not from a list of impressive-sounding error names. Start with observations. Group failures that suggest a shared intervention. Keep room for uncertainty. Revise the categories when they stop helping.

The aim is to make failure review actionable without pretending every cause is already known.

Keep three axes separate

For a synthetic internal policy assistant, I would use separate fields for symptom, suspected mechanism and severity.

A symptom describes what the user received: unsupported claim, missing required fact, wrong workflow route or unnecessary refusal.

A suspected mechanism describes where the problem might originate: source coverage, retrieval, interpretation, tool interaction, policy enforcement or evaluation infrastructure.

Severity describes consequence in the intended context: cosmetic, material or critical under the product's agreed rules.

These are different questions. A retrieval omission can produce a harmless omission in one case and a serious disclosure problem in another. A category called "severe hallucination" combines mechanism, symptom and impact before the evidence justifies all three.

Start with a working set, not a universal standard

Here is an illustrative taxonomy. It is a proposed design, not an industry standard or a measured distribution.

FamilyObservable boundaryNext investigation
Source unavailableRequired approved evidence does not exist in the corpusData ownership and product scope
Evidence not retrievedApproved evidence exists but was not suppliedSearch, filtering and chunk coverage
Evidence misappliedRelevant evidence supplied but answer contradicts itContext use and task instructions
Task misunderstoodAnswer solves a different requestIntent and clarification behavior
Tool failure mishandledTool fails but output implies successError handling and state checks
Authorization boundary crossedProhibited access or action attempted or completedPermissions and enforcement
Unnecessary refusalSupported, authorized task declinedRefusal policy and routing
Evaluation defectValid behavior rejected or environment invalidCase, grader and harness repair

Each family needs inclusion rules, exclusion rules and examples. "Evidence not retrieved" should not include a document correctly excluded by the user's permissions. "Tool failure mishandled" should distinguish a tool outage from the assistant falsely claiming success after that outage.

Anthropic's distinction between transcript and outcome is particularly useful for action errors. The statement "I updated the record" and a verified record update are different evidence.

Allow multiple labels without double-counting

A synthetic case might retrieve an outdated policy, give the wrong answer and attempt an unauthorized update. Those are not mutually exclusive events.

Use one primary diagnostic label if the review process needs an owner, plus secondary labels for other observed failures. State how aggregate charts count them. A chart of cases with at least one failure uses cases as its denominator; a chart of annotations can count a case several times. Neither is wrong if labeled correctly.

Do not force a single root cause simply to make percentages sum to a neat total. If the trace supports only a symptom, record the symptom and leave mechanism unresolved.

Retain a category for unknown. Review it regularly. Unknown is a queue for investigation, not a place to hide inconvenient failures.

Test whether reviewers can use the categories

Give reviewers the same varied batch and ask them to label independently. Compare which categories they confuse and which evidence they cite.

If one reviewer uses "task misunderstood" and another uses "evidence misapplied" for the same case, inspect the inclusion rules. Perhaps the question contains two requests. Perhaps the retrieved policy is irrelevant. Perhaps both labels apply.

Clarify the boundary and test it on fresh examples. Do not measure success by how quickly reviewers agree after discussing the exact answer together. The useful test is whether the revised definitions transfer to other cases.

This process is consistent with the primary-source advice to use explicit criteria, human calibration and trace review. The taxonomy itself remains a product-specific recommendation.

Prioritize by consequence as well as frequency

Suppose an explicitly fictional review finds many missing citations and one unauthorized action. It would be a mistake to fix only the largest bar on the chart. Frequency measures how often something appears in the reviewed sample. It does not measure the full cost of the event.

I would review exposure, severity, detectability and the confidence in the diagnosis alongside frequency. For a critical permission boundary, engineering enforcement may be a better investment than prompt wording even if the event is rare.

A failure-only dataset cannot estimate prevalence in traffic. To say a category affects a proportion of requests, sample from the relevant traffic population and state the denominator. A collection of escalated complaints answers a different question.

Version the taxonomy

Store a taxonomy version with every annotation. When categories change, maintain a mapping from old labels to new ones and explain ambiguous migrations.

If one broad retrieval category becomes source-missing and evidence-not-retrieved, old counts cannot automatically be split. Reannotate the old cases if a historical comparison matters. Otherwise mark the break in the time series.

Keep the trace identifiers stable. A taxonomy change should not erase the underlying evidence or quietly alter past results.

Use the chart to choose an experiment

A useful review ends with a statement such as: "These failures share missing evidence under the same document filter. We will test that filter while holding the model and prompt fixed."

It should also name the expected regression risk: perhaps retrieving more documents increases exposure to irrelevant or unauthorized content. The experiment must test that risk too.

The taxonomy has now done its job. It translated a collection of bad answers into a falsifiable hypothesis and an owner.

Before adding another category to your dashboard, ask what different action follows from it. For help connecting failure analysis to an enterprise AI delivery workflow, see my consulting work.

Audit the taxonomy against the work queue

At a review checkpoint, take one case from each active family and ask the assigned engineer what they would investigate first. If every answer is identical, the categories may not be separating meaningful work.

Then inspect the unknown bucket. Some cases will need more evidence; others may reveal a category that is missing. Create a new family only when there is a stable boundary and a useful consequence for diagnosis or ownership. A single memorable incident does not always justify a permanent branch in the taxonomy.

Also look for categories that have become too broad. A tool-error family may need to distinguish invalid arguments, unavailable service and incorrect handling of a valid error response. Those distinctions become useful when the fixes and responsible teams differ.

Do not mistake a cleaner taxonomy for a better product. A relabeling exercise can change the shape of a dashboard without changing any user outcome. Track taxonomy maintenance separately from interventions that alter system behavior, and explain which one caused a change in reported counts.

Common questions

Should every product use the same taxonomy?

No. Reusable families can help, but category boundaries should match the product, evidence and interventions available.

Can one case have several labels?

Yes. Preserve the distinction between case counts and label counts, and explain the aggregation rule.

What if the taxonomy changes mid-project?

Version it, keep the original annotations and document whether historical cases were reannotated or mapped.

Enquiry

Tell me about the work

The use case, where it is blocked and who is involved. I reply with a suggested starting point. Or email hello@mayurpatil.ai.

Goes to my CRM and my inbox. No newsletter, no sharing. See Privacy (opens in a new tab).

Close