← Generative AI and LLMs
Lesson 4 of 4
Evaluation and safety
Watch, read the card, then practise. Hallucinations · Evaluating outputs
The video for this lesson is being recorded.
Meanwhile, the notes below and the 60-second cards cover the same ideas.
Practise this topicHallucinations
A hallucination is a confident answer that is wrong or made up.
Remember: Verify facts, numbers and citations before trusting them.
Evaluating outputs
To improve an LLM app, measure it: build a fixed test set and score every change against it.
Remember: No test set, no way to know if a change helped.
Try the example in Code Lab
answers = ["Delhi", "mumbai ", "Chennai"] expected = ["delhi", "Mumbai", "Kolkata"] norm = lambda s: s.strip().lower() print(sum(norm(a) == norm(e) for a, e in zip(answers, expected)), "of", len(expected))