Exam Room · Advanced Generative AI Developer

Pop Quiz: Measuring Bias With fmeval

· 4 min read

Exam-style

Before a generative feature launches, the legal team wants a measured report on toxicity and bias across a 2,000-prompt test set, using a foundation model the company did not train. What produces that report?

Reveal the answer

A. The open-source fmeval library, scoring toxicity, prompt stereotyping, accuracy, and semantic robustness over the prompt set

fmeval is the engine behind SageMaker Clarify’s foundation model evaluation, and it installs on its own with pip. It scores generated text on toxicity, prompt stereotyping, accuracy, factual knowledge, and semantic robustness, which is the shape bias takes for a generative model. An Amazon Bedrock evaluation job is the managed alternative, though its built-in automatic metrics stop at accuracy, robustness, and toxicity. Guardrails apply content filters at request time and return blocks, not measurements. Model Cards record a judgement rather than measure one. The classical pre-training bias metrics need labelled training data the team does not have for someone else’s foundation model, and Comprehend reports sentiment per document or entity rather than stereotyping or quality disparity.

Generative AI Development · part of The Exam Room

Q. You must measure a GenAI feature for bias and toxicity before launch. Which tool?

A. The open-source fmeval library, the engine behind SageMaker Clarify’s foundation model evaluation, scores accuracy, factual knowledge, toxicity, semantic robustness, and prompt stereotyping (bias) from your own notebook or pipeline. An Amazon Bedrock evaluation job is the managed path, but its built-in automatic metrics are accuracy, robustness, and toxicity, so stereotyping still comes from fmeval. Clarify moved to maintenance on 30 June 2026 and closed to new customers on 30 July 2026; existing customers carry on, and pip install fmeval works either way.

Why? Bias for a generative model shows up as stereotyping and quality disparity, measured offline, not as label parity.

These posts are LLM-aided. Backbone, original writing, and structure by Craig. Research and editing by Craig + LLM. Proof-reading by Craig.