Evaluation-Driven Development › Error Taxonomy

Michael BrenndoerferDecember 2, 20262 min read
Language AI HandbookAll chapters
Part 64 of 67Compound AI System Design
Chapter 487Evaluation-Driven Development › Error Taxonomy
Reading section 7 of 14 · Error Taxonomy · 2 minSection 7 of 14 · 2 min

Section 7 of 14 · 2 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

Use a small set of labels to describe evidence recorded in this harness. A missing document is a retrieval miss. A forbidden output substring is a veto. A partial result with a retrieved document indicates missing required text in this fixture. A separate unknown label covers absent retrieval instrumentation. A label identifies a next step for investigation.

PythonIn [21]
CollapseExpand
def classify(trace: Trace, case: Case) -> str:
    if trace.score == 1.0:
        return "pass"
    retrieval = trace.find("retrieve")
    if not retrieval:
        return "unclassified"
    if not retrieval[0].payload["found"]:
        return "retrieval_miss"
    if any(bad.lower() in trace.answer.lower() for bad in case.must_exclude):
        return "forbidden_text"
    return "missing_required_text"
PythonIn [22]
CollapseExpand
from collections import Counter

by_id = {case.case_id: case for case in SUITE}
labels = [classify(trace, by_id[trace.case_id]) for trace in dev_traces]
print("Dev taxonomy:", dict(Counter(labels)))
ConsoleOut [22]
CollapseExpand
Dev taxonomy: {'pass': 4}

The baseline fixture passes its dev cases. Now change generation settings and configure one missing retrieval. These synthetic failures exercise the separate labels.

PythonIn [23]
CollapseExpand
broken_config = {
    "drop_receipt_hint": True,
    "wrong_window": True,
    "retrieval_miss": True,
}
broken = [run_case(case, broken_config) for case in SUITE]
for trace in broken:
    label = classify(trace, by_id[trace.case_id])
    if label != "pass":
        print(trace.case_id, label, repr(trace.answer))
ConsoleOut [23]
CollapseExpand
c001 missing_required_text 'Refunds are available within 30 days.'
c002 forbidden_text 'No. Refunds are available within 60 days.'
c004 retrieval_miss "I don't have information on that."

Compare label counts on the same six cases. The first taxonomy above covers development cases only. Both runs here include the two holdout fixtures for illustration. The shared denominator isolates the configuration change in this fixture.

PythonIn [24]
CollapseExpand
full_baseline = [run_case(case, {}) for case in SUITE]
for name, traces in (("baseline", full_baseline), ("broken", broken)):
    full_counts = Counter(
        classify(trace, by_id[trace.case_id]) for trace in traces
    )
    print(name, dict(full_counts))
ConsoleOut [24]
CollapseExpand
baseline {'pass': 6}
broken {'missing_required_text': 1, 'forbidden_text': 1, 'pass': 3, 'retrieval_miss': 1}

The three seeded failures exercise three distinct rules. A missing retrieval points to the retriever. Forbidden or missing answer text triggers a check of both the retrieved material and the generation trace. A field called found only establishes that a document was found. It does not establish its relevance or correctness.

Choose labels that point to distinct investigations. Keep enough evidence to revisit a diagnosis and allow multiple contributing failures where your system needs them.

Comments

Add to the conversation

A question, a correction, or an example from your own work.

No comments yet. Be the first to share your thoughts!

Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy