Tutorials / Prompting Meta AI and Llama Models / Evaluating and comparing answers

Evaluating and comparing answers

11 min read text
Course contents (20 lessons)
  1. Getting to know Meta AI and Llama
  2. What Meta AI is and where you can use it
  3. Meta AI versus Llama: the assistant and the models
  4. Your first chat with Meta AI
  5. Prompt basics that work
  6. The anatomy of a good prompt
  7. Context, tone, length and follow-ups
  8. Everyday uses
  9. Writing and replying to messages
  10. Captions, posts and bios
  11. Planning and study help
  12. Customer replies for a small business
  13. Images, groups and privacy
  14. Writing image generation prompts
  15. Group chats, etiquette and privacy
  16. Working with Llama models directly
  17. Running a Llama model on your own computer
  18. System prompts and chat templates
  19. Parameters: temperature, top_p and max tokens
  20. Few-shot examples and structured JSON output
  21. Advanced prompting
  22. Prompting Llama for code
  23. Retrieval-augmented prompting: answering from your own documents
  24. Evaluating and comparing answers
  25. Safety, limits and a final project
  26. Safety, limits and responsible use
  27. 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.

#InputA 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