Lesson 1 of 6 Evaluating Generative AI

Evaluating Foundation Models and RAG with Amazon Bedrock Evaluations

This lesson explains Amazon Bedrock evaluations, the exam guide's main named service for generative AI evaluation, which measure FM and RAG quality on your own datasets with automatic metrics, LLM-as-a-judge and human reviewers.

Learning outcomes

After completing this lesson, you will be able to:

  • Distinguish the evaluation job types.
  • Prepare datasets, including bring-your-own responses.
  • Choose the evaluation method for what is being measured.

Evaluation job types

Model evaluation jobs assess a model's responses to prompts. Programmatic (automatic) evaluation computes algorithmic metrics, such as accuracy, robustness and toxicity, for task types including text generation, summarisation, question answering and classification. Model as a judge evaluation uses an evaluator model to score responses on metrics such as correctness, completeness, faithfulness, helpfulness, coherence, relevance and harmfulness, and supports custom metrics with your own rubric. Human-based evaluation sends responses to your own work team.

RAG evaluation jobs assess Bedrock knowledge bases or your own RAG system's outputs: retrieve-only jobs score context relevance and context coverage, and retrieve-and-generate jobs also score answer correctness, completeness, faithfulness and citation precision and coverage.

Sort into groups

Which evaluation job?

Exam skills 2.3.6 · 2.3.1

Choose the Amazon Bedrock evaluation job type for each goal.

Log in to try this activity Interactive activities are free with an account.

Datasets and bring-your-own responses

Jobs read a prompt dataset in JSONL from S3, with fields for the prompt, an optional reference response and, for categories, optional labels. Built-in datasets cover general tasks, but custom datasets from your domain are far more informative. Evaluations can also score responses you supply (bring your own inference responses), so models hosted outside Bedrock, agents or complete applications can be evaluated with the same metrics. Results include scores per metric, per-record explanations from the judge and comparison across jobs.

{"prompt": "Summarize the refund policy for damaged items.",
 "referenceResponse": "Damaged items can be returned within 30 days for a full refund...",
 "category": "policy"}
True or false

Evaluation datasets

Exam skills 2.3.1 · 2.3.6

Check how evaluation datasets and your own responses are used.

Log in to try this activity Interactive activities are free with an account.

Choosing the evaluation method

Amazon Bedrock offers several evaluation methods, and the choice depends on what is being measured and whether reference answers exist. Automatic, programmatic evaluation suits tasks with reference answers and objective metrics. LLM-as-a-judge evaluation scores qualities such as correctness, helpfulness and faithfulness at scale. Human evaluation suits subjective or high-stakes outputs and calibrates the automated methods. RAG evaluations measure retrieval and generation separately. The following table summarises when each method fits.

MethodStrengthUse when
Programmatic metricsFast, cheap, objectiveReference answers exist; classification, extraction
LLM-as-a-judgeScales subjective scoringHelpfulness, faithfulness, tone at volume
Human evaluationMost trusted for nuanceHigh-stakes or subjective quality; calibrating judges
RAG evaluationSeparates retrieval from generationKnowledge bases and RAG applications

The following diagram shows two evaluation jobs, one using a model as a judge and one using human reviewers, and how their results are used to choose between two models.

Choosing between two candidate models. A model-as-a-judge job scores both on 500 real questions for correctness, completeness, faithfulness and harmfulness, and a human evaluation job has five specialists rate a 100-question sample. Because the judge's and the humans' rankings agree, the smaller model is chosen and the judge is trusted for automated regression runs in CI/CD.
The scenario is illustrative.
Worked example

Choosing between two models

A support team compares two candidate models for answering policy questions. It has 500 real questions with reference answers written by experts.

  • Run a model-as-a-judge evaluation job for each model with correctness, completeness, faithfulness and harmfulness metrics.
  • Run a human evaluation job with five support specialists on a 100-question sample, rating helpfulness on a Likert scale.
  • Compare the jobs' results in the console, and check that judge and human rankings agree.

Both methods favour the smaller model on this task, so it is chosen. The human sample confirms that the automated judge can be trusted for future regression runs, which are then automated in the CI/CD pipeline.

Check yourself

Which Bedrock evaluation jobs suit RAG systems?

Show answer

Retrieve-only and retrieve-and-generate evaluation jobs.

Exam Tips

Remember for the exam

  • Managed FM quality measurement: Bedrock evaluation jobs.
  • Subjective quality at scale: model-as-a-judge evaluation.
  • RAG systems: retrieve-only and retrieve-and-generate evaluation jobs.
  • Models outside Bedrock: bring your own inference responses.
  • Use domain prompt datasets in JSONL with reference responses.