crfm-helm0.5.5
Published
Benchmark for language models
pip install crfm-helm
Package Downloads
Authors
Project URLs
Requires Python
>=3.9
Dependencies
- cattrs
~=22.2
- dacite
~=1.6
- importlib-resources
~=5.10
- Mako
~=1.2
- numpy
<3,~=1.26
- pandas
~=2.0
- pyhocon
~=0.3.59
- retrying
~=1.3
- spacy
~=3.5
- tqdm
~=4.64
- zstandard
~=0.18.0
- sqlitedict
<3.0,>=2.1.0
- bottle
~=0.12.23
- datasets
~=2.17
- pyarrow
>=11.0.0
- pyarrow-hotfix
~=0.6
- nltk
!=3.9.0,~=3.7
- rouge-score
~=0.1.2
- scipy
~=1.10
- uncertainty-calibration
~=0.1.4
- scikit-learn
~=1.1
- transformers
~=4.40
- torch
<3.0.0,>=1.13.1
- torchvision
<3.0.0,>=0.14.1
- gunicorn
>=20.1; extra == "proxy-server"
- scaleapi
~=2.13.0; extra == "human-evaluation"
- surge-api
~=1.1.0; extra == "human-evaluation"
- gdown
~=5.1; extra == "scenarios"
- sympy
~=1.11.1; extra == "scenarios"
- xlrd
~=2.0.1; extra == "scenarios"
- google-api-python-client
~=2.64; extra == "metrics"
- numba
~=0.56; extra == "metrics"
- sacrebleu
~=2.2.1; extra == "metrics"
- langdetect
~=1.0.9; extra == "metrics"
- immutabledict
~=4.2.0; extra == "metrics"
- gradio_client
~=1.3; extra == "metrics"
- pytrec_eval
==0.5; extra == "ranking"
- summ-eval
~=0.892; extra == "summarization"
- bert-score
~=0.3; extra == "summarization"
- colorcet
~=3.0.1; extra == "plots"
- matplotlib
~=3.6.0; extra == "plots"
- seaborn
~=0.11.0; extra == "plots"
- fairlearn
~=0.9.0; extra == "decodingtrust"
- simple-slurm
~=0.2.6; extra == "slurm"
- unidecode
~=1.3; extra == "cleva"
- pypinyin
~=0.49.0; extra == "cleva"
- jieba
~=0.42.1; extra == "cleva"
- opencc
~=1.1; extra == "cleva"
- langdetect
~=1.0; extra == "cleva"
- crfm-helm
[accelerate]; extra == "images"
- pillow
~=10.2; extra == "images"
- pymongo
~=4.2; extra == "mongo"
- evaluate
~=0.4.1; extra == "unitxt"
- pythainlp
==5.0.0; extra == "seahelm"
- pyonmttok
==1.37.0; extra == "seahelm"
- sacrebleu
~=2.2.1; extra == "seahelm"
- python-crfsuite
~=0.9.11; extra == "seahelm"
- accelerate
~=0.25; extra == "accelerate"
- aleph-alpha-client
~=2.14.0; extra == "aleph-alpha"
- tokenizers
>=0.13.3; extra == "aleph-alpha"
- ai2-olmo
~=0.2; extra == "allenai"
- boto3
~=1.34.131; extra == "amazon"
- awscli
~=1.33.13; extra == "amazon"
- botocore
~=1.34.131; extra == "amazon"
- anthropic
~=0.39; extra == "anthropic"
- websocket-client
~=1.3.2; extra == "anthropic"
- httpx
<0.28.0; extra == "anthropic"
- cohere
~=5.3; extra == "cohere"
- mistralai
~=1.1; extra == "mistral"
- openai
~=1.64; extra == "openai"
- tiktoken
~=0.7; extra == "openai"
- pydantic
~=2.0; extra == "openai"
- google-cloud-aiplatform
~=1.48; extra == "google"
- together
~=1.1; extra == "together"
- sentencepiece
~=0.2.0; extra == "yandex"
- crfm-helm
[ai21]; extra == "models"
- crfm-helm
[accelerate]; extra == "models"
- crfm-helm
[aleph-alpha]; extra == "models"
- crfm-helm
[allenai]; extra == "models"
- crfm-helm
[amazon]; extra == "models"
- crfm-helm
[anthropic]; extra == "models"
- crfm-helm
[cohere]; extra == "models"
- crfm-helm
[google]; extra == "models"
- crfm-helm
[mistral]; extra == "models"
- crfm-helm
[openai]; extra == "models"
- crfm-helm
[reka]; extra == "models"
- crfm-helm
[together]; extra == "models"
- crfm-helm
[yandex]; extra == "models"
- crfm-helm
[ibm-enterprise-scenarios]; extra == "models"
- reka-api
~=2.0.0; extra == "reka"
- crfm-helm
[openai]; extra == "vlm"
- einops
~=0.7.0; extra == "vlm"
- einops-exts
~=0.0.4; extra == "vlm"
- open-clip-torch
~=2.24; extra == "vlm"
- torch
~=2.1; extra == "vlm"
- transformers_stream_generator
~=0.0.4; extra == "vlm"
- scipy
~=1.10; extra == "vlm"
- torchvision
<3.0.0,>=0.14.1; extra == "vlm"
- crfm-helm
[reka]; extra == "vlm"
- crfm-helm
[images]; extra == "vlm"
- crfm-helm
[image2struct]; extra == "vlm"
- pycocoevalcap
~=1.2; extra == "vlm"
- transformers
~=4.45.2; extra == "vlm"
- qwen-vl-utils
~=0.0.8; extra == "vlm"
- openpyxl
~=3.1; extra == "ibm-enterprise-scenarios"
- ibm-watsonx-ai
~=1.2.6; extra == "ibm"
- crfm-helm
[images]; extra == "image2struct"
- latex
~=0.7.0; extra == "image2struct"
- pdf2image
~=1.16.3; extra == "image2struct"
- selenium
~=4.17.2; extra == "image2struct"
- html2text
~=2024.2.26; extra == "image2struct"
- opencv-python
<4.8.2.0,>=4.7.0.68; extra == "image2struct"
- lpips
~=0.1.4; extra == "image2struct"
- imagehash
~=4.3.1; extra == "image2struct"
- gdown
~=5.1; extra == "heim"
- diffusers
~=0.24.0; extra == "heim"
- icetk
~=0.0.4; extra == "heim"
- jax
~=0.4.13; extra == "heim"
- jaxlib
~=0.4.13; extra == "heim"
- crfm-helm
[openai]; extra == "heim"
- einops
~=0.7.0; extra == "heim"
- omegaconf
~=2.3.0; extra == "heim"
- pytorch-lightning
~=2.0.5; extra == "heim"
- flax
~=0.6.11; extra == "heim"
- ftfy
~=6.1.1; extra == "heim"
- Unidecode
~=1.3.6; extra == "heim"
- wandb
~=0.16; extra == "heim"
- google-cloud-translate
~=3.11.2; extra == "heim"
- autokeras
~=1.0.20; extra == "heim"
- clip-anytorch
~=2.5.0; extra == "heim"
- google-cloud-storage
~=2.9; extra == "heim"
- lpips
~=0.1.4; extra == "heim"
- multilingual-clip
~=1.0.10; extra == "heim"
- NudeNet
~=2.0.9; extra == "heim"
- opencv-python
<4.8.2.0,>=4.7.0.68; extra == "heim"
- pytorch-fid
~=0.3.0; extra == "heim"
- tensorflow
~=2.11; extra == "heim"
- timm
~=0.6.12; extra == "heim"
- torch-fidelity
~=0.3.0; extra == "heim"
- torchmetrics
~=0.11.1; extra == "heim"
- scikit-image
!=0.23.*,==0.*,>=0.22; extra == "heim"
- crfm-helm
[images]; extra == "heim"
- crfm-helm
[summarization]; extra == "medhelm"
- python-docx
~=1.1.2; extra == "medhelm"
- langchain
~=0.3.9; extra == "medhelm"
- lxml
~=5.3.0; extra == "medhelm"
- crfm-helm
[openai]; extra == "audiolm"
- crfm-helm
[google]; extra == "audiolm"
- pydub
~=0.25.1; extra == "audiolm"
- ffmpeg-python
~=0.2.0; extra == "audiolm"
- soundfile
~=0.12; extra == "audiolm"
- librosa
~=0.10; extra == "audiolm"
- einops
~=0.7.0; extra == "audiolm"
- openai-whisper
==20240930; extra == "audiolm"
- transformers
~=4.45.1; extra == "audiolm"
- transformers_stream_generator
~=0.0.4; extra == "audiolm"
- scipy
~=1.10; extra == "audiolm"
- torchvision
<3.0.0,>=0.14.1; extra == "audiolm"
- pycocoevalcap
~=1.2; extra == "audiolm"
- jiwer
~=3.0; extra == "audiolm"
- rapidfuzz
~=3.10; extra == "audiolm"
- jieba
~=0.42.1; extra == "audiolm"
- crfm-helm
[proxy-server]; extra == "all"
- crfm-helm
[human-evaluation]; extra == "all"
- crfm-helm
[scenarios]; extra == "all"
- crfm-helm
[metrics]; extra == "all"
- crfm-helm
[plots]; extra == "all"
- crfm-helm
[decodingtrust]; extra == "all"
- crfm-helm
[slurm]; extra == "all"
- crfm-helm
[cleva]; extra == "all"
- crfm-helm
[images]; extra == "all"
- crfm-helm
[models]; extra == "all"
- crfm-helm
[mongo]; extra == "all"
- crfm-helm
[heim]; extra == "all"
- crfm-helm
[vlm]; extra == "all"
- crfm-helm
[audiolm]; extra == "all"
- pytest
~=7.2.0; extra == "dev"
- pre-commit
~=2.20.0; extra == "dev"
- black
==24.3.0; extra == "dev"
- mypy
==1.5.1; extra == "dev"
- flake8
==5.0.4; extra == "dev"
Holistic Evaluation of Language Models (HELM)
Holistic Evaluation of Language Models (HELM) is an open source Python framework created by the Center for Research on Foundation Models (CRFM) at Stanford for holistic, reproducible and transparent evaluation of foundation models, including large language models (LLMs) and multimodal models. This framework includes the following features:
- Datasets and benchmarks in a standardized format (e.g. MMLU-Pro, GPQA, IFEval, WildBench)
- Models from various providers accessible through a unified interface (e.g. OpenAI models, Anthropic Claude, Google Gemini)
- Metrics for measuring various aspects beyond accuracy (e.g. efficiency, bias, toxicity)
- Web UI for inspecting individual prompts and responses
- Web leaderboard for comparing results across models and benchmarks
Documentation
Please refer to the documentation on Read the Docs for instructions on how to install and run HELM.
Quick Start
Install the package from PyPI:
pip install crfm-helm
Run the following in your shell:
# Run benchmark
helm-run --run-entries mmlu:subject=philosophy,model=openai/gpt2 --suite my-suite --max-eval-instances 10
# Summarize benchmark results
helm-summarize --suite my-suite
# Start a web server to display benchmark results
helm-server --suite my-suite
Then go to http://localhost:8000/ in your browser.
Leaderboards
We maintain offical leaderboards with results from evaluating recent models on notable benchmarks using this framework. Our current flagship leaderboards are:
We also maintain leaderboards for a diverse range of domains (e.g. medicine, finance) and aspects (e.g. multi-linguality, world knowledge, regulation compliance). Refer to the HELM website for a full list of leaderboards.
Papers
The HELM framework was used in the following papers for evaluating models.
- Holistic Evaluation of Language Models - paper, leaderboard
- Holistic Evaluation of Vision-Language Models (VHELM) - paper, leaderboard, documentation
- Holistic Evaluation of Text-To-Image Models (HEIM) - paper, leaderboard, documentation
- Image2Struct: Benchmarking Structure Extraction for Vision-Language Models - paper
- Enterprise Benchmarks for Large Language Model Evaluation - paper, documentation
- The Mighty ToRR: A Benchmark for Table Reasoning and Robustness - paper
- Reliable and Efficient Amortized Model-based Evaluation - paper, documentation
The HELM framework can be used to reproduce the published model evaluation results from these papers. To get started, refer to the documentation links above for the corresponding paper, or the main Reproducing Leaderboards documentation.
Citation
If you use this software in your research, please cite the Holistic Evaluation of Language Models paper as below.
@article{
liang2023holistic,
title={Holistic Evaluation of Language Models},
author={Percy Liang and Rishi Bommasani and Tony Lee and Dimitris Tsipras and Dilara Soylu and Michihiro Yasunaga and Yian Zhang and Deepak Narayanan and Yuhuai Wu and Ananya Kumar and Benjamin Newman and Binhang Yuan and Bobby Yan and Ce Zhang and Christian Alexander Cosgrove and Christopher D Manning and Christopher Re and Diana Acosta-Navas and Drew Arad Hudson and Eric Zelikman and Esin Durmus and Faisal Ladhak and Frieda Rong and Hongyu Ren and Huaxiu Yao and Jue WANG and Keshav Santhanam and Laurel Orr and Lucia Zheng and Mert Yuksekgonul and Mirac Suzgun and Nathan Kim and Neel Guha and Niladri S. Chatterji and Omar Khattab and Peter Henderson and Qian Huang and Ryan Andrew Chi and Sang Michael Xie and Shibani Santurkar and Surya Ganguli and Tatsunori Hashimoto and Thomas Icard and Tianyi Zhang and Vishrav Chaudhary and William Wang and Xuechen Li and Yifan Mai and Yuhui Zhang and Yuta Koreeda},
journal={Transactions on Machine Learning Research},
issn={2835-8856},
year={2023},
url={https://openreview.net/forum?id=iO4LZibEqW},
note={Featured Certification, Expert Certification}
}
Tutorial
This tutorial will explain how to use the HELM command line tools to run benchmarks, aggregate statistics, and visualize results.
We will run two runs using the mmlu
scenario on the openai/gpt2
model. The mmlu
scenario implements the Massive Multitask Language (MMLU) benchmark from this paper, and consists of a Question Answering (QA) task using a dataset with questions from 57 subjects such as elementary mathematics, US history, computer science, law, and more. Note that GPT-2 performs poorly on MMLU, so this is just a proof of concept. We will run two runs: the first using questions about anatomy, and the second using questions about philosophy.
Using helm-run
helm-run
is a command line tool for running benchmarks.
To run this benchmark using the HELM command-line tools, we need to specify run entries that describes the desired runs. For this example, the run entries are mmlu:subject=anatomy,model=openai/gpt2
(for anatomy) and mmlu:subject=philosophy,model=openai/gpt2
(for philosophy).
We will now use helm-run
to execute the runs. Run this command:
helm-run --run-entries mmlu:subject=anatomy,model=openai/gpt2 mmlu:subject=philosophy,model=openai/gpt2 --suite my-suite --max-eval-instances 10
The meaning of the arguments are as follows:
--run-entries
specifies the run entries from the desired runs.--suite
specifies a subdirectory under the output directory in which all the output will be placed.--max-eval-instances
limits evaluation to only N instances (i.e. items) from the benchmark, using a randomly shuffled order of instances.
helm-run
creates an environment directory environment and an output directory by default.
- The environment directory is
prod_env/
by default and can be set using--local-path
. Credentials for making API calls should be added to acredentials.conf
file in this directory. - The output directory is
benchmark_output/
by default and can be set using--output-path
.
After running this command, navigate to the benchmark_output/runs/my-suite/
directory. This should contain a two sub-directories named mmlu:subject=anatomy,model=openai_gpt2
and mmlu:subject=philosophy,model=openai_gpt2
. Note that the names of these sub-directories is based on the run entries we used earlier, but with /
replaced with _
.
Each output sub-directory will contain several JSON files that were generated during the corresponding run:
run_spec.json
contains theRunSpec
, which specifies the scenario, adapter and metrics for the run.scenario.json
contains a serializedScenario
, which contains the scenario for the run and specifies the instances (i.e. inputs) used.scenario_state.json
contains a serializedScenarioState
, which contains every request to and response from the model.per_instance_stats.json
contains a serialized list ofPerInstanceStats
, which contains the statistics produced for the metrics for each instance (i.e. input).stats.json
contains a serialized list ofPerInstanceStats
, which contains the statistics produced for the metrics, aggregated across all instances (i.e. inputs).
Using helm-summarize
The helm-summarize
reads the output files of helm-run
and computes aggregate statistics across runs. Run the following:
helm-summarize --suite my-suite
This reads the pre-existing files in benchmark_output/runs/my-suite/
that were written by helm-run
previously, and writes the following new files back to benchmark_output/runs/my-suite/
:
summary.json
contains a serializedExecutiveSummary
with a date and suite name.run_specs.json
contains the run entries for all the runs.runs.json
contains serialized list ofRun
, which contains the run path, run spec and adapter spec and statistics for each run.groups.json
contains a serialized list ofTable
, each containing information about groups in a group category.groups_metadata.json
contains a list of all the groups along with a human-readable description and a taxonomy.
Additionally, for each group and group-relavent metric, it will output a pair of files: benchmark_output/runs/my-suite/groups/latex/<group_name>_<metric_name>.tex
and benchmark_output/runs/my-suite/groups/json/<group_name>_<metric_name>.json
. These files contain the statistics for that metric from each run within the group.
Using helm-server
Finally, the helm-server
command launches a web server to visualize the output files of helm-run
and helm-benchmark
. Run:
helm-server --suite my-suite
Open a browser and go to http://localhost:8000/ to view the visualization. You should see a similar view as live website for the paper, but for the data from your benchmark runs. The website has the following sections accessible from the top menu bar:
- Leaderboards contains the leaderboards with aggregate metrics.
- Models contains a list of models and their descriptions
- Scenarios contains a list of scenarios and their descriptions.
- Predictions contains a searchable list of runs.