Let’s Get Certified
Module 21 / 21 · Testing, validation and troubleshooting

Locate the first stage that diverged

Replay a failing case and isolate the first change in context, retrieval or generation.

Locate the first stage that diverged

Work through the decision

A policy assistant's answers deteriorate on Monday. The prompt, index and model all changed over the weekend. Which comparison can identify the responsible stage?

Check your reasoning

Replay a small fixed set with pinned versions. Inspect retrieved IDs first, then compare the serialized context and output limits, and finally compare generation using identical passages. Change one component at a time and retain a reproducible failing example.

Watch the source lesson at 6:10:35

Compare the choices

Inspect context and output limits
Count tokens after serializing the actual request. Check truncated input, output limits and the model's stop reason.
Classify API errors
Read status and service error codes. Correct malformed or unauthorized requests, then handle retryable service or quota conditions separately.
Replay retrieval independently
Run the same query against the index, inspect candidate IDs, scores, filters and freshness before calling the generator.
Bisect versioned prompt and model changes
Pin model settings and evidence, restore a known-good prompt, then vary one release component at a time.

Interpret the first divergence

Requests with both old and new prompts retrieve the same correct clause. Only the new prompt drops the unit on the amount. Restore the old prompt on the same model, repeat the case and add a unit validation check before release.

Apply it on AWS

Compare Bedrock request IDs and stop reasons with safe application traces. AccessDeniedException calls for identity and resource policy review. A length stop with a valid response calls for output or context-budget review. Save a minimized test case before changing both the model and prompt.

Practice the guide skills

  1. Inspect the serialized input length, reserved answer budget and stop reason. Replay both a short and a boundary-length request. Watch 6:10:35
  2. Separate validation, access, throttling and transient service errors using status and request ID. Retry only eligible failures. Watch 6:07:48
  3. Pin model and generation settings. Compare a prompt variant against the baseline using the same evidence and output validator. Watch 6:18:35
  4. Inspect source freshness, filters, top-k IDs and scores before calling the model. Compare a known-good document injected as context. Watch 6:13:56
  5. Reproduce a failing prompt/model pair from version history. Change one variable at a time and add the case to regression tests. Watch 6:21:34

Official objectives for this lesson

Related lesson · Create prompts that can be tested and rolled back

Knowledge check

Locate the first stage that diverged quiz

Answer 3 questions. Check each answer for an explanation.