CHAPTER 05 OF 12
Measure whether the answer is useful
Build a rubric, keep failures and separate development from held-out tests.
In this chapter
Define success before asking
A useful prompt names the task, supplies the necessary input, defines the output format and explains what to do when information is missing. Extra adjectives such as "be brilliant" do not replace those requirements. For extraction, explicitly distinguish facts in the note from things the model might infer.
A rubric makes the decision reproducible. Our deadline rubric compares the answer with an expected string after trimming surrounding whitespace, ignoring letter case and removing one final period. It deliberately rejects extra explanation. That strictness is appropriate for a downstream field expecting only a deadline; it would be unnecessarily strict for an open-ended summary.
Different applications need different rubrics. A summary might require coverage of specified facts and absence of unsupported claims. A coding task may require tests and human review. A classifier needs a confusion matrix and examples of costly mistakes. Choose a rubric tied to consequences, then keep the raw output so another person can challenge your judgment.
Separate prompt development from evaluation
Use a development set while adjusting the prompt. Once you have read its failures and tuned against them, it no longer measures performance on unseen inputs. Keep a separate held-out set for the final comparison. If you repeatedly revise against held-out failures, create a new held-out set.
The six cases in this book are development examples. They include explicit deadlines, changed deadlines, distractors and missing information. The reference model passed 3 of 6 under the published rubric. This score belongs to these examples and this configuration. It is not a percentage of all real tasks the model can solve.
In the initial retrieval lab, the model supplied the correct fact and citation but surrounded the deadline with a sentence. That failed the required output contract. We added an example using a different fictional project, then ran the revised prompt and kept both reports. Changing the prompt is a legitimate experiment; silently weakening the rubric after seeing a result is a different claim.
Prerequisites
Complete chapter 4, keep the lab server running, and open the companion evaluation.json. Use fictional or approved data. Do not begin with private customer records simply because inference is local; the output files themselves may be shared accidentally.
Steps
Read all six expected answers. Check that they follow the written task definition.
Run the evaluation:
python3 rtm_lab.py evaluate --output evaluation-run.jsonInspect every failed case. Classify the failure as wrong fact, unsupported inference, missing answer, extra text or runtime error. A successful HTTP response is not a successful task.
Change one prompt feature in a copy of the companion source, such as a concise example or clearer missing-information rule. Record the change and rerun the same development set.
Add new, unseen examples for a final comparison. Include negative cases and examples that resemble the intended workload, not only cases the small model already handles well.
Expected results
The report should preserve six responses, six expected answers and an explicit pass count. Your count may differ if the artifact or runtime differs. Even with low-temperature settings, do not assume bit-for-bit reproducibility across devices, runtime versions or backend changes.
The useful outcome is an explainable score and failure analysis. If the score is poor, the evaluation is doing its job. Do not delete failed cases to improve the displayed number.
Common failures
A vague judge prompt can reward confident prose. A substring check can accept "not Friday at 5 pm" as correct. A JSON parser can accept a well-formed but false answer. Test your rubric with deliberately wrong outputs before treating it as a release gate.
When comparing two models, keep input cases, context, output limit and scoring fixed. Record differences in templates or supported features instead of hiding them. If one model needs a special prompt, report that as a different application configuration.
Exercise
Create ten held-out examples with at least three no-answer cases. Define the acceptance threshold and the costliest failure before running either candidate. Preserve both models' outputs, including malformed responses, and justify the decision in a paragraph.
Sources
The raw lab report contains this edition's measured examples. Ollama structured outputs describes shape constraints; factual correctness still needs an independent check.