davila7/claude-code-templates

evaluation-lm-evaluation-harness

Evaluates LLMs across 60+ academic benchmarks (MMLU, HumanEval, GSM8K, TruthfulQA, HellaSwag).

  • SKILL.md 已保存
  • 英文来源资料
  • 安装与运行未实测
先判断是否解决你的问题

evaluation-lm-evaluation-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.

以上为来源原文,中文用途说明尚待整理。

按客户端选择安装入口

怎么接入你的 Agent?

  1. 定位完整 Skill 目录

    打开本项目来源,核对 SKILL.md 及其引用的脚本和资料。

  2. 交给你正在用的 Agent

    在下面选择客户端,展开并复制安装指令,让 Agent 读取来源后选择安装方式。

  3. 确认识别,再做具体任务

    让 Agent 回报安装目录和识别到的名称 evaluation-lm-evaluation-harness,然后告诉 Agent 你的任务和实际输入,让它先核对触发条件。

展开并复制给 Codex 的安装指令
发送给 Codex

安装并检查 evaluation-lm-evaluation-harness

请在 Codex 的当前工作环境中安装并检查 evaluation-lm-evaluation-harness 这个 Skill。

项目身份:davila7/claude-code-templates / evaluation-lm-evaluation-harness
来源:https://github.com/davila7/claude-code-templates/blob/c1bc5c1df4ff0bffb9a04d8f7790543681232423/cli-tool/components/skills/ai-research/evaluation-lm-evaluation-harness/SKILL.md
已定位的源文件:cli-tool/components/skills/ai-research/evaluation-lm-evaluation-harness/SKILL.md

1. 先阅读真实 SKILL.md 和它引用的必要文件,确认触发条件、安装方式、依赖与权限;尊重源文件要求的审批步骤。
2. 按当前客户端支持的方式安装完整 Skill 目录,保留已有配置,不只复制一段提示词。涉及缺失凭证、目标目录或权限时先列出缺项并向我确认。
3. 安装后回读实际目录、Skill 名称和识别结果,说明哪些步骤已完成,哪些只是文档检查,不得把安装成功当作任务已经实测。
4. 如来源提供了可安全验证的示例,在我提供所需输入后做一个最小任务;创建、修改、删除、部署或发送内容前,按源文件和我的授权执行。
需要核对时再展开原文

来源原文与资料状态

源文件
已保存 SKILL.md,抓取于 2026-11-23T04:29:48.865Z
中文使用说明
尚待整理,保留英文来源内容
安装与任务测试
本站未执行安装或任务测试
来源复核
已保留来源记录;当前完整用法未逐项人工复核
展开 SKILL.md 原文、章节与历史收录资料

cli-tool/components/skills/ai-research/evaluation-lm-evaluation-harness/SKILL.md · 抓取时间 2026-11-23T04:29:48.865Z

以下保留源文件的 description、章节及摘录,供核对中文说明;完整文件通过上方链接打开。

抓取成功不代表已完成安装或任务测试。

来源 description(原文)

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.

查看源文件章节 / Source sections
  • 原文:lm-evaluation-harness - LLM Benchmarking
  • 快速开始 / Quick start
  • 原文:Common workflows
  • 原文:Workflow 1: Standard benchmark evaluation
  • 原文:Workflow 2: Track training progress
  • 原文:Workflow 3: Compare multiple models
  • 原文:Workflow 4: Evaluate with vLLM (faster inference)
  • 原文:When to use vs alternatives
  • 原文:Common issues
  • 原文:Advanced topics
  • 原文:Hardware requirements
  • 原文:Resources
快速开始 / Quick start

lm-evaluation-harness evaluates LLMs across 60+ academic benchmarks using standardized prompts and metrics. **Installation**: ```bash pip install lm-eval ``` **Evaluate any HuggingFace model**: ```bash lm_eval --model hf \ --model_args pretrained=meta-llama/Llama-2-7b-hf \ --tasks mmlu,gsm8k,hellaswag \ --device cuda:0 \ --batch_size 8 ``` **View available tasks**: ```bash lm_eval --tasks list ```

原文:Workflow 1: Standard benchmark evaluation

Evaluate model on core benchmarks (MMLU, GSM8K, HumanEval). Copy this checklist: ``` Benchmark Evaluation: - [ ] Step 1: Choose benchmark suite - [ ] Step 2: Configure model - [ ] Step 3: Run evaluation - [ ] Step 4: Analyze results ``` **Step 1: Choose benchmark suite** **Core reasoning benchmarks**: - **MMLU** (Massive Multitask Language Understanding) - 57 subjects, multiple choice - **GSM8K** - Grade school math word problems - **HellaSwag** - Common sense reasoning - **TruthfulQA** - Truthfulness and factuality - **ARC** (AI2 Reasoning Challenge) - Science questions **Code benchmarks**: - **HumanEval** - Python code generation (164 problems) - **MBPP** (Mostly Basic Python Problems) - Python coding **Standard suite** (recommended for model releases): ```bash --tasks mmlu,gsm8k,hellaswag,truthfulqa,arc_challenge ``` **Step 2: Configure model** **HuggingFace model**: ```bash lm_eval --model hf \ --model_args pretrained=meta-llama/Llama-2-7b-hf,dtype=bfloat16 \ --tasks mmlu \ --device cuda:0 \ --batch_size auto # Auto-detect optimal batch size ``` **Quantized model (4-bit/8-bit)**: ```bash lm_eval --model hf \ --model_args pretrained=meta-llama/Llama-2-7b-hf,load_in_4bit=True \ --tasks mmlu \ --device cuda:0 ``` **Custom checkpoint**: ```bash lm_eval --model hf \ --model_args pretrained=/path/to/my-model,tokenizer=/path/to/tokenizer \ --tasks mmlu \ --device cuda:0 ``` **Step 3: Run evaluation** ```bash # Full MMLU evaluation (57 subjects) lm_eval --model hf \ --model_args pretrained=meta-llama/Llama-2-7b-hf \ --tasks mmlu \ --num_fewshot 5 \ # 5-shot evaluation (standard) --batch_size 8 \ --output_path results/ \ --log_samples # Save individual predictions # Multiple benchmarks at once lm_eval --model hf \ --model_args pretrained=meta-llama/Llama-2-7b-hf \ --tasks mmlu,gsm8k,hellaswag,truthfulqa,arc_challenge \ --num_fewshot 5 \ --batch_size 8 \ --output_path results/llama2-7b-eval.json ``` **Step 4: Analyze results** Results saved to `results/llama2-7b-eval.json`:

本段为节选,完整内容见源文件。

原文:Workflow 2: Track training progress

Evaluate checkpoints during training. ``` Training Progress Tracking: - [ ] Step 1: Set up periodic evaluation - [ ] Step 2: Choose quick benchmarks - [ ] Step 3: Automate evaluation - [ ] Step 4: Plot learning curves ``` **Step 1: Set up periodic evaluation** Evaluate every N training steps: ```bash #!/bin/bash # eval_checkpoint.sh CHECKPOINT_DIR=$1 STEP=$2 lm_eval --model hf \ --model_args pretrained=$CHECKPOINT_DIR/checkpoint-$STEP \ --tasks gsm8k,hellaswag \ --num_fewshot 0 \ # 0-shot for speed --batch_size 16 \ --output_path results/step-$STEP.json ``` **Step 2: Choose quick benchmarks** Fast benchmarks for frequent evaluation: - **HellaSwag**: ~10 minutes on 1 GPU - **GSM8K**: ~5 minutes - **PIQA**: ~2 minutes Avoid for frequent eval (too slow): - **MMLU**: ~2 hours (57 subjects) - **HumanEval**: Requires code execution **Step 3: Automate evaluation** Integrate with training script: ```python # In training loop if step % eval_interval == 0: model.save_pretrained(f"checkpoints/step-{step}") # Run evaluation os.system(f"./eval_checkpoint.sh checkpoints step-{step}") ``` Or use PyTorch Lightning callbacks: ```python from pytorch_lightning import Callback class EvalHarnessCallback(Callback): def on_validation_epoch_end(self, trainer, pl_module): step = trainer.global_step checkpoint_path = f"checkpoints/step-{step}" # Save checkpoint trainer.save_checkpoint(checkpoint_path) # Run lm-eval os.system(f"lm_eval --model hf --model_args pretrained={checkpoint_path} ...") ``` **Step 4: Plot learning curves** ```python import json import matplotlib.pyplot as plt # Load all results steps = [] mmlu_scores = [] for file in sorted(glob.glob("results/step-*.json")): with open(file) as f: data = json.load(f) step = int(file.split("-")[1].split(".")[0]) steps.append(step) mmlu_scores.append(data["results"]["mmlu"]["acc"]) # Plot plt.plot(steps, mmlu_scores) plt.xlabel("Training Step") plt.ylabel("MMLU Accuracy") plt.title("Training Progress") plt.savefig("training_curve.png") ```

原文:Workflow 3: Compare multiple models

Benchmark suite for model comparison. ``` Model Comparison: - [ ] Step 1: Define model list - [ ] Step 2: Run evaluations - [ ] Step 3: Generate comparison table ``` **Step 1: Define model list** ```bash # models.txt meta-llama/Llama-2-7b-hf meta-llama/Llama-2-13b-hf mistralai/Mistral-7B-v0.1 microsoft/phi-2 ``` **Step 2: Run evaluations** ```bash #!/bin/bash # eval_all_models.sh TASKS="mmlu,gsm8k,hellaswag,truthfulqa" while read model; do echo "Evaluating $model" # Extract model name for output file model_name=$(echo $model | sed 's/\//-/g') lm_eval --model hf \ --model_args pretrained=$model,dtype=bfloat16 \ --tasks $TASKS \ --num_fewshot 5 \ --batch_size auto \ --output_path results/$model_name.json done < models.txt ``` **Step 3: Generate comparison table** ```python import json import pandas as pd models = [ "meta-llama-Llama-2-7b-hf", "meta-llama-Llama-2-13b-hf", "mistralai-Mistral-7B-v0.1", "microsoft-phi-2" ] tasks = ["mmlu", "gsm8k", "hellaswag", "truthfulqa"] results = [] for model in models: with open(f"results/{model}.json") as f: data = json.load(f) row = {"Model": model.replace("-", "/")} for task in tasks: # Get primary metric for each task metrics = data["results"][task] if "acc" in metrics: row[task.upper()] = f"{metrics['acc']:.3f}" elif "exact_match" in metrics: row[task.upper()] = f"{metrics['exact_match']:.3f}" results.append(row) df = pd.DataFrame(results) print(df.to_markdown(index=False)) ``` Output: ``` | Model | MMLU | GSM8K | HELLASWAG | TRUTHFULQA | |------------------------|-------|-------|-----------|------------| | meta-llama/Llama-2-7b | 0.459 | 0.142 | 0.765 | 0.391 | | meta-llama/Llama-2-13b | 0.549 | 0.287 | 0.801 | 0.430 | | mistralai/Mistral-7B | 0.626 | 0.395 | 0.812 | 0.428 | | microsoft/phi-2 | 0.560 | 0.613 | 0.682 | 0.447 | ```

原文:Workflow 4: Evaluate with vLLM (faster inference)

Use vLLM backend for 5-10x faster evaluation. ``` vLLM Evaluation: - [ ] Step 1: Install vLLM - [ ] Step 2: Configure vLLM backend - [ ] Step 3: Run evaluation ``` **Step 1: Install vLLM** ```bash pip install vllm ``` **Step 2: Configure vLLM backend** ```bash lm_eval --model vllm \ --model_args pretrained=meta-llama/Llama-2-7b-hf,tensor_parallel_size=1,dtype=auto,gpu_memory_utilization=0.8 \ --tasks mmlu \ --batch_size auto ``` **Step 3: Run evaluation** vLLM is 5-10× faster than standard HuggingFace: ```bash # Standard HF: ~2 hours for MMLU on 7B model lm_eval --model hf \ --model_args pretrained=meta-llama/Llama-2-7b-hf \ --tasks mmlu \ --batch_size 8 # vLLM: ~15-20 minutes for MMLU on 7B model lm_eval --model vllm \ --model_args pretrained=meta-llama/Llama-2-7b-hf,tensor_parallel_size=2 \ --tasks mmlu \ --batch_size auto ```

原文:When to use vs alternatives

**Use lm-evaluation-harness when:** - Benchmarking models for academic papers - Comparing model quality across standard tasks - Tracking training progress - Reporting standardized metrics (everyone uses same prompts) - Need reproducible evaluation **Use alternatives instead:** - **HELM** (Stanford): Broader evaluation (fairness, efficiency, calibration) - **AlpacaEval**: Instruction-following evaluation with LLM judges - **MT-Bench**: Conversational multi-turn evaluation - **Custom scripts**: Domain-specific evaluation

文件 SHA256:c4cd80ef0c50a942980bcb8c6d6451d0bd08a0e3f6c7df079775b806077788be

仓库许可证记录:MIT;skill-declaration-captured-not-interpreted,查看来源。

SKILL.md原文description · 2026-11-23T04:29:48.865Z

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.

查看历史简介来源

历史收录数据

来源仓库davila7/claude-code-templates
Skill源路径cli-tool/components/skills/ai-research/evaluation-lm-evaluation-harness/SKILL.md

安装前请让使用的Agent先读取这个SKILL.md及其所在目录,确认依赖和所需权限。此页不生成未经来源验证的安装命令。

返回 Skills 目录,按任务继续筛选 · MCP与Skills教程与资源