Session 13 Slides: Evaluation & Debugging

--:-- --
↓ Scroll for more

Session 13

Evaluation & Debugging

AI Product Engineering

Block 3: Agents, Evaluation & Deployment

Today’s Agenda

  • Why AI Testing Is Different
  • Three Evaluation Dimensions
  • Hallucination Patterns
  • Adversarial Testing Categories
  • The Fix → Re-Test Cycle
  • Interactive: Eval Dimensions (3–4 min)
  • Interactive: Fix → Re-Test (3 min)
  • Lab: Lab checklist (Core)

Why AI Testing Is Different

Traditional testing: same input → same exact output.
AI testing: same input → probabilistic output — "correct" is a matter of degree.

Different framework required — not a different level of rigour.

Three Evaluation Dimensions

Correctness

Is the answer factually accurate? Supported by context?

Relevance

Does it actually answer the question asked?

Consistency

Same question, different phrasing → same answer?

Hallucination Patterns

  • False specificity — inventing precise numbers, dates, names
  • Confabulation — real info + invented connecting details
  • Confidently wrong — incorrect facts, no hedging language

The model is not lying — it is predicting the most likely token sequence. The result can be fluent, confident, and completely wrong.

Interactive: Eval Dimensions (3–4 min) (1/3)

Choose the best diagnosis.

Interactive: Eval Dimensions (3–4 min) (2/3)

Choose the best diagnosis.

Interactive: Eval Dimensions (3–4 min) (3/3)

Choose the best diagnosis.

Adversarial Testing Categories

CategoryTests
Out-of-scopeDoes it refuse or hallucinate?
AmbiguousDoes it clarify or guess?
ContradictoryDoes it maintain consistency?
Edge caseEmpty, very long, special characters
Injection"Ignore all previous instructions…"

The Fix → Re-Test Cycle

Identify failure pattern from test results
Form hypothesis: "This fails because…"
Apply fix (prompt, knowledge base, retrieval)
Re-run affected test cases
Did the scores improve? Document result.

Interactive: Fix → Re-Test (3 min) (1/3)

True or false — cold-call a team.

Interactive: Fix → Re-Test (3 min) (2/3)

True or false — cold-call a team.

Interactive: Fix → Re-Test (3 min) (3/3)

True or false — cold-call a team.

Lab checklist (Core) (1/2)

  1. 13.1: Copy test-suite.example.json → expand to 10 cases in-session
  2. 13.2: Server running → npm run eval → score 1–5 correctness & relevance

Lab checklist (Core) (2/2)

  1. 13.3: Patterns → Evaluation-Report.md
  2. 13.4: One fix (prompt / vault / topK) → re-score those cases

Showcase gate remains ≥15 cases — finish remaining in Stretch / Session 15 prep.

Session 13 Summary

  • Three dimensions: correctness, relevance, consistency
  • Hallucination: fluent, confident, and wrong
  • Adversarial testing deliberately tries to break the system
  • Test suite makes progress measurable
  • Evaluation report = core final deliverable

Next Session: Security, Privacy & Responsible AI