LLM Evaluation Cheat Sheet

Comprehensive guide to evaluating LLM outputs — perplexity, BLEU, ROUGE, human evaluation, lm-eval-harness, and benchmark frameworks.

Last Updated: May 1, 2025

Core Metrics

MetricMeasuresRangeBest For
Perplexity (PPL)How 'surprised' model is by text1 to ∞ (lower=better)Language modeling quality
BLEUN-gram overlap with reference0–100 (higher=better)Translation, summarization
ROUGE-1/2/LRecall-oriented n-gram overlap0–100 (higher=better)Summarization recall
METEORBLEU + synonyms + stemming0–100 (higher=better)Translation with paraphrasing
BERTScoreSemantic similarity via embeddings0–1 (higher=better)Captures meaning, not exact words
Exact Match (EM)Exact string match0 or 1QA with short answers
F1 ScoreToken-level precision + recall0–100 (higher=better)QA, NER, classification
chrFCharacter n-gram F-score0–100 (higher=better)Morphologically rich languages

Popular Benchmarks

BenchmarkWhat It TestsDataset SizeNotable Models
MMLU57 subjects — knowledge + reasoning~14K questionsGPT-4 86.4%, Claude 3 88.7%
HellaSwagCommonsense reasoning~10K completionsTests grounded reasoning
HumanEvalPython code generation164 problemsCode-focused evaluation
MT-BenchMulti-turn conversation quality80 questions × 2 turnsGPT-4 judges responses
AlpacaEvalInstruction following805 promptsWin rate vs reference (GPT-4)
BigBench200+ diverse reasoning tasksVaries by taskBroad cognitive evaluation
TruthfulQAFactual accuracy vs misconceptions817 questionsMeasures hallucination tendency
GSM8KGrade-school math word problems8.5K problemsMulti-step math reasoning

Running lm-eval-harness

pip install lm-eval
Install the EleutherAI evaluation harness
lm_eval --model hf --model_args pretrained=meta-llama/Llama-2-7b-hf --tasks mmlu --num_fewshot 5
Run MMLU with 5-shot prompting on Llama-2
lm_eval --model hf --model_args pretrained=gpt2 --tasks hellaswag,arc_easy --batch_size 8
Evaluate on multiple tasks in one run
lm_eval --model openai --model_args model=gpt-4 --tasks gsm8k --num_fewshot 8
Evaluate OpenAI models via API
lm_eval --model vllm --model_args pretrained=model-name,tensor_parallel_size=2 --tasks mmlu
Use vLLM backend for faster inference
--output_path ./results
Save evaluation results to a directory
--limit 100
Limit evaluation to 100 examples per task (quick test)
--log_samples
Log individual predictions alongside aggregate metrics

Human Evaluation Methods

ItemDescription
Pairwise ComparisonHumans compare two model outputs side-by-side — used in LMSys Chatbot Arena
Likert Scale RatingRate outputs 1-5 on quality, relevance, safety, and helpfulness
A/B TestingDeploy two models to production and measure user engagement/satisfaction
Vibe CheckQualitative assessment by domain experts — essential for creative/ nuanced tasks
Red TeamingAdversarial testing — humans deliberately try to elicit unsafe or incorrect outputs
Inter-Annotator AgreementMeasure consistency between human judges (Cohen's kappa, Fleiss' kappa)
Elo Rating SystemDerive rankings from pairwise battles (used by Chatbot Arena)
LLM-as-JudgeUse GPT-4 to evaluate other models — correlates well with human judgment
Pro Tip: Never rely on a single metric. Combine automatic metrics (perplexity/BLEU/ROUGE) with human evaluation and task-specific benchmarks for a complete picture of model quality.