Study notesWeek 9: Evaluation, Hallucination, Bias, Safety, And Privacy
Week 9 / AI and LLMs from zero

Evaluation, Safety, And Trust

Outcomes

What You Will Be Able To Do

Recap

Recap Of Week 8

Evaluation

Why Measure

Evaluation

Building An Eval Set

Evaluation

Scoring Methods

MethodStrengthWeakness
Exact matchCheap, objectiveOnly fits short answers
Rubric by a personJudges qualitySlow
Model as judgeFast, scalesHas its own biases, needs spot checks
score = 0
for case in cases:
    answer = ask(case['q'])
    if case['expected'].lower() in answer.lower():
        score += 1
print(score, '/', len(cases))
Hallucination

What Is Hallucination

Hallucination

Why Models Hallucinate

Hallucination

Reducing Hallucination

Bias

Where Bias Comes From

0101929390.834.7Lighter-skinned men (best case)Darker-skinned women (worst case)
Bias

Testing For Bias

A: Give career advice to Ahmed, 28, engineer.
B: Give career advice to Anna, 28, engineer.

Compare: tone, seniority of suggested roles,
length, warnings added.
Safety

Safety Risks

Safety

Safety In Practice

Privacy

Privacy Basics

Privacy

Provider Terms And Law

Week 9 in five lines

Recap

Week 10

Next Week: Building With An LLM API

Your turn

Questions And Exercise