Evaluation Metrics for GenAI Systems

Lesson 1 of 4215 minEvaluation, Scaling, and Inference Foundations
In this lesson8 sections

Evaluation metrics for generative AI systems

Compare automatic metrics with human judgments for generated text and images. Work through overlap and probability calculations, then identify what each score measures and which errors it can miss.

Evaluating a generation system starts with the task: what should the output contain, and what would make it unusable? A translation should preserve meaning; a product image should preserve the requested objects and attributes. Fluency or visual appeal alone cannot establish either requirement.

An evaluation process supports three decisions:

  • Acceptance: Check the output against task requirements, including factual accuracy, relevance, and format. A passing score is evidence under those checks, not a guarantee that the output has no errors.

  • Comparison: Test candidate models or system changes on the same representative cases. Keep the data, metric implementation, and scoring procedure consistent.

  • Failure analysis: Examine recurring defects, including harmful content, bias, missing constraints, and low diversity. Use the findings to choose a change and test it again.

Evaluation can reveal mode collapse, in which a generator produces a narrow range of outputs. Measuring diversity does not itself prevent that failure; the training or sampling process must address the cause.

This lesson groups methods by who or what assigns the score:

  1. Automatic metrics: A defined computation scores outputs. The scale and preferred direction depend on the metric: lower FID and perplexity are preferred, whereas higher BLEU is preferred under a fixed evaluation setup.

  2. Human evaluation: Reviewers judge outputs using a rubric, a rating scale, or a direct comparison. A one-to-five scale is one design choice, not a universal standard.

Two lenses on model quality
Two lenses on model quality

For each method below, identify its inputs, its score direction, and a plausible failure it would overlook. This is more useful than memorizing a list of metric names.

Automatic metrics

Automatic scoring can make repeated comparisons cheaper and more consistent. People still choose the dataset, references, encoders, and acceptance criteria. The resulting number measures that particular procedure, not quality in every sense.

Inception score

The inception score, or IS, uses a pretrained classifier such as Inception v3. It favors confident class predictions for individual generated images and a varied class distribution across the collection. A high score therefore reflects the classifier’s view of recognizable class diversity; it does not directly compare the collection with real images or establish that every image is realistic.

The inception score is calculated using the following steps:

  1. Obtain a class-probability distribution for each generated image.

  2. Average those distributions across the image collection to obtain the marginal class distribution.

  3. Calculate the KL divergence from each image’s distribution to that marginal distribution.

  4. Average those divergences across images, then take the exponential. The reference implementation makes this averaging step explicit.

Follow how the per-image distributions contribute to the collection-level score in the figures:

First, we need to classify the output images. We cannot produce a reliable IS if the classifier can not classify the outputs correctly.
First, we need to classify the output images. We cannot produce a reliable IS if the classifier can not classify the outputs correctly.
Now, we can calculate the label distribution for each label.
Now, we can calculate the label distribution for each label.
Then, we can calculate the data’s marginal (total) distribution.
Then, we can calculate the data’s marginal (total) distribution.
We will use the marginal and label distributions to calculate the KL divergence. The high KL divergence distribution looks similar to the leftmost distribution. The IS is simply the exponent of this KL divergence score.
We will use the marginal and label distributions to calculate the KL divergence. The high KL divergence distribution looks similar to the leftmost distribution. The IS is simply the exponent of this KL divergence score.

Note: A classifier-based diversity measure could be designed for text using topic probabilities. That would be a separately specified adaptation, not the original image inception score. Its usefulness would depend on whether the classifier’s categories match the task.

Fréchet inception distance

FID compares statistics of feature embeddings from two image collections, usually generated images and a real reference set. Both collections pass through the same feature encoder. A lower score means their estimated feature distributions are closer; the encoder and sample selection determine which differences the comparison can detect.

FID can be calculated by:

  1. Extract feature vectors for each image in both collections.

  2. Estimate a mean vector and covariance matrix for each collection.

  3. Compare the two fitted Gaussian distributions using the Fréchet-distance calculation. The original implementation uses a covariance-matrix term as well as the squared distance between means.

The scalar expression is the one-dimensional Gaussian special case, with standard deviations. It is not the general multivariate FID formula, nor a distance computed from just one generated image and one reference image. The following diagram shows the multivariate calculation, with a feature vector for each image and collection-level statistics.
FID compares feature distributions across real and generated image collections using mean vectors and covariance matrices.
FID compares feature distributions across real and generated image collections using mean vectors and covariance matrices.

Knowledge check

Practice: Comparing text embeddings

1 question · source answers hidden

Question 1 of 1

Can FID compare one generated text with one reference text? Explain what you would need to adapt its approach to text evaluation, and how you could compare a single pair of texts.

Your notes stay on this page and are not submitted.

BLEU score

BLEU compares candidate and reference text through modified n-gram precision and a brevity penalty. Candidate counts are clipped to the counts available in the references, so repeating a matching word cannot earn unlimited credit. BLEU was designed for machine-translation comparison across a corpus; a single-sentence example is useful for learning the arithmetic but can disagree with a person’s judgment of meaning.

Compare the reference sentence, "The library has a large collection of useful books," with the candidate, "The library has a small collection of useful books." Treat each word as one token, ignore the final period, and calculate precision for one-, two-, and three-word sequences.

N-gram lengthMatching candidate n-gramsPrecision
1 wordThe; library; has; a; collection; of; useful; books8/9
2 wordsThe library; library has; has a; collection of; of useful; useful books6/8
3 wordsThe library has; library has a; collection of useful; of useful books4/7

Let’s calculate the BLEU score for the example above.

We use the following formula:

Here, is the largest n-gram order included. The brevity penalty lowers the score for an output shorter than its reference, while the geometric average combines the modified precisions.
Where . So, we get:
Here, is the reference length and is the candidate length. Both contain nine tokens in this example, so = 1 and . The brevity penalty is therefore 1.

The score is about 0.725, reflecting substantial word-sequence overlap. Yet changing “large” to “small” reverses a meaningful claim. This is a concrete reason to pair overlap metrics with a check of task meaning rather than treating a high score as factual correctness.

Knowledge check

Check your understanding: BLEU

1 question · source answers hidden

Question 1 of 1

Why does BLEU apply a brevity penalty to short outputs without adding a separate penalty for long outputs?

Your notes stay on this page and are not submitted.

ROUGE score

ROUGE is a family of reference-overlap measures developed for summarization evaluation. Recall asks how much reference content is represented in the candidate, while precision and F-measures can account for extra candidate content. These are text-overlap measures; they do not independently verify the summary’s claims.

ROUGE-N compares n-gram counts. ROUGE-L uses a longest common subsequence, which preserves order without requiring every matched word to be adjacent. ROUGE-S compares in-order word pairs with gaps; a maximum gap can be configured, but one intervening word is not its general definition. Report the variant and whether the result is precision, recall, or an F-score.

Here is an example of a ROUGE-1 score (a variant of ROUGE-N):

The ROUGE-1 score calculation process
The ROUGE-1 score calculation process

For this ROUGE-1 example, combine precision and recall into an F1 score:

Where:

  • is the precision metric.

  • is the recall metric.

Note: Here, counts tokens under the example’s splitting rule. For instance, [The, cat, is, on, the, parrot] contains six tokens. Real evaluations must apply the same tokenization to references and candidates.

Let’s calculate these values for our example:

The example’s F1 score is about 0.77 because five tokens match a seven-token candidate and a six-token reference. That describes overlap under the stated counting rule; it does not establish that the two sentences express the same claim.

The F1-score is the harmonic mean of precision and recall: . It is high when both precision and recall are high.

Perplexity score

Perplexity summarizes the probabilities a language model assigns to an observed token sequence. It is the exponential of average negative log-likelihood. Lower perplexity means the model assigned higher probability to those tokens under the available context; it is not a direct measure of truth, coherence, or calibrated confidence.

  • Compare perplexity on the same data with a compatible tokenization and context policy. The Transformers explanation shows why tokenization and fixed context windows affect the result.

  • There is no universal threshold of 20 that separates a confident model from an uncertain one. Interpret the value relative to the evaluation setup and suitable baselines.

Consider a hypothetical word-level model with vocabulary ["Hello", "Cat", "My", "Dog", "name", "is","Edward"] and the sentence “My name is Edward.” The conditional probabilities below refer to those exact word tokens.

  • The probability of the first word:

  • The probability of the second word given the first word is “My”:

  • The probability of the third word given the first string is “My name”:

  • The probability of the fourth word given the first string is “My name is”:

Assign hypothetical conditional probabilities of 0.3, 0.5, 0.9, and 0.7 to the four words:

The perplexity here will be . Here, names the geometric mean token probability for a sentence with word count . It is not a probability distribution normalized across sentences:

The geometric mean token probability is approximately 0.5544, so perplexity is about 1.80. This calculation describes the assigned probabilities; it does not verify the sentence’s coherence.

CLIP score

CLIP uses jointly trained image and text encoders to compare the two modalities in a shared representation. CLIP-based scores use this relationship as a proxy for image-text compatibility. The published CLIPScore method was evaluated for image captioning without requiring a reference caption.

The basic comparison has two steps:

  1. Encode: Apply the corresponding CLIP encoders to the image and its description.

  2. Compare: Normalize the feature vectors and calculate their cosine similarity. The result reflects the encoder’s learned representation, which can miss a wrong count, attribute, or relationship.

The CLIP score calculation method
The CLIP score calculation method

Cosine similarity lies between -1 and 1, but those endpoints are geometric relationships between vectors, not calibrated judgments of meaning. Published CLIPScore applies a nonnegative clipping and scaling rule; it is not simply a universal normalization to a zero-to-one quality scale.

  • Specify the encoder, preprocessing, and score transformation before comparing results.

  • Choose thresholds using examples from the target task. Values such as 0.6 or 0.5 do not provide universal strong- and weak-alignment boundaries.

Note: A CLIP-based evaluation can be adapted to other multimodal tasks, but the sampling and aggregation rules must be defined. A frame-level image-text comparison, for example, does not by itself measure a video’s temporal consistency.

Automatic scores leave task judgments that the following human-review methods can address.

Human evaluation

Human reviewers can assess dimensions that automatic metrics miss, such as whether a story follows its prompt or a caption is misleading. Their judgments still need an explicit rubric and representative examples. The methods below differ in whether reviewers give an overall score, separate dimension scores, or a relative preference.

Mean opinion score

A mean opinion score, or MOS, averages reviewers’ ratings on a shared scale. For example, a study might use one to five with descriptions of what each value means. Report the rating procedure and variation across reviewers alongside the mean; the average can hide disagreement.

Example of an MOS evaluation
Example of an MOS evaluation

Task-specific quality evaluation

Task-specific quality evaluation uses separate rubric dimensions. For a writing task, these might include:

  • Fluency: Determines the grammatical correctness and natural flow of text.

  • Relevance: Determines how well the generated output aligns with the input prompt or context.

  • Creativity: Determines the originality and novelty of the content, especially in tasks like story generation or art creation.

Consider the hypothetical prompt “Write a brief story about a space explorer.”

  • Model A generates: “Captain Nova landed on distant planet, marveling at its blue vegetation.”

  • Model B generates: “The explorer bought a telescope to look at the stars.”

A reviewer could score the three dimensions separately:

TSQE of two models on text-based tasks
TSQE of two models on text-based tasks

The illustrative rubric can use a one-to-five scale for each dimension. Keep the dimensions separate when an overall average would hide a serious defect, such as accurate grammar paired with a response that ignores the prompt.

Pairwise comparison

In a pairwise comparison, a reviewer sees two outputs for the same input and chooses the better one under a stated criterion. This directly supports a relative model comparison, but it does not establish that either output meets an absolute acceptance standard. Allow a tie or a “both unacceptable” judgment when the study’s contract requires it.

The first round of comparisons
The first round of comparisons
The second round of comparisons
The second round of comparisons
This is the third round of comparisons. This process will continue until we have compared a suitable number of samples from each model.
This is the third round of comparisons. This process will continue until we have compared a suitable number of samples from each model.

Pairwise comparison can capture human preferences that automated metrics miss. Use representative prompts and consistent evaluation instructions; a larger sample alone does not eliminate evaluator bias.

Knowledge check

Check your understanding: Human evaluation

3 questions · source answers hidden

Question 1 of 3

A new AI model writes product descriptions. You want reviewers to give each description an overall quality rating. Which human evaluation method best fits this goal?

A.

Mean opinion score (MOS)

B.

Pairwise comparison

C.

Three-way comparison

D.

None of the above

Question 2 of 3

You want to compare the new model with your current model. Both generate descriptions for the same products. Which human evaluation method best supports a direct comparison of their outputs?

A.

Mean opinion score (MOS)

B.

Pairwise comparison

C.

Task-specific quality evaluation (TSQE)

D.

BLEU

Question 3 of 3

You need separate judgments of how factually accurate and persuasive the generated product descriptions are. Which human evaluation method should you use?

A.

Mean opinion score (MOS)

B.

Pairwise comparison

C.

Task-specific quality evaluation (TSQE)

D.

CLIP score

Conclusion

A useful evaluation plan names the failure each check should catch. BLEU and ROUGE measure reference overlap; perplexity measures assigned token probabilities; IS, FID, and CLIP-based scores inspect different properties of generated images or image-text pairs. Human ratings add task-specific judgments, with their own cost and variability.

Before choosing a model, write down one case where the preferred automatic score could improve while the task result gets worse. The “large” versus “small” example already supplies one. Include such cases in the evaluation set, then combine metric results with a rubric that tests the actual requirement. Agreement between several scores is useful evidence only when their checks cover the failures that matter.