Chapter 5. Evaluation
How do you know if a language model is good? The question sounds simple, but it turns out to be one of the hardest problems in the field. A model that aces a multiple-choice benchmark may hallucinate wildly in open-ended conversation. One that writes fluent prose may confidently state false facts. Another that scores perfectly on reasoning tests may have memorized the answers from its training data.
Evaluation is therefore not a final step performed after a model is built; it happens throughout the entire development lifecycle. As Figure 5-1 shows, after pretraining, general benchmarks measure the capabilities of the foundation model. During fine-tuning, task-specific evaluations measure whether the model has learned the desired behavior. During alignment, evaluation focuses on properties such as helpfulness, safety, and adherence to human preferences. And after deployment, teams continue evaluating the system through production metrics, monitoring, and real-world feedback.
Figure 5-1. Evaluation across the LLM lifecycle, from general capability testing after pretraining to task-specific, alignment, and production evaluation.
Evaluation touches every aspect of this book: Chapter 4 introduced RAG evaluation through the faithfulness-relevance-quality triad and agent evaluation via task completion metrics. Chapter 11 covers alignment evaluation. Chapter 12 ...
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