Let’s Get Certified
Module 07 / 13 · ML model and foundation model development

Separate retrieval failure from generation failure

A benefits assistant gives a wrong policy answer.

Separate retrieval failure from generation failure

A benefits assistant gives a wrong policy answer. Inspect the retrieved passage IDs before changing the prompt. A missing correct passage points upstream, while a correct passage paired with an unsupported answer calls for a different investigation.

At 1:26:55 the speaker evaluates retrieval separately from generation. Keep the IDs of returned passages alongside the answers in an evaluation set.

Work through the decision

Eight of ten questions retrieve the right passage. Only five of those eight answers are faithful. Which stages deserve investigation?

Check your reasoning

Two questions failed retrieval. Three more failed generation despite receiving the expected passage. Track retrieval hit rate (8/10) and conditional faithfulness (5/8) so improvements can be attributed.

MLA-C02 recording · 1:26:55

Continue in the recording · 1:21:40.

Decisions and tradeoffs

Recall at k
Count labeled queries whose expected evidence appears among the retrieved top k results, or the proportion of relevant documents retrieved when several are relevant.
Groundedness evaluation
Compare generated claims with the evidence actually supplied to the model.
Blind human rubric
Use sampled cases, explicit criteria and independent reviewers to judge qualities that automatic metrics miss.
Shadow comparison
Send a copy of live traffic to a candidate while the production model continues answering users.
Versioned experiment manifest
Record data, code, environment, parameters, evaluation inputs and seeds where applicable to reproduce an experiment.
Feature attribution
Use tools such as SageMaker Clarify to estimate how features contributed to predictions, with checks on the baseline and interpretation.

Practice each guide skill

The numbers below follow the AWS task and skill identifiers.

  1. Record dataset digest, container digest, hyperparameters and evaluation inputs for a reproducible comparison.
  2. Establish a reference distribution and quality threshold using a representative period. Document when labels become available.
  3. Mirror production requests to a shadow endpoint and compare predictions and p95 without exposing the candidate response.
  4. Review feature attribution against a sensible baseline and test whether the interpretation holds for several examples.
  5. Inspect learning curves, input scaling and learning rate before declaring a training algorithm unsuitable.
  6. Compare a binary classifier using precision and recall; compare an assistant on groundedness and task completion.
  7. Collect blinded human ratings using an explicit rubric; inspect disagreement before combining ratings.
  8. Choose ROUGE for reference overlap or another suitable language metric, then check whether the result reflects the actual task.
  9. Score representative FM responses for correctness, grounding and policy adherence; retain examples of each failure type.
  10. Measure expected passage recall separately from the answer’s support in retrieved context. Record both for known queries.

Official objectives for this lesson

Related lesson · Keep bad records from quietly reaching consumers

Knowledge check

Separate retrieval failure from generation failure quiz

Answer 3 questions. Check each answer for an explanation.

Worked example · Separate retrieval failure from generation failure