Name the Failure Modes and Count Them
After reviewing a sample of outputs from an LLM app, you have a pass or fail judgment and a short free note on every output. A long list of notes does not yet tell you where to spend your effort. To get there, you turn the notes into a few named failure modes and count how often each one occurs. The counts then show which failures deserve an automated check, and the notes themselves show when you have reviewed enough.
Grouping notes into categories
Take a small example: a meal-planning assistant that suggests recipes. A reviewer has read a hundred of its answers and written a note on each failed one, naming the first thing that went wrong. Read together, the notes start to repeat themselves. "Gave a beef stew to a vegetarian" and "used peanut sauce for someone with a nut allergy" are worded differently, but they describe the same kind of mistake: the answer ignored a dietary need the user stated.
Grouping is the step of sorting the notes by that likeness. You read the notes, put two side by side when they describe the same kind of mistake, give each pile a short name, and keep going until every note sits in a pile. Practitioners of LLM evaluation call this step axial coding. The term comes from qualitative research in the social sciences, where writing the free notes in the first place is called open coding. The usual result is a small set of categories, often somewhere between five and ten.
- Beef stew for a vegetarian
- Peanut sauce, nut allergy
- Asked for half, got double
- Serves 6, asked for 2
- 90 minutes, asked under 30
- Prep alone takes an hour
- Calorie count made up
- Stops in the middle of step 4
- Ignores a dietary need
- Wrong portion size
- Over the time limit
- Invented nutrition facts
- Answer cut off
- Beef stew for a vegetarian to Ignores a dietary need
- Peanut sauce, nut allergy to Ignores a dietary need
- Asked for half, got double to Wrong portion size
- Serves 6, asked for 2 to Wrong portion size
- 90 minutes, asked under 30 to Over the time limit
- Prep alone takes an hour to Over the time limit
- Calorie count made up to Invented nutrition facts
- Stops in the middle of step 4 to Answer cut off
The categories come out of the notes. It is tempting to start from a ready-made list such as "hallucination", "toxicity" or "helpfulness" and drop each note into one of its boxes, but such a list was written before anyone looked at this app. It has no box for "ignores a dietary need", so the most common problem gets spread thinly over vague boxes or lost. Starting from the notes keeps the categories specific to what this app really does wrong.
A language model can help by proposing groupings for a long list of notes, but its proposals need a person's review. Models tend to make categories too generic (a broad "quality issues" pile) or to merge two different problems because they share a word: "the app crashes after login" and "login takes too long" are not the same failure. Write the first notes yourself, and treat any suggested grouping as a draft you split, merge and rename.
True or false?
The categories should be chosen before the review starts, so every note has a box to go into.
False. Categories chosen in advance miss the problems specific to the app. They are drawn from the notes after the review.
Two notes with no words in common can belong to the same category.
True. Notes are grouped by the kind of mistake they describe, not by their wording: a beef stew for a vegetarian and peanut sauce for an allergy are both an ignored dietary need.
A failure mode needs a definition
A pile with a name is not yet something you can measure. A failure mode is a named, distinct kind of failure with a definition sharp enough that two people reading the same output would label it the same way. The name helps you talk about it; the definition is what makes the label repeatable.
A vague name such as "bad recipe" fails that test at once: one reviewer calls a bland recipe bad, another does not. A good definition says what has to be true of an output for it to fail, and where the edge of the mode lies, including the nearby cases that do not count. It also keeps the verdict binary, fail or not, which forces clearer thinking than a score on a scale.
| Failure mode | Fails when | Does not count |
|---|---|---|
| Ignores a dietary need | The user states a diet or allergy and the recipe contains an ingredient it rules out | A diet the user never mentioned |
| Wrong portion size | The amounts serve a different number of people than the user asked for | Rounding, such as 1 egg for 1.5 |
| Over the time limit | The user gives a time limit and the stated total time, prep included, is longer | No limit was given |
Modes should also be distinct: each failed output belongs to one of them, not two. If you cannot decide whether an output is "wrong portion size" or "invented nutrition facts", the definitions overlap and one of them needs a sharper edge.
To test a definition, have two people label the same outputs independently, then compare. Where they disagree, the definition is usually missing a case; add it and try again. When you measure how well they agree, the plain percentage of matching labels flatters the result, because two people will agree on many outputs by chance alone. A statistic such as Cohen's kappa corrects for that chance agreement. In a small team, one person who knows the domain well often makes the final call and writes down the reason, so the definitions stay consistent.
True or false?
If two careful reviewers label the same output differently, the definition of the failure mode probably needs a sharper edge.
True. A good definition makes the label repeatable. Disagreement points to a case the definition does not settle.
A short, memorable name is enough to make a failure mode countable.
False. The name is only a handle. Counting needs a definition that says when an output fails and what lies outside the mode.
Counting each failure mode
With definitions in place, go back over the failed outputs, give each one its failure mode, and count. A spreadsheet pivot table or a few lines of Python (a dictionary of counts, or collections.Counter) is all it takes. Suppose the hundred reviewed answers of the meal planner held 30 failures:
- Ignores a dietary need 11
- Wrong portion size 8
- Over the time limit 5
- Invented nutrition facts 4
- Answer cut off 2
A count is easier to compare across reviews when it becomes a share. There are two shares worth keeping apart. The share of all outputs says how much of what users receive is affected: an ignored dietary need hits 11 of 100 answers, so 11 percent. The share of the failures says how much of the problem a mode makes up: 11 of 30 failures, about 37 percent.
Failures often concentrate in a few modes. Here the two largest modes make up 19 of the 30 failures, almost two thirds, which already says where the work should start.
How the shares add up depends on how the notes were written. When each failed output carries only its first failure, as in this example, every failed output is counted once, so the shares of all outputs add up to the overall fail rate: 11 + 8 + 5 + 4 + 2 = 30 percent. When reviewers tag every independent failure in an output, one output can count in several modes and the shares can add up to more than the fail rate.
True or false?
With one failure mode per failed output, the shares of all outputs add up to the overall fail rate.
True. Every failed output is counted exactly once, so the counts add up to the number of failures.
A mode that makes up 37 percent of the failures affects 37 percent of the answers users receive.
False. That is its share of the failures. With 30 failures in 100 answers, it affects 11 percent of all answers.
Choosing what to check automatically
A ranked list of counts is the start of a decision, not the decision itself. Weigh each failure mode on two things: how often it happens and how much harm it does when it does. A rare failure can still matter a lot. Invented calorie counts appear in only 4 of 100 answers, but a user managing a medical condition may act on them. A frequent failure of little consequence can wait.
Then ask, for each mode, what kind of action it needs. Many failures are plain bugs with an obvious fix. An answer that stops in the middle of step 4 because the limit on reply length is set too low is fixed by raising the limit; a recipe that ignores a time limit because the instructions to the model never mention one is fixed by adding that instruction. Fix those directly, as part of ordinary development, before building anything to measure them.
An automated check earns its place for failures that will come back: the ones that persist after you have improved the prompt, or that any later change to the prompt or the model could bring back. Such a check runs over many outputs on every change, so you notice the moment a mode returns.
Checks also differ in cost. A rule that code can test, such as "the recipe contains no ingredient from the user's excluded list", is cheap to write and to run. A quality that needs judgment, such as whether a nutrition figure is supported by any source, needs a language model as the grader and more work to make trustworthy, so keep that for modes that warrant it.
| Failure mode | Count | Harm | Next step |
|---|---|---|---|
| Ignores a dietary need | 11 | High: allergies | Improve the prompt, then keep an automated check |
| Wrong portion size | 8 | Medium | Improve the prompt, then keep an automated check |
| Over the time limit | 5 | Low | Fix: add the time limit to the instructions |
| Invented nutrition facts | 4 | High: health decisions | Improve the prompt, then a model grader if it persists |
| Answer cut off | 2 | Medium | Fix: raise the reply length limit |
Notice what the plan leaves out: the reason each failure happens. Asking "why" is the next step for the modes you have chosen to work on, and it goes faster once the list is ranked.
True or false?
Every failure mode found in review should get its own automated check.
False. Obvious bugs are fixed directly. Automated checks are worth building for the failures that persist or are likely to return.
A failure mode that appears in only a few outputs can still deserve one of the first checks.
True. Priority weighs harm as well as frequency. A rare failure that misleads users on health or money can outrank a common, harmless one.
When to stop reviewing
Review is slow, so it is fair to ask how many outputs are enough. There is no fixed number. The signal is in the notes themselves: early on, every few outputs reveal a new kind of failure; later, new outputs only add to the piles you already have. When further outputs stop showing new failure modes or changing the definitions of the ones you have, the review has reached what qualitative researchers call theoretical saturation.
distinct failure modes against outputs reviewed
- failure modes found
Practitioners give rough starting points rather than a rule: review about 30 outputs yourself, aim for around a hundred varied ones, and keep going for as long as you are still learning something new. Varied matters: a hundred near-identical requests saturate quickly and hide the failures of the requests you did not include.
Saturation holds only for the app you reviewed. A significant change, such as a rewritten prompt, a switch to a different model or a new feature, can remove old failures and create new ones, and fixing one failure mode sometimes brings out another. After such a change, review a fresh sample, update the failure modes and their counts, and expect the list to look a little different.
True or false?
Once a review reaches saturation, its failure modes stay valid even after the app switches to a different model.
False. A model switch is a significant change. It can bring new kinds of failure, so the review is done again on fresh outputs.
A review can stop when new outputs keep landing in the existing failure modes without changing their definitions.
True. That is saturation: more outputs no longer teach you anything new about how the app fails.