NewProject Coding is here — build features and fix bugs in real codebases with an AI assistantSee what's new
Advanced
Error Analysis: Finding Failure Modes in Traces
30 min readChapter 2Core
1Error analysis: finding failure modes in tracesChapter 1

Error analysis means reading a sample of your application's real conversations and writing down what went wrong in each. Each one is logged as a trace: the user's message, what the app retrieved or called, and its reply. You note the first thing that broke in each trace, group similar notes into named failure modes, and count them. The biggest and most harmful problems then show up as numbers instead of hunches. Our example is HelpDesk Assistant, a support bot that answers from help-center articles and, in agent mode, looks up accounts and issues refunds.

Reach for error analysis when users complain and nobody can say which failures are common, before you write the first evaluator (an automated check that scores outputs for one kind of failure) for a feature, after a major prompt, model, or retrieval change, or when a metric looks fine while complaints continue. Skip it when one bug report already reproduces the failure: fix it and add a regression check. Skip it too when you only need a known mode's rate on a new version: rerun the evaluator you already have.

In interviews this is the answer to "Quality is poor and users complain. Where do you start?", usually a 5 to 10 minute opening plus a few follow-ups. A mid-level answer reads a sample of traces, notes failures, groups them, and counts them. A senior or staff answer also covers the bias of the chosen sample, a stopping rule, a ranking by frequency and severity, a split between failures a prompt fix solves and failures that need an evaluator, and rerunning the loop as a regular step. The chapters follow the order you would do the work.

Your progressLogin to save progress
Spot an issue or have a suggestion?
Building Evaluation Datasets  |

Discussion

Log in to join the discussion.