Evaluating Prompts and Context
A teammate rewrites the Pedal Point system prompt, tries five questions, and says "it's much better". Last month a similar change fixed returns answers and quietly broke helmet answers. Nobody noticed for two weeks. With a model that varies from run to run, impressions are not evidence. An evaluation is.
The rule
Change one thing, run the same test set, compare the scores.
An evaluation, or eval, has three parts.
1. A fixed set of test cases. Realistic inputs, ideally from real (anonymised) questions: common ones, hard ones, and ones the app should refuse or answer "I don't know". Each case records what a good answer must include and must avoid.
2. Scoring. Use the cheapest reliable method for each quality:
- Deterministic checks: code tests what it can. Is the JSON valid? Does the answer contain the correct order status? Does it avoid promising a refund?
- Model-based grading: another model scores qualities code cannot check, like helpfulness or tone, against a written rubric. Check its grades against your own on a sample first; graders have biases too.
- Human review: people read a sample, especially for new features and high-stakes answers.
3. Comparison. Run the old and new versions on the same set and compare. Look beyond the average: which cases got worse?
The eval also measures context, not just wording. Test retrieval on its own: for each question, did the right chunk come back? A great prompt cannot rescue missing context, and the eval should tell you which one failed.
Keep the set, and grow it with every bug report. Re-run it after every change to the prompt, the context, the model or the settings. That habit is regression testing: making sure fixes do not break what already worked.