# Evaluation

> How to show that a model got stronger: what benchmarks measure, the statistics of evaluation (pass@k, confidence intervals, sample size), LLM-as-a-Judge, building an evaluation set with reliable labels, and how benchmark contamination arises and is detected.

- URL: https://dmxsf.com/en/wiki/evaluation/
- [DMXSF](https://dmxsf.com/en/about/)
- Updated: 2026-11-16

## After this chapter you will be able to

- Say what each of the four classic benchmarks measures, and judge whether an evaluation result has been contaminated.
- Report a confidence interval for a score, compute the unbiased estimator of pass@k, and work out how many questions are needed to tell two models apart.
- Grade open-ended answers with an LLM judge, recognize and mitigate position and length bias, and turn pairwise comparisons into a leaderboard.
- Check the quality of an evaluation set: estimate the ceiling that label errors put on scores, measure annotator agreement, find items that do not discriminate, and set version and secrecy rules for the set.
- Detect benchmark contamination with n-gram overlap and model signals (loss gap, Min-K%), say where each is blind, and report scores on the clean subset.
- Set up an evaluation workflow from task definition and evaluation set through scoring to online monitoring.

Evaluation is the most underrated step in LLM engineering. Without reliable evaluation, every "improvement" to training, alignment, RAG or an agent is only a feeling. This chapter starts with what the benchmarks measure and how they get contaminated, then covers how large the error of a score is and when a gap counts, then how a model can serve as the grader of open-ended answers, then the evaluation set itself: how label errors lower scores, and how to measure annotator agreement and item discrimination; finally contamination, shown with a real fine-tuning experiment: how many repeats it takes to memorize an item, why n-gram matching cannot see a paraphrase, and how much model signals can see.

It is also the prerequisite of the later [Safety and Alignment Risks](https://dmxsf.com/en/wiki/safety/) chapter: safety assessment has to ask the same questions, whether the sample is large enough, whether the adversary adapts, and whether the metric can be gamed. For putting evaluation into your application, the [RAG](https://dmxsf.com/en/wiki/applications/rag/) and [Agents](https://dmxsf.com/en/wiki/applications/agents-and-tool-calling/) pages both include the details of an evaluation loop. For evaluating long-context ability, see the explainer [Lost in the Middle](https://dmxsf.com/en/blog/lost-in-the-middle/).

[Production evaluation](https://dmxsf.com/en/wiki/evaluation/production-evaluation/) connects task grading to rollout decisions, from paired offline replay to shadow traffic, canaries, and rollback.

[Chapter labs on GitHub](https://github.com/dmxsf/dmxsf/tree/main/labs/evaluation)
