Certopolis

AWS Certified Generative AI Developer – Professional

Bedrock model evaluation: automatic, human, LLM judge (AIP-C01)

Automatic jobs compute fixed algorithmic metrics such as accuracy, robustness and toxicity. Human-based jobs send responses to your own work team to rate. Judge-based jobs use a second LLM to score responses on metrics such as Correctness and Faithfulness. Pick by who must score and whether the score must be deterministic.

Automatic (programmatic) jobs

You pick a task type and metrics, and use a built-in dataset or your own. How a metric is calculated depends on the task type. For text summarization, accuracy is BERTScore, which compares candidate and reference text using BERT embeddings and cosine similarity. For general text generation, accuracy is a real world knowledge score instead.

Robustness perturbs each prompt about 5 times, with lower case, typos, numbers as words, random upper case and whitespace changes, and measures how much the output changes. A lower score is better. Toxicity uses the detoxify algorithm.

Metrics that compare to a ground truth need the referenceResponse key in each prompt record. Example: to score two models against 400 editor-approved court ruling summaries without people or another LLM, run an automatic job per model with the text summarization task type, the accuracy metric, and the approved summaries as referenceResponse.

Human-based jobs

A human-based job sends responses to a work team, such as your own subject matter experts, to rate. You can select up to two inference sources, and one can be a Bedrock model while the other is your own stored responses. That lets specialists compare a Bedrock FM side by side with a self-hosted model's existing outputs.

Judge-based jobs

A second LLM scores each response and explains the score. Built-in metrics include Correctness and Completeness (which use a reference response if you supply one), Faithfulness, Helpfulness, Logical coherence, Relevance, Following instructions, Professional style and tone, Harmfulness, Stereotyping and Refusal. You can also define custom metrics.

Faithfulness identifies whether the response contains information not found in the prompt. It needs no reference answer, so it fits RAG prompts that already contain the retrieved passages.

Evaluation jobs can evaluate foundation models, Marketplace models, customized and imported models, prompt routers and models with Provisioned Throughput.

Where the exam catches people

  • Believing the general text generation task type scores summaries against references: its accuracy is a real world knowledge score. The summarization task type uses BERTScore.
  • Believing an LLM judge gives the same score every time like an algorithm: use an automatic job when the score must be algorithmic.
  • Believing a judge job can take ratings from your specialists: people rating responses is a human-based job with a work team.
  • Believing Correctness measures hallucination against the retrieved context: Faithfulness checks for information not found in the prompt.
  • Believing a high robustness score is good: robustness measures output change under perturbation, so lower is better.

Written from Amazon Web Services's documentation

Try 3 questions on this

Pick an answer to see why each option is right or wrong.

  1. A legal publisher must choose between two FMs in Amazon Bedrock to summarize court rulings for a weekly client newsletter. Editors have written an approved summary for each of 400 past rulings. For each model, the publisher needs a score that shows how closely the model's summaries match the approved summaries. The score must be computed by an algorithm, so that the same responses always receive the same score. The scoring must not use human reviewers or another LLM. Which solution will meet these requirements?

    Right. In the game that’s Renown for your Testing, Validation, and Troubleshooting building.

    Not that one: A is right. In the game your Testing, Validation, and Troubleshooting building would lose a little Renown, and this question would come back later.

    Show the full explanation and doc quotes

    For text summarization, the report page (https://docs.aws.amazon.com/bedrock/latest/userguide/model-evaluation-report-programmatic.html) says: "Accuracy : For this metric, the value is calculated using BERT Score." and "It matches words in candidate and reference sentences by cosine similarity." The approved summaries go in the referenceResponse key of a custom dataset. The datasets page (https://docs.aws.amazon.com/bedrock/latest/userguide/model-evaluation-prompt-datasets.html) lists referenceResponse as "required to indicate the ground truth response against which your model is evaluated" for accuracy and robustness evaluations.

    Written from docs.aws.amazon.com/bedrock/latest/userguide/model-evaluation-report-programmatic.html

  2. A company is deciding whether to replace its self-hosted summarization model with an FM in Amazon Bedrock. The company has already stored the self-hosted model's summaries of 400 support tickets. Five product specialists must read each ticket, compare the two summaries side by side, and rate which summary is more accurate. The ratings must be saved in Amazon S3 for audit. Which solution will meet these requirements with the LEAST operational overhead?

    Right. In the game that’s Renown for your Testing, Validation, and Troubleshooting building.

    Not that one: D is right. In the game your Testing, Validation, and Troubleshooting building would lose a little Renown, and this question would come back later.

  3. A company runs a RAG application that retrieves policy passages from its own search service and sends them with each customer question to an FM in Amazon Bedrock. Reviewers found answers that contain details that are not in any of the retrieved passages. The company has saved 1,000 production prompts, each with the question and the retrieved passages. No reference answers exist. The company must score how often the FM's responses include information that is not in the passages of their prompt, and must repeat the scoring after each prompt change. Which solution will meet these requirements?

    Right. In the game that’s Renown for your Testing, Validation, and Troubleshooting building.

    Not that one: C is right. In the game your Testing, Validation, and Troubleshooting building would lose a little Renown, and this question would come back later.