Sean Cho commited on
Commit
7b9fe5e
1 Parent(s): 4f0083e

leaderboard

Browse files
src/assets/css_html_js.py ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ custom_css = """
2
+ #changelog-text {
3
+ font-size: 16px !important;
4
+ }
5
+
6
+ #changelog-text h2 {
7
+ font-size: 18px !important;
8
+ }
9
+
10
+ .markdown-text {
11
+ font-size: 16px !important;
12
+ }
13
+
14
+ #models-to-add-text {
15
+ font-size: 18px !important;
16
+ }
17
+
18
+ #citation-button span {
19
+ font-size: 16px !important;
20
+ }
21
+
22
+ #citation-button textarea {
23
+ font-size: 16px !important;
24
+ }
25
+
26
+ #citation-button > label > button {
27
+ margin: 6px;
28
+ transform: scale(1.3);
29
+ }
30
+
31
+ #leaderboard-table {
32
+ margin-top: 15px
33
+ }
34
+
35
+ #leaderboard-table-lite {
36
+ margin-top: 15px
37
+ }
38
+
39
+ #search-bar-table-box > div:first-child {
40
+ background: none;
41
+ border: none;
42
+ }
43
+
44
+ #search-bar {
45
+ padding: 0px;
46
+ }
47
+
48
+ /* Hides the final AutoEvalColumn */
49
+ #llm-benchmark-tab-table table td:last-child,
50
+ #llm-benchmark-tab-table table th:last-child {
51
+ display: none;
52
+ }
53
+
54
+ /* Limit the width of the first AutoEvalColumn so that names don't expand too much */
55
+ table td:first-child,
56
+ table th:first-child {
57
+ max-width: 400px;
58
+ overflow: auto;
59
+ white-space: nowrap;
60
+ }
61
+
62
+ .tab-buttons button {
63
+ font-size: 20px;
64
+ }
65
+
66
+ #scale-logo {
67
+ border-style: none !important;
68
+ box-shadow: none;
69
+ display: block;
70
+ margin-left: auto;
71
+ margin-right: auto;
72
+ max-width: 600px;
73
+ }
74
+
75
+ #scale-logo .download {
76
+ display: none;
77
+ }
78
+ """
79
+
80
+ get_window_url_params = """
81
+ function(url_params) {
82
+ const params = new URLSearchParams(window.location.search);
83
+ url_params = Object.fromEntries(params);
84
+ return url_params;
85
+ }
86
+ """
src/assets/hardcoded_evals.py ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from src.utils_display import AutoEvalColumn, model_hyperlink
2
+
3
+ gpt4_values = {
4
+ AutoEvalColumn.model.name: model_hyperlink("https://arxiv.org/abs/2303.08774", "gpt4"),
5
+ AutoEvalColumn.revision.name: "tech report",
6
+ AutoEvalColumn.precision.name: None,
7
+ AutoEvalColumn.average.name: 84.3,
8
+ AutoEvalColumn.arc.name: 96.3,
9
+ AutoEvalColumn.hellaswag.name: 95.3,
10
+ AutoEvalColumn.mmlu.name: 86.4,
11
+ AutoEvalColumn.truthfulqa.name: 59.0,
12
+ AutoEvalColumn.dummy.name: "GPT-4",
13
+ AutoEvalColumn.model_type.name: "",
14
+ }
15
+
16
+ gpt35_values = {
17
+ AutoEvalColumn.model.name: model_hyperlink("https://arxiv.org/abs/2303.08774", "gpt3.5"),
18
+ AutoEvalColumn.revision.name: "tech report",
19
+ AutoEvalColumn.precision.name: None,
20
+ AutoEvalColumn.average.name: 71.9,
21
+ AutoEvalColumn.arc.name: 85.2,
22
+ AutoEvalColumn.hellaswag.name: 85.5,
23
+ AutoEvalColumn.mmlu.name: 70.0,
24
+ AutoEvalColumn.truthfulqa.name: 47.0,
25
+ AutoEvalColumn.dummy.name: "GPT-3.5",
26
+ AutoEvalColumn.model_type.name: "",
27
+ }
28
+
29
+ baseline = {
30
+ AutoEvalColumn.model.name: "<p>Baseline</p>",
31
+ AutoEvalColumn.revision.name: "N/A",
32
+ AutoEvalColumn.precision.name: None,
33
+ AutoEvalColumn.average.name: 25.0,
34
+ AutoEvalColumn.arc.name: 25.0,
35
+ AutoEvalColumn.hellaswag.name: 25.0,
36
+ AutoEvalColumn.mmlu.name: 25.0,
37
+ AutoEvalColumn.truthfulqa.name: 25.0,
38
+ AutoEvalColumn.dummy.name: "baseline",
39
+ AutoEvalColumn.model_type.name: "",
40
+ }
41
+
src/assets/text_content.py ADDED
@@ -0,0 +1,223 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from ..auto_leaderboard.model_metadata_type import ModelType
2
+
3
+ CHANGELOG_TEXT = f"""
4
+ ## [2023-06-19]
5
+ - Added model type column
6
+ - Hid revision and 8bit columns since all models are the same atm
7
+
8
+ ## [2023-06-16]
9
+ - Refactored code base
10
+ - Added new columns: number of parameters, hub likes, license
11
+
12
+ ## [2023-06-13]
13
+ - Adjust description for TruthfulQA
14
+
15
+ ## [2023-06-12]
16
+ - Add Human & GPT-4 Evaluations
17
+
18
+ ## [2023-06-05]
19
+ - Increase concurrent thread count to 40
20
+ - Search models on ENTER
21
+
22
+ ## [2023-06-02]
23
+ - Add a typeahead search bar
24
+ - Use webhooks to automatically spawn a new Space when someone opens a PR
25
+ - Start recording `submitted_time` for eval requests
26
+ - Limit AutoEvalColumn max-width
27
+
28
+ ## [2023-05-30]
29
+ - Add a citation button
30
+ - Simplify Gradio layout
31
+
32
+ ## [2023-05-29]
33
+ - Auto-restart every hour for the latest results
34
+ - Sync with the internal version (minor style changes)
35
+
36
+ ## [2023-05-24]
37
+ - Add a baseline that has 25.0 for all values
38
+ - Add CHANGELOG
39
+
40
+ ## [2023-05-23]
41
+ - Fix a CSS issue that made the leaderboard hard to read in dark mode
42
+
43
+ ## [2023-05-22]
44
+ - Display a success/error message after submitting evaluation requests
45
+ - Reject duplicate submission
46
+ - Do not display results that have incomplete results
47
+ - Display different queues for jobs that are RUNNING, PENDING, FINISHED status
48
+
49
+ ## [2023-05-15]
50
+ - Fix a typo: from "TruthQA" to "QA"
51
+
52
+ ## [2023-05-10]
53
+ - Fix a bug that prevented auto-refresh
54
+
55
+ ## [2023-05-10]
56
+ - Release the leaderboard to public
57
+ """
58
+
59
+ TITLE = """<h1 align="center" id="space-title">🤗 Open LLM Leaderboard</h1>"""
60
+
61
+ INTRODUCTION_TEXT = f"""
62
+ 📐 The 🤗 Open LLM Leaderboard aims to track, rank and evaluate open LLMs and chatbots.
63
+
64
+ 🤗 Submit a model for automated evaluation on the 🤗 GPU cluster on the "Submit" page!
65
+
66
+ The leaderboard's backend runs the great [Eleuther AI Language Model Evaluation Harness](https://github.com/EleutherAI/lm-evaluation-harness) to compute numbers. Read more details and reproducibility on the "About" page!
67
+
68
+ Other cool benchmarks for LLMs are developed at HuggingFace: 🙋🤖 [human and GPT4 evals](https://huggingface.co/spaces/HuggingFaceH4/human_eval_llm_leaderboard), 🖥️ [performance benchmarks](https://huggingface.co/spaces/optimum/llm-perf-leaderboard)
69
+
70
+ And also in other labs, check out the [AlpacaEval Leaderboard](https://tatsu-lab.github.io/alpaca_eval/) and [MT Bench](https://huggingface.co/spaces/lmsys/chatbot-arena-leaderboard) among other great ressources.
71
+ """
72
+
73
+ LLM_BENCHMARKS_TEXT = f"""
74
+ # Context
75
+ With the plethora of large language models (LLMs) and chatbots being released week upon week, often with grandiose claims of their performance, it can be hard to filter out the genuine progress that is being made by the open-source community and which model is the current state of the art.
76
+
77
+ ## Icons
78
+ {ModelType.PT.to_str(" : ")} model
79
+ {ModelType.FT.to_str(" : ")} model
80
+ {ModelType.IFT.to_str(" : ")} model
81
+ {ModelType.RL.to_str(" : ")} model
82
+ If there is no icon, we have not uploaded the information on the model yet, feel free to open an issue with the model information!
83
+
84
+ ## How it works
85
+
86
+ 📈 We evaluate models on 4 key benchmarks using the <a href="https://github.com/EleutherAI/lm-evaluation-harness" target="_blank"> Eleuther AI Language Model Evaluation Harness </a>, a unified framework to test generative language models on a large number of different evaluation tasks.
87
+
88
+ - <a href="https://arxiv.org/abs/1803.05457" target="_blank"> AI2 Reasoning Challenge </a> (25-shot) - a set of grade-school science questions.
89
+ - <a href="https://arxiv.org/abs/1905.07830" target="_blank"> HellaSwag </a> (10-shot) - a test of commonsense inference, which is easy for humans (~95%) but challenging for SOTA models.
90
+ - <a href="https://arxiv.org/abs/2009.03300" target="_blank"> MMLU </a> (5-shot) - a test to measure a text model's multitask accuracy. The test covers 57 tasks including elementary mathematics, US history, computer science, law, and more.
91
+ - <a href="https://arxiv.org/abs/2109.07958" target="_blank"> TruthfulQA </a> (0-shot) - a test to measure a model’s propensity to reproduce falsehoods commonly found online. Note: TruthfulQA in the Harness is actually a minima a 6-shots task, as it is prepended by 6 examples systematically, even when launched using 0 for the number of few-shot examples.
92
+
93
+ For all these evaluations, a higher score is a better score.
94
+ We chose these benchmarks as they test a variety of reasoning and general knowledge across a wide variety of fields in 0-shot and few-shot settings.
95
+
96
+ ## Details and logs
97
+ You can find:
98
+ - detailed numerical results in the `results` Hugging Face dataset: https://huggingface.co/datasets/open-llm-leaderboard/results
99
+ - details on the input/outputs for the models in the `details` Hugging Face dataset: https://huggingface.co/datasets/open-llm-leaderboard/details
100
+ - community queries and running status in the `requests` Hugging Face dataset: https://huggingface.co/datasets/open-llm-leaderboard/requests
101
+
102
+ ## Reproducibility
103
+ To reproduce our results, here is the commands you can run, using [this version](https://github.com/EleutherAI/lm-evaluation-harness/tree/b281b0921b636bc36ad05c0b0b0763bd6dd43463) of the Eleuther AI Harness:
104
+ `python main.py --model=hf-causal --model_args="pretrained=<your_model>,use_accelerate=True,revision=<your_model_revision>"`
105
+ ` --tasks=<task_list> --num_fewshot=<n_few_shot> --batch_size=2 --output_path=<output_path>`
106
+
107
+ The total batch size we get for models which fit on one A100 node is 16 (8 GPUs * 2). If you don't use parallelism, adapt your batch size to fit.
108
+ *You can expect results to vary slightly for different batch sizes because of padding.*
109
+
110
+ The tasks and few shots parameters are:
111
+ - ARC: 25-shot, *arc-challenge* (`acc_norm`)
112
+ - HellaSwag: 10-shot, *hellaswag* (`acc_norm`)
113
+ - TruthfulQA: 0-shot, *truthfulqa-mc* (`mc2`)
114
+ - MMLU: 5-shot, *hendrycksTest-abstract_algebra,hendrycksTest-anatomy,hendrycksTest-astronomy,hendrycksTest-business_ethics,hendrycksTest-clinical_knowledge,hendrycksTest-college_biology,hendrycksTest-college_chemistry,hendrycksTest-college_computer_science,hendrycksTest-college_mathematics,hendrycksTest-college_medicine,hendrycksTest-college_physics,hendrycksTest-computer_security,hendrycksTest-conceptual_physics,hendrycksTest-econometrics,hendrycksTest-electrical_engineering,hendrycksTest-elementary_mathematics,hendrycksTest-formal_logic,hendrycksTest-global_facts,hendrycksTest-high_school_biology,hendrycksTest-high_school_chemistry,hendrycksTest-high_school_computer_science,hendrycksTest-high_school_european_history,hendrycksTest-high_school_geography,hendrycksTest-high_school_government_and_politics,hendrycksTest-high_school_macroeconomics,hendrycksTest-high_school_mathematics,hendrycksTest-high_school_microeconomics,hendrycksTest-high_school_physics,hendrycksTest-high_school_psychology,hendrycksTest-high_school_statistics,hendrycksTest-high_school_us_history,hendrycksTest-high_school_world_history,hendrycksTest-human_aging,hendrycksTest-human_sexuality,hendrycksTest-international_law,hendrycksTest-jurisprudence,hendrycksTest-logical_fallacies,hendrycksTest-machine_learning,hendrycksTest-management,hendrycksTest-marketing,hendrycksTest-medical_genetics,hendrycksTest-miscellaneous,hendrycksTest-moral_disputes,hendrycksTest-moral_scenarios,hendrycksTest-nutrition,hendrycksTest-philosophy,hendrycksTest-prehistory,hendrycksTest-professional_accounting,hendrycksTest-professional_law,hendrycksTest-professional_medicine,hendrycksTest-professional_psychology,hendrycksTest-public_relations,hendrycksTest-security_studies,hendrycksTest-sociology,hendrycksTest-us_foreign_policy,hendrycksTest-virology,hendrycksTest-world_religions* (average of all the results `acc`)
115
+
116
+ ## Quantization
117
+ To get more information about quantization, see:
118
+ - 8 bits: [blog post](https://huggingface.co/blog/hf-bitsandbytes-integration), [paper](https://arxiv.org/abs/2208.07339)
119
+ - 4 bits: [blog post](https://huggingface.co/blog/4bit-transformers-bitsandbytes), [paper](https://arxiv.org/abs/2305.14314)
120
+
121
+ """
122
+
123
+ EVALUATION_QUEUE_TEXT = f"""
124
+ # Evaluation Queue for the 🤗 Open LLM Leaderboard
125
+
126
+ Models added here will be automatically evaluated on the 🤗 cluster.
127
+
128
+ ## Some good practices before submitting a model
129
+
130
+ ### 1) Make sure you can load your model and tokenizer using AutoClasses:
131
+ ```python
132
+ from transformers import AutoConfig, AutoModel, AutoTokenizer
133
+ config = AutoConfig.from_pretrained("your model name", revision=revision)
134
+ model = AutoModel.from_pretrained("your model name", revision=revision)
135
+ tokenizer = AutoTokenizer.from_pretrained("your model name", revision=revision)
136
+ ```
137
+ If this step fails, follow the error messages to debug your model before submitting it. It's likely your model has been improperly uploaded.
138
+
139
+ Note: make sure your model is public!
140
+ Note: if your model needs `use_remote_code=True`, we do not support this option yet but we are working on adding it, stay posted!
141
+
142
+ ### 2) Convert your model weights to [safetensors](https://huggingface.co/docs/safetensors/index)
143
+ It's a new format for storing weights which is safer and faster to load and use. It will also allow us to add the number of parameters of your model to the `Extended Viewer`!
144
+
145
+ ### 3) Make sure your model has an open license!
146
+ This is a leaderboard for Open LLMs, and we'd love for as many people as possible to know they can use your model 🤗
147
+
148
+ ### 4) Fill up your model card
149
+ When we add extra information about models to the leaderboard, it will be automatically taken from the model card
150
+
151
+ ## In case of model failure
152
+ If your model is displayed in the `FAILED` category, its execution stopped.
153
+ Make sure you have followed the above steps first.
154
+ If everything is done, check you can launch the EleutherAIHarness on your model locally, using the above command without modifications (you can add `--limit` to limit the number of examples per task).
155
+ """
156
+
157
+ CITATION_BUTTON_LABEL = "Copy the following snippet to cite these results"
158
+ CITATION_BUTTON_TEXT = r"""
159
+ @misc{open-llm-leaderboard,
160
+ author = {Edward Beeching, Clémentine Fourrier, Nathan Habib, Sheon Han, Nathan Lambert, Nazneen Rajani, Omar Sanseviero, Lewis Tunstall, Thomas Wolf},
161
+ title = {Open LLM Leaderboard},
162
+ year = {2023},
163
+ publisher = {Hugging Face},
164
+ howpublished = "\url{https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard}"
165
+ }
166
+ @software{eval-harness,
167
+ author = {Gao, Leo and
168
+ Tow, Jonathan and
169
+ Biderman, Stella and
170
+ Black, Sid and
171
+ DiPofi, Anthony and
172
+ Foster, Charles and
173
+ Golding, Laurence and
174
+ Hsu, Jeffrey and
175
+ McDonell, Kyle and
176
+ Muennighoff, Niklas and
177
+ Phang, Jason and
178
+ Reynolds, Laria and
179
+ Tang, Eric and
180
+ Thite, Anish and
181
+ Wang, Ben and
182
+ Wang, Kevin and
183
+ Zou, Andy},
184
+ title = {A framework for few-shot language model evaluation},
185
+ month = sep,
186
+ year = 2021,
187
+ publisher = {Zenodo},
188
+ version = {v0.0.1},
189
+ doi = {10.5281/zenodo.5371628},
190
+ url = {https://doi.org/10.5281/zenodo.5371628}
191
+ }
192
+ @misc{clark2018think,
193
+ title={Think you have Solved Question Answering? Try ARC, the AI2 Reasoning Challenge},
194
+ author={Peter Clark and Isaac Cowhey and Oren Etzioni and Tushar Khot and Ashish Sabharwal and Carissa Schoenick and Oyvind Tafjord},
195
+ year={2018},
196
+ eprint={1803.05457},
197
+ archivePrefix={arXiv},
198
+ primaryClass={cs.AI}
199
+ }
200
+ @misc{zellers2019hellaswag,
201
+ title={HellaSwag: Can a Machine Really Finish Your Sentence?},
202
+ author={Rowan Zellers and Ari Holtzman and Yonatan Bisk and Ali Farhadi and Yejin Choi},
203
+ year={2019},
204
+ eprint={1905.07830},
205
+ archivePrefix={arXiv},
206
+ primaryClass={cs.CL}
207
+ }
208
+ @misc{hendrycks2021measuring,
209
+ title={Measuring Massive Multitask Language Understanding},
210
+ author={Dan Hendrycks and Collin Burns and Steven Basart and Andy Zou and Mantas Mazeika and Dawn Song and Jacob Steinhardt},
211
+ year={2021},
212
+ eprint={2009.03300},
213
+ archivePrefix={arXiv},
214
+ primaryClass={cs.CY}
215
+ }
216
+ @misc{lin2022truthfulqa,
217
+ title={TruthfulQA: Measuring How Models Mimic Human Falsehoods},
218
+ author={Stephanie Lin and Jacob Hilton and Owain Evans},
219
+ year={2022},
220
+ eprint={2109.07958},
221
+ archivePrefix={arXiv},
222
+ primaryClass={cs.CL}
223
+ }"""