part III · chapter 12 of 17

Evals and testing

Measuring quality when the same input can give different outputs.

why it matters

The most overlooked skill: change a prompt, a model or the code, and prove nothing got worse.

before this: chapter 11, Fine-tuning and model adaptation

being written

This chapter is being written. Here is what it will cover; until then, the full topic list is in our notes.

  • golden datasets and evaluation pipelines
  • faithfulness and citation accuracy for retrieval
  • task completion and tool choice for agents
  • injection and leakage tests
the topic list on GitHub (opens in a new tab)

you reached the end of the chapter

build this

A hundred questions with expected answers for your retrieval app, rerun after every change.

the maths underneath

  • maths note 9

    Statistics for evals

    p^±1.96p^(1−p^)n\hat{p} \pm 1.96 \sqrt{\frac{\hat{p}(1-\hat{p})}{n}}

    80% on a hundred questions is somewhere between 72% and 88%. Without this, noise ships as an improvement.

  • maths note 11

    Information theory: entropy, cross-entropy, perplexity

    L(θ)=−1T∑t=1Tlog⁡pθ(xt∣x<t)L(\theta) = -\frac{1}{T} \sum_{t=1}^{T} \log p_\theta(x_t \mid x_{<t})

    What loss means when you fine-tune, what perplexity measures, and why a tuned model is held close to its base.

check yourself

Tick what you could explain to someone else, out loud, without notes.