npx skills add ...
npx skills add firecrawl/ai-research-skills --skill evaluating-llms-harness
Evaluates LLMs across 60+ academic benchmarks (MMLU, HumanEval, GSM8K, TruthfulQA, HellaSwag). Use when benchmarking model quality, comparing models, reporting academic results, or tracking training progress. Industry standard used by EleutherAI, HuggingFace, and major labs. Supports HuggingFace, vLLM, APIs.
npx skills add firecrawl/ai-research-skills --skill evaluating-llms-harness
lm-evaluation-harness evaluates LLMs across 60+ academic benchmarks using standardized prompts and metrics.
Installation:
Evaluate any HuggingFace model:
View available tasks:
Evaluate model on core benchmarks (MMLU, GSM8K, HumanEval).
Copy this checklist:
Step 1: Choose benchmark suite
Core reasoning benchmarks:
Code benchmarks:
Standard suite (recommended for model releases):
Step 2: Configure model
HuggingFace model:
Quantized model (4-bit/8-bit):
Custom checkpoint:
Step 3: Run evaluation
Step 4: Analyze results
Results saved to results/llama2-7b-eval.json:
Evaluate checkpoints during training.
Step 1: Set up periodic evaluation
Evaluate every N training steps:
Step 2: Choose quick benchmarks
Fast benchmarks for frequent evaluation:
Avoid for frequent eval (too slow):
Step 3: Automate evaluation
Integrate with training script:
Or use PyTorch Lightning callbacks:
Step 4: Plot learning curves
Benchmark suite for model comparison.
Step 1: Define model list
Step 2: Run evaluations
Step 3: Generate comparison table
Output:
Use vLLM backend for 5-10x faster evaluation.
Step 1: Install vLLM
Step 2: Configure vLLM backend
Step 3: Run evaluation
vLLM is 5-10× faster than standard HuggingFace:
Use lm-evaluation-harness when:
Use alternatives instead:
Issue: Evaluation too slow
Use vLLM backend:
Or reduce fewshot examples:
Or evaluate subset of MMLU:
Issue: Out of memory
Reduce batch size:
Use quantization:
Enable CPU offloading:
Issue: Different results than reported
Check fewshot count:
Check exact task name:
Verify model and tokenizer match:
Issue: HumanEval not executing code
Install execution dependencies:
Enable code execution:
Benchmark descriptions: See references/benchmark-guide.md for detailed description of all 60+ tasks, what they measure, and interpretation.
Custom tasks: See references/custom-tasks.md for creating domain-specific evaluation tasks.
API evaluation: See references/api-evaluation.md for evaluating OpenAI, Anthropic, and other API models.
Multi-GPU strategies: See references/distributed-eval.md for data parallel and tensor parallel evaluation.