Evaluating and comparing answers
Course contents (20 lessons)
- Getting to know Meta AI and Llama
- What Meta AI is and where you can use it
- Meta AI versus Llama: the assistant and the models
- Your first chat with Meta AI
- Prompt basics that work
- The anatomy of a good prompt
- Context, tone, length and follow-ups
- Everyday uses
- Writing and replying to messages
- Captions, posts and bios
- Planning and study help
- Customer replies for a small business
- Images, groups and privacy
- Writing image generation prompts
- Group chats, etiquette and privacy
- Working with Llama models directly
- Running a Llama model on your own computer
- System prompts and chat templates
- Parameters: temperature, top_p and max tokens
- Few-shot examples and structured JSON output
- Advanced prompting
- Prompting Llama for code
- Retrieval-augmented prompting: answering from your own documents
- Evaluating and comparing answers
- Safety, limits and a final project
- Safety, limits and responsible use
- Final project: build a study buddy assistant
Gut feeling is not enough
You try a prompt, the answer looks good, and you move on. A week later it fails on a case you did not try. The way out is a small, simple test routine. You do not need special software. A spreadsheet is enough.
Step one: build a test set
Collect 10 to 20 real inputs for your task. Include easy ones, hard ones and a few bad ones, such as an empty message or an unrelated question. For each, write what a good answer must contain, or the exact right answer if there is one.
| # | Input | A good answer must |
|---|---|---|
| 1 | "Where is my order 1042?" | Ask for nothing more, say the team will check tracking |
| 2 | "I want a refund, cake was late" | Apologise once, explain the policy, no new promises |
| 3 | "What is the best phone?" | Politely say this is outside the shop's topics |
Step two: define a simple score
Pick three to five yes-or-no checks that matter for your task, for example: factually right, follows the format, right tone, within length, did not invent anything. Score each answer on each check. Add them up. Simple scoring beats a vague "seems good".
Step three: compare fairly
When you compare two prompts, or two models, change one thing and keep everything else the same: same inputs, same settings, same number of tries. If you compare a prompt at temperature 0.2 against another at 0.9, you do not know which change helped.
Since answers vary from run to run, run each input two or three times, especially at higher temperature, and look at the spread. A prompt that is right three times out of three is better than one that is right once out of three.
Here are two answers to the same customer message. Do not say which is better yet.
First, list what each answer gets right and what each gets wrong against these checks: polite, accurate to the policy below, under 70 words, no invented promises.
Policy: [paste]
Customer message: [paste]
Answer A: [paste]
Answer B: [paste]
Why it works
The model is used as a helper reviewer, with named checks, instead of being asked a vague "which is better". Forcing the list of strengths and weaknesses first makes the judgement more careful. Still, treat this as a second opinion. Models used as judges often prefer longer answers and answers that sound confident. Read the answers yourself.
Blind comparison
If you compare outputs from two models, hide which is which, for example by shuffling A and B. It is easy to prefer the output of the model you already like. Blind comparison keeps you honest.
Track failures, not only scores
Keep a short log: input, what went wrong, what you changed. After a few rounds you will see patterns, such as "always too long" or "invents dates". Each pattern points to one fix in the prompt, the examples or the settings.
Check facts outside the model
For anything that contains facts, check them against a source outside the model. Dates, figures, names and quotes are the main risks. If you cannot check something, do not publish it as true.
The common mistake
The common mistake is testing only the examples you used while writing the prompt. The prompt then fits those examples like a glove and fails elsewhere. Keep a few test cases that you never use while tuning, and look at them only at the end.
Try it yourself
Choose one prompt from this course, such as the customer reply or the JSON extraction. Write ten inputs and five yes-or-no checks. Score the current prompt, make one change, score again with the same inputs, and keep the better version. Write down the two totals and the one change you made.
This course is free to read. Create a free account to enrol, save your progress and pick up where you left off.
Sign up free I already have an account