File size: 19,909 Bytes
5a5a36e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3f45e26
5a5a36e
5989add
 
 
ad8512f
3f45e26
5a5a36e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3cdf958
5a5a36e
4121a2d
 
3f45e26
4121a2d
 
 
 
 
5a5a36e
4121a2d
 
 
 
 
 
95b7a71
 
 
b9cb207
5a5a36e
 
b9cb207
95b7a71
 
5a5a36e
 
 
 
 
 
 
3cdf958
5a5a36e
 
 
3f45e26
5a5a36e
 
 
3cdf958
5a5a36e
 
 
 
 
 
 
 
 
3cdf958
5a5a36e
 
3f45e26
5a5a36e
 
3f45e26
5a5a36e
 
8c85cda
5a5a36e
 
3f45e26
5a5a36e
 
 
 
 
 
3f45e26
 
 
5a5a36e
 
 
 
 
4686e27
8c85cda
5a5a36e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e54d795
5a5a36e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4686e27
8c85cda
 
 
5a5a36e
4686e27
 
 
 
 
5a5a36e
 
4686e27
5a5a36e
 
4686e27
 
5a5a36e
 
 
 
 
12d1200
3cdf958
12d1200
 
 
98d3a41
12d1200
98d3a41
 
 
 
 
 
3f45e26
98d3a41
553dd93
 
 
 
 
 
98d3a41
 
 
 
 
 
 
 
eef68df
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98d3a41
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
eef68df
 
 
5a5a36e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
from src.display.utils import ModelType

TITLE = """<h1 style="text-align:left;float:left; id="space-title"><img style="width: 4rem; height: 4rem; display: inline-block;" src="https://imgur.com/cu4lW7q.png" /> Low-bit Quantized Open LLM Leaderboard</h1>"""

INTRODUCTION_TEXT = """
"""

icons = f"""
- {ModelType.PT.to_str(" : ")} model: new, base models, trained on a given text corpora using masked modelling
- {ModelType.CPT.to_str(" : ")} model: new, base models, continuously trained on further corpus (which may include IFT/chat data) using masked modelling
- {ModelType.FT.to_str(" : ")} model: pretrained models finetuned on more data
- {ModelType.chat.to_str(" : ")} model: chat like fine-tunes, either using IFT (datasets of task instruction), RLHF or DPO (changing the model loss a bit with an added policy), etc
- {ModelType.merges.to_str(" : ")} model: merges or MoErges, models which have been merged or fused without additional fine-tuning. 
"""
LLM_BENCHMARKS_TEXT = f"""
## ABOUT
Quantization is a key technique for making LLMs more accessible and practical for a wide range of applications, especially where computational resources are a limiting factor. While there is no tool to track and compare quantization LLMs with different quantization algorithms, which is 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.

### Introducing V1.0
V1.0 marks the launch of our comprehensive evaluation system for quantized language models. 
This version introduces a standardized platform for submitting and benchmarking models, providing clear insights into their performance across various tasks.

Submit a model for automated evaluation on the CPU/GPU cluster on the "Submit" page!
The leaderboard's backend runs the great [Eleuther AI Language Model Evaluation Harness](https://github.com/EleutherAI/lm-evaluation-harness) - read more details below!

### Tasks 
📈 We evaluate models on 10 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.

- <a href="https://arxiv.org/abs/1803.05457" target="_blank">  AI2 Reasoning Challenge </a> (0-shot) - a set of grade-school science questions, a Challenge Set of 2,590 “hard” questions (those that both a retrieval and a co-occurrence method fail to answer correctly).
- <a href="https://arxiv.org/abs/1803.05457" target="_blank">  AI2 Reasoning Easy </a> (0-shot) - a set of grade-school science questions, an Easy Set of 5,197 questions.
- <a href="https://arxiv.org/abs/1905.07830" target="_blank">  HellaSwag </a> (0-shot) - a test of commonsense inference, which is easy for humans (~95%) but challenging for SOTA models.
- <a href="https://arxiv.org/abs/2009.03300" target="_blank">  MMLU </a>  (0-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.
- <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 is technically a 6-shot task in the Harness because each example is prepended with 6 Q/A pairs, even in the 0-shot setting.
- <a href="https://arxiv.org/abs/1907.10641" target="_blank">  Winogrande </a> (0-shot) - an adversarial and difficult Winograd benchmark at scale, for commonsense reasoning.
- <a href="https://arxiv.org/abs/1911.11641" target="_blank">  PIQA </a> (0-shot) - a physical commonsense reasoning and a corresponding benchmark dataset.
- <a href="https://arxiv.org/pdf/1606.06031.pdf" target="_blank">  Lambada_Openai </a> (0-shot) - a dataset to evaluate the capabilities of computational models for text understanding by means of a word prediction task.
- <a href="https://arxiv.org/abs/1809.02789" target="_blank">  OpenBookQA </a> (0-shot) - a question-answering dataset modeled after open book exams for assessing human understanding of a subject. 
- <a href="https://arxiv.org/pdf/1905.10044" target="_blank"> BoolQ </a> (0-shot) - a QA task where each example consists of a short passage and a yes/no question about the passage.

For all these evaluations, a higher score is a better score.
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.

---------------------------

## RERODUCIBILITY
To reproduce our results, here is the commands you can run, using [v0.4.2](https://github.com/EleutherAI/lm-evaluation-harness/tree/v0.4.2) of the Eleuther AI Harness:
```
python main.py --model=hf-causal-experimental
    --model_args="pretrained=<your_model>,use_accelerate=True,revision=<your_model_revision>,dtype=<compute_dtype>"
    --tasks=<task_list>
    --num_fewshot=<n_few_shot>
    --batch_size=1
    --output_path=<output_path>
```

**Note:** 
- We run `llama.cpp` series models on Xeon CPU and others on NVidia GPU. 
- If model paramerters > 7B, we use `--batch_size 4`. If model parameters < 7B, we use `--batch_size 2`. And we set `--batch_size 1` for llama.cpp. You can expect results to vary slightly for different batch sizes because of padding.


### The tasks and few shots parameters are:
- ARC-C: 0-shot, *arc_challenge* (`acc`)
- ARC-E: 0-shot, *arc_easy* (`acc`)
- HellaSwag: 0-shot, *hellaswag* (`acc`)
- TruthfulQA(Truthfulqa_mc1): 0-shot, *truthfulqa_mc1* (`acc`)
- MMLU: 0-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`)
- Winogrande: 0-shot, *winogrande* (`acc`)
- Lambada(Lambada_Openai): 0-shot, *lambada_openai* (`acc`)
- PIQA: 0-shot, *piqa* (`acc`)
- OpenBookQA: 0-shot, *openbookqa* (`acc`)
- BoolQ: 0-shot, *boolq* (`acc`)

Side note on the baseline scores: 
- for log-likelihood evaluation, we select the random baseline

---------------------------

## RESOURCES

### Quantization
To get more information about quantization, see:
- neural-compressor: [intel/neural-compressor](https://github.com/intel/neural-compressor/tree/master)
- 4 bits: [blog post](https://huggingface.co/blog/4bit-transformers-bitsandbytes), [paper](https://arxiv.org/abs/2305.14314)

### Other cool leaderboards:
- [Open LLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard)
- [LLM safety](https://huggingface.co/spaces/AI-Secure/llm-trustworthy-leaderboard)
- [LLM performance](https://huggingface.co/spaces/optimum/llm-perf-leaderboard)

"""

FAQ_TEXT = """

## SUBMISSIONS
My model requires `trust_remote_code=True`, can I submit it?
- *Yes, the leaderboard supports the model with `trust_remote_code=True` well.*

How can I follow when my model is launched?
- *You can look for its request file [here](https://huggingface.co/datasets/Intel/ld_requests) and follow the status evolution, or directly in the queues above the submit form.*

My model disappeared from all the queues, what happened?
- *A model disappearing from all the queues usually means that there has been a failure. You can check if that is the case by looking for your model [here](https://huggingface.co/datasets/Intel/ld_requests).*

What causes an evaluation failure?
- *Most of the failures we get come from problems in the submissions (corrupted files, config problems, wrong parameters selected for eval ...), and some quantized models can't be evaluated with some issues (runtime error which requires manual checking (like [TheBloke/Mistral-7B-Instruct-v0.2-GPTQ](https://huggingface.co/TheBloke/Mistral-7B-Instruct-v0.2-GPTQ)...). So we'll be grateful if you first make sure you have followed the steps in `About` and if still not resolved, please push your questions to the [Community Pages](https://huggingface.co/spaces/Intel/low_bit_open_llm_leaderboard/discussions). However, from time to time, we have failures on our side (hardware/node failures, problem with an update of our backend, connectivity problem ending up in the results not being saved, ...).*

How can I report an evaluation failure?
- *As we store the logs for all models, feel free to create an issue, **where you link to the requests file of your model** (look for it [here](https://huggingface.co/datasets/Intel/ld_requests)), so we can investigate! If the model failed due to a problem on our side, we'll relaunch it right away!* 
*Note: Please do not re-upload your model under a different name, it will not help*

---------------------------

## RESULTS
What kind of information can I find?
- *Let's imagine you are interested in the Solar-10.7B results. You have access to 2 different information categories:*
      - *The [request file](https://huggingface.co/datasets/Intel/ld_requests/blob/main/TheBloke/SOLAR-10.7B-Instruct-v1.0-GPTQ_eval_request_False_GPTQ_4bit_int4_float16.json): it gives you information about the status of the evaluation*
      - *The [aggregated results folder](https://huggingface.co/datasets/Intel/ld_results/blob/main/TheBloke/): it gives you aggregated scores, per experimental run*


Why do models appear several times in the leaderboard? 
- *We run evaluations with user selected precision and model commit. Sometimes, users submit specific models at different commits and at different precisions (for example, in float16 and 4bit to see how quantization affects performance). You should be able to verify this by displaying the `precision` and `model sha` columns in the display. If, however, you see models appearing several time with the same precision and hash commit, this is not normal.*

Why are the llama series models marked with *?
- *We are evaluating llama.cpp models with `lm-eval` [code](https://github.com/EleutherAI/lm-evaluation-harness/blob/main/lm_eval/models/gguf.py) , and we find that some tasks results are abnormal even though we make some modifications. So we mark them and will verify them further.*

---------------------------

## EDITING SUBMISSIONS
I upgraded my model and want to re-submit, how can I do that?
- *Please open an issue with the precise name of your model, and we'll remove your model from the leaderboard so you can resubmit. You can also resubmit directly with the new commit hash!* 

---------------------------

## OTHER

I have an issue about accessing the leaderboard through the Gradio API
- *Since this is not the recommended way to access the leaderboard, we won't provide support for this, but you can look at tools provided by the community for inspiration!*

I have another problem, help!
- *Please open an issue in the discussion tab, and we'll do our best to help you in a timely manner :) *
"""


EVALUATION_QUEUE_TEXT = f"""
# Evaluation Queue for the Low-bit Quantized Open LLM Leaderboard

Models added here will be automatically evaluated on the cluster.

## Don't forget to read the FAQ and the About tabs for more information!

## Steps before submitting a model

### 1) Make sure you can load your model and tokenizer using AutoClasses:
```python
from transformers import AutoConfig, AutoModel, AutoTokenizer
config = AutoConfig.from_pretrained("your model name", revision=revision)
model = AutoModel.from_pretrained("your model name", revision=revision)
tokenizer = AutoTokenizer.from_pretrained("your model name", revision=revision)
```
If this step fails, follow the error messages to debug your model before submitting it. It's likely your model has been improperly uploaded.

Note: make sure your model is public!
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!

### 2) Confirm your model weights format!
Your model weights format should be [safetensors](https://huggingface.co/docs/safetensors/index), because it's a new format for storing weights which is safer and faster to load and use. And It will help us to compute the number of parameters and the size of memory of your model to the Extended Viewer easily!

If your model is llama.cpp, it should be end of `Q4_0.gguf` because we only support this format currently.

### 3) Confirm your model config!
If your model is one of the following quantization types: `AutoRound`, `GPTQ`, `AWQ`, `bitsandbytes`, there should be a `quantization_config` in your model config, like [this](https://huggingface.co/TheBloke/SOLAR-10.7B-Instruct-v1.0-GPTQ/blob/main/config.json#L28).


### 4) Make sure your model has an open license!
This is a leaderboard for Open LLMs, and we'd love for as many people as possible to know they can use your model 🤗

### 5) Fill up your model card
When we add extra information about models to the leaderboard, it will be automatically taken from the model card

### 6) Select the compute dtype
The compute dtype will pass to `lm-eval` for the inference. Currently, we support `float16/bfloat16/float32` for `AutoRound`, `GPTQ`, `AWQ`, `bitsandbytes` and support `int8` for `llama.cpp`. The defaule value is `float16`.

"""

CITATION_BUTTON_LABEL = "Copy the following snippet to cite these results"
CITATION_BUTTON_TEXT = r"""
@software{auto-round,
  title        = AutoRound,
  publisher    = {Intel},
  url          = {https://github.com/intel/auto-round}
}
@misc{
      Cheng2023Optimize,
      title={Optimize Weight Rounding via Signed Gradient Descent for the Quantization of LLMs},
      author={Wenhua Cheng, Weiwei Zhang, Haihao Shen, Yiyang Cai, Xin He, Kaokao Lv},
      year={2023},
      url={https://arxiv.org/abs/2309.05516}
}
@software{neural-compressor,
  title        = Intel® Neural Compressor,
  publisher    = {Intel},
  url          = {https://github.com/intel/neural-compressor/}
}
@software{intel-extension-for-transformers,
  title        = Intel® Extension for Transformers,
  publisher    = {Intel},
  url          = {https://github.com/intel/intel-extension-for-transformers}
}
@misc{open-llm-leaderboard,
  author = {Edward Beeching and Clémentine Fourrier and Nathan Habib and Sheon Han and Nathan Lambert and Nazneen Rajani and Omar Sanseviero and Lewis Tunstall and Thomas Wolf},
  title = {Open LLM Leaderboard},
  year = {2023},
  publisher = {Hugging Face},
  howpublished = "\url{https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard}"
}
@software{eval-harness,
  author       = {Gao, Leo and
                  Tow, Jonathan and
                  Biderman, Stella and
                  Black, Sid and
                  DiPofi, Anthony and
                  Foster, Charles and
                  Golding, Laurence and
                  Hsu, Jeffrey and
                  McDonell, Kyle and
                  Muennighoff, Niklas and
                  Phang, Jason and
                  Reynolds, Laria and
                  Tang, Eric and
                  Thite, Anish and
                  Wang, Ben and
                  Wang, Kevin and
                  Zou, Andy},
  title        = {A framework for few-shot language model evaluation},
  month        = sep,
  year         = 2021,
  publisher    = {Zenodo},
  version      = {v0.0.1},
  doi          = {10.5281/zenodo.5371628},
  url          = {https://doi.org/10.5281/zenodo.5371628}
}
@misc{clark2018think,
      title={Think you have Solved Question Answering? Try ARC, the AI2 Reasoning Challenge},
      author={Peter Clark and Isaac Cowhey and Oren Etzioni and Tushar Khot and Ashish Sabharwal and Carissa Schoenick and Oyvind Tafjord},
      year={2018},
      eprint={1803.05457},
      archivePrefix={arXiv},
      primaryClass={cs.AI}
}
@misc{zellers2019hellaswag,
      title={HellaSwag: Can a Machine Really Finish Your Sentence?},
      author={Rowan Zellers and Ari Holtzman and Yonatan Bisk and Ali Farhadi and Yejin Choi},
      year={2019},
      eprint={1905.07830},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}
@misc{hendrycks2021measuring,
      title={Measuring Massive Multitask Language Understanding},
      author={Dan Hendrycks and Collin Burns and Steven Basart and Andy Zou and Mantas Mazeika and Dawn Song and Jacob Steinhardt},
      year={2021},
      eprint={2009.03300},
      archivePrefix={arXiv},
      primaryClass={cs.CY}
}
@misc{lin2022truthfulqa,
      title={TruthfulQA: Measuring How Models Mimic Human Falsehoods},
      author={Stephanie Lin and Jacob Hilton and Owain Evans},
      year={2022},
      eprint={2109.07958},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}
@misc{DBLP:journals/corr/abs-1907-10641,
      title={{WINOGRANDE:} An Adversarial Winograd Schema Challenge at Scale},
      author={Keisuke Sakaguchi and Ronan Le Bras and Chandra Bhagavatula and Yejin Choi},
      year={2019},
      eprint={1907.10641},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}
@misc{Bisk2019PIQA,
      title={PIQA: Reasoning about Physical Commonsense in Natural Language},
      author={Yonatan Bisk, Rowan Zellers, Ronan Le Bras, Jianfeng Gao, Yejin Choi},
      year={2019},
      eprint={1911.11641},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}
@misc{Paperno2016LAMBADA,
      title={The LAMBADA dataset: Word prediction requiring a broad discourse context},
      author={Denis Paperno, Germán Kruszewski, Angeliki Lazaridou, Quan Ngoc Pham, Raffaella Bernardi, Sandro Pezzelle, Marco Baroni, Gemma Boleda, Raquel Fernández},
      year={2016},
      eprint={1606.06031},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}
@misc{Mihaylov2018OpenBookQA,
      title={Can a Suit of Armor Conduct Electricity? A New Dataset for Open Book Question Answering},
      author={Todor Mihaylov, Peter Clark, Tushar Khot, Ashish Sabharwal},
      year={2018},
      eprint={1809.02789},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}
@misc{Clark2019BoolQ,
      title={BoolQ: Exploring the Surprising Difficulty of Natural Yes/No Questions},
      author={Christopher Clark, Kenton Lee, Ming-Wei Chang, Tom Kwiatkowski, Michael Collins, Kristina Toutanova},
      year={2019},
      eprint={1905.10044},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}
"""