Chapter 3. Error Analysis
The Analyze step of the evaluation lifecycle is where we look at what the system is actually doing and figure out where it fails. This chapter covers the practical methods for doing that.
In this chapter, you will learn:
-
How to read and inspect LLM traces systematically
-
How to identify and categorize failure modes
-
How to build a failure taxonomy by reading traces and clustering observations
-
How to generate synthetic data for testing
The process of developing robust evaluations for LLM applications is inherently iterative. It involves creating test cases, assessing performance, and refining the system based on those observations. High-level guides, such as Anthropic’s documentation on creating empirical evaluations for Claude (Anthropic 2024a), often depict the evaluation process as a cycle of developing test cases, engineering prompts, testing, and refining (Figure 3-1). This cycle emphasizes developing test cases, engineering and refining prompts, and testing against both initial cases and held-out evaluations.
This chapter covers the Analyze step of our Analyze-Measure-Improve lifecycle (Figure 1-2). We walk through how to bootstrap an initial dataset, read traces, and build a structured understanding of where our application fails.
Figure 3-1. The iterative process for creating strong empirical evaluations, adapted from Anthropic (2024a) ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access