How to build an AI product from its failures

Technical deep dive · Published · 7 min read

Evals, error annotation, taxonomy, rubrics, human baselines and iterative improvement are not six disconnected practices. They form a learning loop.

Diagram for How to build an AI product from its failures: approved hand-drawn card
Diagram for How to build an AI product from its failures: approved hand-drawn card Enlarge

An eval reveals a behavior. Annotation explains the evidence. A taxonomy groups patterns. A rubric defines the decision. A baseline provides a meaningful comparison. Iteration tests whether an intervention improves the product without damaging something else.

I would organize the work around that loop rather than around a sequence of model upgrades. The examples below are entirely synthetic. No system was deployed, no client results are claimed and no benchmark was run.

Use case one: an internal policy assistant

The fictional assistant answers employee questions using approved policy documents. It can read and draft. It cannot approve claims, modify employee records or send payments.

The product requirement is supported guidance within the user's permissions. Useful escalation counts as success when the evidence is genuinely missing. Unnecessary refusal counts as failure when the answer is available and permitted.

That distinction prevents the easiest way to raise a safety score: refusing everything.

Step one: build the case bank with roles

Collect approved, redacted examples of ordinary questions and exceptions. Add explicitly synthetic boundary cases for conflicting policy versions, missing worker categories and unauthorized requests.

Keep related incidents and paraphrases together when splitting the dataset. Development cases are visible to the builders. A regression suite protects known behavior. A release holdout is reserved for an independent check after the candidate and criteria are fixed.

Store source snapshots, access context, tool-state fixtures and criterion versions. The same question under different permissions is a different test condition.

Step two: write a rubric with gates

The fictional rubric checks policy grounding, correct workflow route, useful next step and honest action reporting. A critical gate prohibits disclosure of restricted content or unauthorized state changes.

Use code to check schema and sandbox state. Use human-calibrated judgment for whether the answer follows the applicable policy. Do not let a fluent explanation outweigh a failed permission gate.

Before grading the assistant, ask people to apply the rubric to clear, failed and borderline examples. Preserve disagreement and clarify the policy when the source itself is unresolved.

Step three: annotate the trace

A contractor asks about a travel form. The answer wrongly recommends the employee process. The approved contractor appendix exists but was absent from the supplied context.

The observation is the wrong route. The trace finding is absent evidence. The hypothesis is a retrieval filter defect. Those are separate fields.

A second case has the appendix in context but still chooses the wrong route. It has the same symptom but a different diagnostic path. Without trace review, both could become an unhelpful label called "bad answer".

Step four: let the taxonomy select an experiment

Group the first case under evidence-not-retrieved and the second under evidence-misapplied. Track severity separately.

For the first family, test the document filter. Keep the model and answer prompt fixed. Predict that the appendix will appear and routing will improve. Also test that the change does not expose documents to users who lack permission.

For the second family, inspect the task instructions and evidence presentation. Do not assume a larger context window solves a reasoning error.

Step five: compare without hiding regressions

The following is an invented arithmetic example, not a measured result:

Development sliceCasesBaseline passesCandidate passes
Ordinary permitted questions121011
Contractor exceptions625
Missing evidence433
Authorization boundaries221
Total241720

The candidate improves the overall pass count from 17 to 20. It also introduces a failure in the authorization slice. Under the stated critical gate, it does not ship.

Even these slice totals are insufficient. Inspect which cases changed. If the ordinary slice contains two fixes and one new failure, the net gain of one hides both movements. Report case-level transitions as well as totals.

The small fictional dataset cannot establish a precise production success rate. It exists to show how a release decision can differ from an average-score decision.

Step six: add a human workflow comparison

Compare an employee using ordinary approved tools, the assistant within scope and an employee using the assistant with review. Use comparable cases and record tools, permissions, completion time and correction effort.

Keep reference authors, task performers and graders conceptually separate. Blind grading where feasible. Account for learning effects if the same people see related cases more than once.

If the assisted workflow needs extensive checking, count that effort. A fast draft is not the same as a faster acceptable resolution.

Step seven: evaluate the final candidate independently

Freeze the candidate configuration and criteria before using the release holdout. If the result leads to more tuning, record that the inspected cases have become development material. Obtain fresh independent evidence for the next release claim.

Passing the holdout supports a bounded result under the tested conditions. It does not replace monitoring or a rollback plan. Start with a controlled deployment appropriate to the risk, not an assumption that offline success generalizes indefinitely.

Use case two: invoice extraction

Now change the product. A synthetic invoice assistant extracts supplier, invoice identifier, currency and line items. It drafts a record for review but does not authorize payment.

The measurement problem changes. Deterministic checks can verify required fields, arithmetic consistency and whether a draft was created in the sandbox. A rubric can assess whether an unreadable field was honestly marked uncertain instead of guessed.

The taxonomy should distinguish source unreadable, field missing, wrong field mapping, duplicate handling and unauthorized action. A wrong currency is not the same problem as an invalid JSON object, even if both make the record unusable.

Build cases where the correct outcome is a complete extraction, cases where a reviewer must inspect the original, and cases that should be rejected as duplicates. Synthetic variations can test these boundaries, but actual frequency must come from an appropriately sampled population.

Compare the full human workflow: manual entry versus reviewed extraction, including verification and correction time. A tool that speeds entry while increasing missed currency errors may fail the product's quality bar.

Hill climbing might test a preprocessing change against unreadable invoices. Hold the extraction prompt fixed at first. Check both unreadable and previously readable documents so the fix does not damage the easy cases.

What stays constant across use cases

The rubric differs, the taxonomy differs and the authoritative outcome differs. The loop stays the same:

  1. Define the job and boundaries.
  2. Create cases with appropriate permissions and source evidence.
  3. Separate development, regression and independent release roles.
  4. Calibrate the rubric and inspect disagreements.
  5. Establish the relevant human and system baselines.
  6. Annotate failures before proposing fixes.
  7. Use a taxonomy to prioritize testable interventions.
  8. Compare candidates case by case, with critical gates and uncertainty.
  9. Deploy under controls and feed observed failures back into development.

Anthropic's agent-evaluation guidance supports combining graders, inspecting traces, verifying outcomes and using multiple evaluation layers. OpenAI's guidance supports task-specific tests and human calibration. The dataset-governance recommendations here apply the test-separation principle described in scikit-learn's documentation to the broader AI product workflow.

Leave behind an evidence pack

The handover should include the case manifest, source and access rules, rubric and taxonomy versions, original and adjudicated annotations, baseline protocol, experiment history, release decision and operational owner.

That pack lets the next team continue learning without reconstructing the meaning of every score. The product is more than a prompt, and its quality process should reflect that.

Pick one workflow and make the failure-to-experiment loop visible before adding another feature. If your team needs help structuring that work, see my consulting work. For the training destination, see AIXL Academy.

Common questions

Does this require a large evaluation platform?

No. The discipline matters more than the initial tool choice. The evidence still needs stable identifiers, versions and appropriate access controls.

Can a candidate with a better total still be rejected?

Yes. A critical failure or unacceptable slice regression can outweigh an improved average under the agreed release rules.

Are these results from a real product?

No. Both use cases and the numerical table are explicitly synthetic teaching examples. No experiment was run for this article.

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