nanoresearch-experimen…
Generate a Python code skeleton from an experiment blueprint
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.
$ npx -y skills add OpenRaiser/NanoResearch --skill lm-evaluation-harness --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/lm-evaluation-harnessContext preview
The summary Claude sees to decide when to auto-load this skill.
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.
name: evaluating-llms-harness 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. version: 1.0.0 author: Orchestra Research license: MIT tags: [Evaluation, LM Evaluation Harness, Benchmarking, MMLU, HumanEval, GSM8K, EleutherAI, Model Quality, Academic Benchmarks, Industry Standard] dependencies: [lm-eval, transformers, vllm]
lm-evaluation-harness evaluates LLMs across 60+ academic benchmarks using standardized prompts and metrics.
**Installation**:
pip install lm-eval
**Evaluate any HuggingFace model**:
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**:
lm_eval --tasks list
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**:
**Code benchmarks**:
**Standard suite** (recommended for model releases):
--tasks mmlu,gsm8k,hellaswag,truthfulqa,arc_challenge
**Step 2: Configure model**
**HuggingFace model**:
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)**:
lm_eval --model hf \ --model_args pretrained=meta-llama/Llama-2-7b-hf,load_in_4bit=True \ --tasks mmlu \ --device cuda:0
**Custom checkpoint**:
lm_eval --model hf \ --model_args pretrained=/path/to/my-model,tokenizer=/path/to/tokenizer \ --tasks mmlu \ --device cuda:0
**Step 3: Run evaluation**
# 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`:
{
"results": {
"mmlu": {
"acc": 0.459,
"acc_stderr": 0.004
},
"gsm8k": {
"exact_match": 0.142,
"exact_match_stderr": 0.006
},
"hellaswag": {
"acc_norm": 0.765,
"acc_norm_stderr": 0.004
}
},
"config": {
"model": "hf",
"model_args": "pretrained=meta-llama/Llama-2-7b-hf",
"num_fewshot": 5
}
}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:
#!/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:
Avoid for frequent eval (too slow):
**Step 3: Automate evaluation**
Integrate with training script:
# 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:
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**
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")Benchmark suite for model comparison.
Model Comparison: - [ ] Step 1: Define model list - [ ] Step 2: Run evaluations - [ ] Step 3: Generate comparison table
**Step 1: Define
端到端自主 AI 科研引擎 — 从研究想法到完整论文,全程自动化 快速开始 · 效果展示 · 流水线 · Claude Code · 飞书机器人 🔬 NanoResearch 真正运行计算实验——它不仅生成代码,还能将代码提交到 GPU 集群执行训练,收集真实实验结果,生成论文配图,最终输出一篇有实验数据支撑的完整 LaTeX 论文。论文中的每一个数据、表格、图表都来自实际运行的实验结果,而非 LLM 编造。
Generate a Python code skeleton from an experiment blueprint
Search academic literature and generate research hypotheses
Produce an experiment blueprint from a research hypothesis
Draft a LaTeX research paper from all previous stage outputs
Orchestrates end-to-end autonomous AI research projects using a two-loop architecture. The inner loop runs rapid experiment iterations with clear optimization…
Generates publication-quality figures for ML papers from research context. Given a paper section or description, extracts system components and relationships…