3.4.6. Evaluating GenAI Output: NLP Metrics, LLM-as-a-Judge and Human Evaluation
💡 First Principle: Generated text rarely has one correct answer, so evaluation methods sit on a spectrum from cheap and literal to expensive and nuanced. Overlap metrics count shared words with a reference; embedding metrics compare meaning; a judge model reads for qualities like correctness and helpfulness; humans judge what nothing else can. Use the cheapest method that captures the quality you care about, and calibrate the cheap ones against the expensive ones.
NLP metrics (need a reference answer):
| Metric | What it measures | Typical use | Blind spot |
|---|---|---|---|
| BLEU | Precision of n-gram matches between generated and reference text | Machine translation | Penalizes valid paraphrases; says nothing about meaning |
| ROUGE (ROUGE-1, ROUGE-2, ROUGE-L) | Overlap of unigrams, bigrams, or the longest common subsequence with the reference — recall-oriented | Summarization | Unreliable on abstractive summaries that reword the source |
| METEOR | Word overlap plus stemming and synonym matching | Summarization, translation | Still lexical at heart |
| BERTScore | Cosine similarity of contextual embeddings from a BERT-family model | Summaries and answers that paraphrase | Inherits the embedding model's limits; can miss a single critical word change |
| Semantic similarity | Cosine similarity between embeddings of output and reference | Q&A and chat answers with many valid phrasings | Similar meaning is not the same as factually correct |
| Exact match / F1 over words | Literal or word-level agreement with a short reference answer | Extractive Q&A, classification | Fails on any rewording |
Where these live on AWS: Amazon Bedrock programmatic model evaluation jobs compute task metrics against built-in or custom datasets — for example BERTScore for summarization accuracy, F1 for question answering, word error rate for general-generation robustness, and a toxicity score. SageMaker AI foundation model evaluations (the open-source fmeval library) compute ROUGE-N, METEOR and BERTScore for summarization.
LLM-as-a-judge: an evaluator model scores each response from a generator model and explains its score. Bedrock's built-in judge metrics include correctness, completeness, faithfulness, helpfulness, logical coherence, relevance, following instructions and professional style and tone, plus responsible-AI metrics harmfulness, stereotyping and refusal. You can also define custom metrics with your own judge prompt and rating scale, and you can bring your own inference responses to evaluate a model hosted outside Bedrock. Supplying a reference response lets the judge consider it for correctness and completeness.
Judge models have their own biases — a preference for longer answers, or for answers written in their own style — so calibrate a judge against a sample of human ratings before trusting it for release decisions.
Human evaluation and human-in-the-loop:
| Mechanism | Use it for |
|---|---|
| Bedrock model evaluation job with human workers | Your own employees or subject-matter experts (a work team managed through Amazon Cognito) rate or compare responses from up to two models, with your custom metrics |
| Rating methods | Thumbs up/down and individual Likert scale (rate each response); comparison Likert scale, choice buttons and ordinal rank (compare responses) |
| Human review of production outputs | Route low-confidence or high-risk outputs to a reviewer before they reach the customer — an application workflow, often built with Step Functions or a review queue |
| Human preference data | Collect ratings that become evaluation datasets or feed customization (for example, preferred vs. rejected responses) |
Humans are the ground truth for subjective quality (tone, helpfulness, domain nuance) and for calibrating automated judges. They are slow and expensive, so use them on a sample, on disagreements, or on high-stakes releases.
⚠️ Exam Trap: A high ROUGE or BLEU score does not mean the answer is correct — it means it shares words with the reference. For a paraphrase-heavy task, BERTScore or semantic similarity is closer to meaning; for factual correctness and helpfulness at scale, an LLM-as-a-judge evaluation is the managed answer; for subjective brand-voice judgement, human evaluation.
⚠️ Exam Trap: BLEU is precision-oriented and grew up in translation; ROUGE is recall-oriented and grew up in summarization. Swapping them is a classic distractor.