eaddario commited on
Commit
71f46be
·
verified ·
1 Parent(s): 078884d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +165 -49
README.md CHANGED
@@ -11,81 +11,197 @@ pipeline_tag: text-generation
11
  tags:
12
  - gguf
13
  - quant
 
14
  ---
15
 
16
- # GGUF and "i-matrix" quantized versions of cognitivecomputations/Dolphin3.0-R1-Mistral-24B
17
 
18
- Using [LLaMA C++](https://github.com/ggerganov/llama.cpp) release [b4722](https://github.com/ggml-org/llama.cpp/releases/tag/b4722) for quantization.
19
 
20
- Original model: [cognitivecomputations/Dolphin3.0-R1-Mistral-24B](https://huggingface.co/cognitivecomputations/Dolphin3.0-R1-Mistral-24B)
21
 
22
- From the model creator:
23
 
24
- > Dolphin 3.0 R1 is the next generation of the Dolphin series of instruct-tuned models. Designed to be the ultimate general purpose local model, enabling coding, math, agentic, function calling, and general use cases. The R1 version has been trained for 3 epochs to reason using 800k reasoning traces from the Dolphin-R1 dataset.
25
- >
26
- > Dolphin aims to be an **uncensored** general purpose reasoning instruct model, similar to the models behind ChatGPT, Claude, Gemini. But these models present problems for businesses seeking to include AI in their products.
27
- >
28
- > - They maintain control of the system prompt, deprecating and changing things as they wish, often causing software to break.
29
- > - They maintain control of the model versions, sometimes changing things silently, or deprecating older models that your business relies on.
30
- > - They maintain control of the alignment, and in particular the alignment is one-size-fits all, not tailored to the application.
31
- > - They can see all your queries and they can potentially use that data in ways you wouldn't want. Dolphin, in contrast, is steerable and gives control to the system owner. You set the system prompt. You decide the alignment. You have control of your data. Dolphin does not impose its ethics or guidelines on you. You are the one who decides the guidelines.
32
- > - Dolphin belongs to YOU, it is your tool, an extension of your will. Just as you are personally responsible for what you do with a knife, gun, fire, car, or the internet, you are the creator and originator of any content you generate with Dolphin.
 
 
 
33
 
34
  From Eric Hartford's, the creator of the Dolphin model series, [Uncensored Models](https://erichartford.com/uncensored-models):
35
 
36
  > Most of these models (for example, Alpaca, Vicuna, WizardLM, MPT-7B-Chat, Wizard-Vicuna, GPT4-X-Vicuna) have some sort of embedded alignment. For general purposes, this is a good thing. This is what stops the model from doing bad things, like teaching you how to cook meth and make bombs. But what is the nature of this alignment? And, why is it so?
37
- >
38
  > The reason these models are aligned is that they are trained with data that was generated by ChatGPT, which itself is aligned by an alignment team at OpenAI. As it is a black box, we don't know all the reasons for the decisions that were made, but we can observe it generally is aligned with American popular culture, and to obey American law, and with a liberal and progressive political bias.
39
 
40
- All quantized versions were generated using an appropriate imatrix created from datasets available at [eaddario/imatrix-calibration](https://huggingface.co/datasets/eaddario/imatrix-calibration).
41
 
42
- At its core, an Importance Matrix (imatrix) is a table or, more broadly, a structured representation that scores the relative importance of different features or parameters in a machine learning model. It essentially quantifies the "impact" each feature has on a specific outcome, prediction, or relationship being modeled.
43
 
44
- The process to produce the quantized [GGUF](https://huggingface.co/docs/hub/en/gguf) models is roughly as follows:
45
 
46
- 1. Convert the the original model's safetensors into GGUF F16*
47
- 2. Estimate the Perplexity score for the F16 model (base) using [wikitext-2-raw-v1](https://huggingface.co/datasets/Salesforce/wikitext/tree/main/wikitext-2-raw-v1), and record the [logits](https://huggingface.co/eaddario/Dolphin3.0-R1-Mistral-24B-GGUF/tree/main/logits)
48
- 3. Generate the [imatrix](https://huggingface.co/eaddario/Dolphin3.0-R1-Mistral-24B-GGUF/tree/main/imatrix) for each calibration dataset
49
- 4. Create quantized versions of the base model using each imatrix per quant type
50
- 5. Calculate the Perplexity and KL Divergence scores for each quantized model [(scores)](https://huggingface.co/eaddario/Dolphin3.0-R1-Mistral-24B-GGUF/tree/main/scores)
51
- 6. For each quant type, keep the version with the best (usually the lowest) scores
52
 
53
- *[BF16](https://en.wikipedia.org/wiki/Bfloat16_floating-point_format) would be preferred, but Apple's GPUs don't support it yet, and therefore any operations are executed in the CPU, making it unacceptably slow. This is expected to change in the near term but until then, if you are using Apple kit avoid using any models tagged BF16
54
 
55
- # Motivation
 
 
 
 
 
 
 
 
56
 
57
- An area of ongoing personal research is to optimize the inference performance of LLMs when deployed in resource-constrained environments like, for example, commodity hardware, personal desktops/laptops, edge devices, etc.
58
 
59
- The process of [quantization](https://huggingface.co/docs/optimum/en/concept_guides/quantization) reduces the precision of the model's weights, leading to significant reductions in model size, memory needs and computational requirements (a good thing), but this however comes at the expense of a loss in the model's capabilities and accuracy (a bad thing!).
60
 
61
- By producing imatrix optimized quantized models, we can maintain inference efficiency whilst reducing memory size and CPU/GPU processing requirements. This optimization is crucial for deploying LLMs on devices with limited hardware capabilities, such as mobile phones or edge devices, without sacrificing significant accuracy.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
 
63
  # Models
64
 
65
- | Filename | Quant type | Size | Perplexity (μ) | ln(PPL(Q)/PPL(base)) | KL Divergence (μ) | Description |
66
- |-----------------------------------------------------------------------------|------------|--------|---------------------|----------------------|--------------------|--------------------------------------------------------------------------------|
67
- | [Dolphin3.0-R1-Mistral-24B-F16](./Dolphin3.0-R1-Mistral-24B-F16.gguf) | F16 | 47.20G | 23.352232 ±0.220841 | N/A | N/A | 16-bit standard IEEE 754 half-precision floating-point number |
68
- | [Dolphin3.0-R1-Mistral-24B-Q8_0](./Dolphin3.0-R1-Mistral-24B-Q8_0.gguf) | Q8_0 | 25.10G | 23.519878 ±0.223215 | 99.96% | 0.002318 ±0.000013 | Extremely high quality, generally unneeded but max available quant |
69
- | [Dolphin3.0-R1-Mistral-24B-Q6_K](./Dolphin3.0-R1-Mistral-24B-Q6_K.gguf) | Q6_K | 19.30G | 24.415348 ±0.234385 | 99.79% | 0.015503 ±0.000075 | Very high quality, near perfect, *recommended* |
70
- | [Dolphin3.0-R1-Mistral-24B-Q5_K_M](./Dolphin3.0-R1-Mistral-24B-Q5_K_M.gguf) | Q5_K_M | 16.80G | 24.304562 ±0.233045 | 99.74% | 0.019001 ±0.000084 | High quality |
71
- | [Dolphin3.0-R1-Mistral-24B-Q5_K_S](./Dolphin3.0-R1-Mistral-24B-Q5_K_S.gguf) | Q5_K_S | 16.30G | | | | High quality, *recommended* |
72
- | [Dolphin3.0-R1-Mistral-24B-IQ4_NL](./Dolphin3.0-R1-Mistral-24B-IQ4_NL.gguf) | IQ4_NL | 13.50G | 23.491557 ±0.221754 | 99.65% | 0.025519 ±0.000102 | Good quality, new method (super-blocks with 256 weights), *recommended* |
73
- | [Dolphin3.0-R1-Mistral-24B-Q4_K_M](./Dolphin3.0-R1-Mistral-24B-Q4_K_M.gguf) | Q4_K_M | 14.30G | 24.940671 ±0.241913 | 99.60% | 0.030244 ±0.000124 | Good quality, default size for must use cases, *recommended* |
74
- | [Dolphin3.0-R1-Mistral-24B-Q4_K_S](./Dolphin3.0-R1-Mistral-24B-Q4_K_S.gguf) | Q4_K_S | 13.50G | 23.315818 ±0.220552 | 99.50% | 0.037680 ±0.000153 | Good quality, best choice in the Q4 series if RAM is scarce, *recommended* |
75
- | [Dolphin3.0-R1-Mistral-24B-IQ3_M](./Dolphin3.0-R1-Mistral-24B-IQ3_M.gguf) | IQ3_M | 9.90G | 26.172864 ±0.256006 | 99.01% | 0.078326 ��0.000305 | Medium-low quality, new method with decent performance comparable to Q3_K_M |
76
- | [Dolphin3.0-R1-Mistral-24B-IQ3_S](./Dolphin3.0-R1-Mistral-24B-IQ3_S.gguf) | IQ3_S | 9.70G | 26.143038 ±0.254443 | 98.95% | 0.082486 ±0.000324 | Lower quality, new method with decent performance, sligthly better than Q3_K_S |
77
- | [Dolphin3.0-R1-Mistral-24B-Q3_K_L](./Dolphin3.0-R1-Mistral-24B-Q3_K_L.gguf) | Q3_K_L | 12.40G | 24.550639 ±0.235362 | 99.30% | 0.053089 ±0.000213 | Good quality, good choice for low RAM availability, *recommended* |
78
- | [Dolphin3.0-R1-Mistral-24B-Q3_K_M](./Dolphin3.0-R1-Mistral-24B-Q3_K_M.gguf) | Q3_K_M | 11.50G | 24.806925 ±0.237610 | 99.16% | 0.063828 ±0.000254 | Medium-low quality |
79
- | [Dolphin3.0-R1-Mistral-24B-Q3_K_S](./Dolphin3.0-R1-Mistral-24B-Q3_K_S.gguf) | Q3_K_S | 9.7G | 39.396539 ±0.409082 | 94.50% | 0.448856 ±0.001660 | Lower quality but may be usable in certain cases |
80
-
81
- I find that quantizations below Q3/IQ3 are not fit for my purposes and therefore do not usually generate them, but happy to provide other quants on request.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
 
83
  # Metrics used
 
84
 
85
- **[Perplexity](https://huggingface.co/docs/transformers/en/perplexity):** one of the key metrics used in NLP evaluation. It measures the quality of a language model by evaluating how well it predicts the next token given a particular sequence of words. A PPL of **1** indicates an exact match between predicted and actual, whereas values greater than one indicate a degree of "surprise" the generated token differs from the expected.
86
 
87
- **[Kullback–Leibler (KL) Divergence](https://en.wikipedia.org/wiki/Kullback%E2%80%93Leibler_divergence):** a statistical measure of how much a probability distribution differs from another. When quantizing models (or altering the original tensors in any way for that matter), the closest we can preserve the weights' probability distribution to the orignal model the better, thus the closest to **0** the better.
88
 
89
- ## Credits
90
 
91
- A big **Thank You!** to [Colin Kealty](https://huggingface.co/bartowski) for the many contributions and for being one of the best sources of high quality quantized models available in Hugginface, and a really big ***Thank You!*** to [Georgi Gerganov](https://github.com/ggerganov) for his amazing work with **llama.cpp** and the **gguf** file format.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  tags:
12
  - gguf
13
  - quant
14
+ - experimental
15
  ---
16
 
17
+ # Experimental layer-wise quantization of cognitivecomputations/Dolphin3.0-R1-Mistral-24B
18
 
19
+ Using [LLaMA C++][llm] release [b5269][llm-rel] for quantization.
20
 
21
+ Original model: [cognitivecomputations/Dolphin3.0-R1-Mistral-24B][mdl]
22
 
23
+ From the original model creators:
24
 
25
+ > Dolphin 3.0 is the next generation of the Dolphin series of instruct-tuned models. Designed to be the ultimate general purpose local model, enabling coding, math, agentic, function calling, and general use cases.
26
+ >
27
+ > Dolphin aims to be a general purpose instruct model, similar to the models behind ChatGPT, Claude, Gemini. But these models present problems for businesses seeking to include AI in their products.
28
+ > 1) They maintain control of the system prompt, deprecating and changing things as they wish, often causing software to break.
29
+ > 2) They maintain control of the model versions, sometimes changing things silently, or deprecating older models that your business relies on.
30
+ > 3) They maintain control of the alignment, and in particular the alignment is one-size-fits all, not tailored to the application.
31
+ > 4) They can see all your queries and they can potentially use that data in ways you wouldn't want.
32
+ >
33
+ > Dolphin, in contrast, is steerable and gives control to the system owner. You set the system prompt. You decide the alignment. You have control of your data. Dolphin does not impose its ethics or guidelines on you. You are the one who decides the guidelines.
34
+ >
35
+ > Dolphin belongs to YOU, it is your tool, an extension of your will.
36
+ > Just as you are personally responsible for what you do with a knife, gun, fire, car, or the internet, you are the creator and originator of any content you generate with Dolphin.
37
 
38
  From Eric Hartford's, the creator of the Dolphin model series, [Uncensored Models](https://erichartford.com/uncensored-models):
39
 
40
  > Most of these models (for example, Alpaca, Vicuna, WizardLM, MPT-7B-Chat, Wizard-Vicuna, GPT4-X-Vicuna) have some sort of embedded alignment. For general purposes, this is a good thing. This is what stops the model from doing bad things, like teaching you how to cook meth and make bombs. But what is the nature of this alignment? And, why is it so?
41
+ >
42
  > The reason these models are aligned is that they are trained with data that was generated by ChatGPT, which itself is aligned by an alignment team at OpenAI. As it is a black box, we don't know all the reasons for the decisions that were made, but we can observe it generally is aligned with American popular culture, and to obey American law, and with a liberal and progressive political bias.
43
 
44
+ # PLEASE READ THIS BEFORE USING THESE EXPERIMENTAL VERSIONS!
45
 
46
+ An area of personal interest is finding ways to optimize the inference performance of LLMs when deployed in resource-constrained environments like commodity hardware, desktops, laptops, mobiles, edge devices, etc. There are many approaches to accomplish this, including architecture simplification and knowledge distillation, but my focus has been primarily on quantization and pruning.
47
 
48
+ The method used to produce these experimental versions is covered in [Squeezing Tensor Bits: the quest for smaller LLMs][mdm], but at a high level it involves using a custom version of `llama-imatrix` and `llama-quantize` to identify influential tensors, and quantize the most important layers to higher bit precision and the less important to lower bits. This process was partly inspired by Dumitru's et al [Layer-Wise Quantization: A Pragmatic and Effective Method for Quantizing LLMs Beyond Integer Bit-Levels][lwq-ppr].
49
 
50
+ As of version [b5125][qtz-rel] [llama-quantize][qtz] can now perform **tensor-wide quantization (TWQ)**, whereby user-defined tensors are quantized at a specific level, or perform **layer-wise quantization (LWQ)** by selecting different quantization types per tensor/layer. For example, `--tensor-type attn_v=q6_k` will quantize all *Attention Value* tensors at *q6_k* (TWQ), and `--tensor-type "\.([0-9]|1[01257]|31)\.attn_k=q4_k"` will quantize *Attention Key* tensors on layers 0 to 9, 10, 11, 12, 15, 17 and 31 at *q4_k*, leaving the remaining layers at their default value (LWQ).
 
 
 
 
 
51
 
52
+ The modified version of [llama-imatrix][imx] generates useful statistics to guide the tensor selection process, `--show-statistics` will display:
53
 
54
+ - **Σ(Bias):** the sum of all activations over the tensor (i.e. the Importance Scores)
55
+ - **Min & Max:** minimum and maximum activation values
56
+ - **μ & σ:** activations' mean and standard deviation
57
+ - **% Active:** proportion of elements whose average activation exceeds a very small threshold (1e-6). Helpful to determine how alive/dormant the tensor is during inference
58
+ - **N:** number of activations in the tensor
59
+ - **Entropy:** entropy of the activation distribution, in bits (standard Shannon entropy measurement)
60
+ - **E (norm):** Normalized entropy.
61
+ - **ZD Score:** z-score distribution as described in 3.1 Layer Importance Scores in the Layer-Wise Quantization paper
62
+ - **CosSim:** cosine similarity between same type tensors with respect to the previous layer (i.e. blk.7.attn_k and blk.6.attn_k)
63
 
64
+ Please note that statistics are calculated for each individial tensor and should be used to compare between tensors of the same type only. For example, assuming that *attn_k* in layer 10 has a higher influence during inference than *attn_k* in layer 7 because its **Σ(Bias)** is larger makes sense, whilst concluding the same between *attn_k* and *ffn_down* does not.
65
 
66
+ There’s a [pull request][imtx-pr] to merge these changes back into the core llama.cpp project. This may or may not ever happen so, until then, the modified version will be available on [GitHub][gh].
67
 
68
+ For testing and comparison I use models produced by [Unsloth][ust] ([Daniel and Michael Han][ust-ai] do some really advanced level stuff!) and [Bartowski][btk] (see credits below) but if they don't provide versions of the required model, all tests and comparisons are done against naive quantizations obtained by simply running `llama-quantize` with no further optimization.
69
+
70
+ All experimental versions were generated using an appropriate imatrix created from calibration datasets available at [eaddario/imatrix-calibration][ical]. At its core, an Importance Matrix (imatrix) is a table or, more broadly, a structured representation that scores the relative importance of different features or parameters in a machine learning model. It essentially quantifies the "impact" each feature has on a specific outcome, prediction, or relationship being modeled, and it helps to counterbalance the negative effects of quantization and pruning.
71
+
72
+ The process to generate these models is roughly as follows:
73
+
74
+ 1. Convert the the original model's tensors to [GGUF][ggf] F16*
75
+ 2. Estimate the Perplexity score for the F16 model (baseline) using the [wikitext-2-raw-v1][wki-dat] dataset, and save the [logits][lgt]
76
+ 3. Generate an [imatrix][imx-dat] from selected calibration datasets
77
+ 4. Determine tensor and layer Importance Score contribution using the modified version of `llama-imatrix`
78
+ 5. Select an appropiate quant level for each tensor and quantize the model using `llama-quantize`
79
+ 6. Calculate Perplexity, KL Divergence, ARC (Easy+Challenge), HellaSwag, MMLU, Truthful QA and WinoGrande scores for each quantized model
80
+ 7. Keep versions with the best scores
81
+ 8. Repeat until all desired quants are created. I find that quantizations below Q3/IQ3 are not fit for my purposes and therefore do not usually generate them, but happy to provide other quants on request.
82
+
83
+ *[BF16][bf16] would be preferred, but Apple's GPUs don't support it yet, and therefore any operations are executed in the CPU, making it unacceptably slow. This is expected to change in the near term but until then, if you are using Apple kit avoid using any models tagged BF16
84
 
85
  # Models
86
 
87
+ ### Sizes (in GB)
88
+ | Model | Bartowski | Repo | Shrinkage |
89
+ | --------------------------------------------------------------------------- | --------: | ----: | --------: |
90
+ | [Dolphin3.0-R1-Mistral-24B-IQ3_M](./Dolphin3.0-R1-Mistral-24B-IQ3_M.gguf) | 10.70 | 10.82 | -1.1% |
91
+ | [Dolphin3.0-R1-Mistral-24B-IQ3_S](./Dolphin3.0-R1-Mistral-24B-IQ3_S.gguf) | 9.91 | 10.18 | -2.7% |
92
+ | [Dolphin3.0-R1-Mistral-24B-IQ4_NL](./Dolphin3.0-R1-Mistral-24B-IQ4_NL.gguf) | 13.50 | 13.05 | 3.3% |
93
+ | [Dolphin3.0-R1-Mistral-24B-Q3_K_L](./Dolphin3.0-R1-Mistral-24B-Q3_K_L.gguf) | 12.40 | 10.96 | 11.6% |
94
+ | [Dolphin3.0-R1-Mistral-24B-Q3_K_M](./Dolphin3.0-R1-Mistral-24B-Q3_K_M.gguf) | 11.50 | 10.42 | 9.4% |
95
+ | [Dolphin3.0-R1-Mistral-24B-Q3_K_S](./Dolphin3.0-R1-Mistral-24B-Q3_K_S.gguf) | 10.40 | 9.78 | 6.0% |
96
+ | [Dolphin3.0-R1-Mistral-24B-Q4_K_M](./Dolphin3.0-R1-Mistral-24B-Q4_K_M.gguf) | 14.30 | 13.07 | 8.6% |
97
+ | [Dolphin3.0-R1-Mistral-24B-Q4_K_S](./Dolphin3.0-R1-Mistral-24B-Q4_K_S.gguf) | 13.50 | 12.64 | 6.4% |
98
+ | [Dolphin3.0-R1-Mistral-24B-Q5_K_M](./Dolphin3.0-R1-Mistral-24B-Q5_K_M.gguf) | 16.80 | 15.58 | 7.3% |
99
+ | [Dolphin3.0-R1-Mistral-24B-Q5_K_S](./Dolphin3.0-R1-Mistral-24B-Q5_K_S.gguf) | 16.30 | 14.91 | 8.5% |
100
+ | [Dolphin3.0-R1-Mistral-24B-Q6_K](./Dolphin3.0-R1-Mistral-24B-Q6_K.gguf) | 19.30 | 19.28 | 0.1% |
101
+ | [Dolphin3.0-R1-Mistral-24B-Q8_0](./Dolphin3.0-R1-Mistral-24B-Q8_0.gguf) | 25.10 | 22.98 | 8.4% |
102
+
103
+ ### Perplexity and KL Divergence scores
104
+ | Model | μPPL | 𝜌PPL | μKLD | RMS Δp |
105
+ | --------------------------------------------------------------------------- | ------------------: | -----: | -----------------: | ------------: |
106
+ | [Dolphin3.0-R1-Mistral-24B-IQ3_M](./Dolphin3.0-R1-Mistral-24B-IQ3_M.gguf) | 24.606928 ±0.240883 | 98.90% | 0.084228 ±0.000329 | 77.239 ±0.036 |
107
+ | [Dolphin3.0-R1-Mistral-24B-IQ3_S](./Dolphin3.0-R1-Mistral-24B-IQ3_S.gguf) | 22.442379 ±0.210710 | 98.39% | 0.118717 ±0.000448 | 8.764 ±0.041 |
108
+ | [Dolphin3.0-R1-Mistral-24B-IQ4_NL](./Dolphin3.0-R1-Mistral-24B-IQ4_NL.gguf) | 21.928862 ±0.206557 | 99.48% | 0.037446 ±0.000162 | 5.018 ±0.029 |
109
+ | [Dolphin3.0-R1-Mistral-24B-Q3_K_L](./Dolphin3.0-R1-Mistral-24B-Q3_K_L.gguf) | 23.403845 ±0.220384 | 98.39% | 0.116116 ±0.000467 | 8.812 ±0.043 |
110
+ | [Dolphin3.0-R1-Mistral-24B-Q3_K_M](./Dolphin3.0-R1-Mistral-24B-Q3_K_M.gguf) | 33.198678 ±0.325464 | 93.18% | 0.503668 ±0.001913 | 18.223 ±0.075 |
111
+ | [Dolphin3.0-R1-Mistral-24B-Q3_K_S](./Dolphin3.0-R1-Mistral-24B-Q3_K_S.gguf) | 35.148697 ±0.355888 | 93.75% | 0.481979 ±0.001791 | 17.540 ±0.073 |
112
+ | [Dolphin3.0-R1-Mistral-24B-Q4_K_M](./Dolphin3.0-R1-Mistral-24B-Q4_K_M.gguf) | 21.803136 ±0.204778 | 99.47% | 0.037315 ±0.000164 | 5.020 ±0.028 |
113
+ | [Dolphin3.0-R1-Mistral-24B-Q4_K_M-bartowski][b-q4km] | 21.965440 ±0.208103 | 99.62% | 0.027409 ±0.000114 | 4.294 ±0.024 |
114
+ | [Dolphin3.0-R1-Mistral-24B-Q4_K_S](./Dolphin3.0-R1-Mistral-24B-Q4_K_S.gguf) | 22.282006 ±0.210372 | 99.42% | 0.041972 ±0.000184 | 5.297 ±0.029 |
115
+ | [Dolphin3.0-R1-Mistral-24B-Q5_K_M](./Dolphin3.0-R1-Mistral-24B-Q5_K_M.gguf) | 21.112940 ±0.197766 | 99.60% | 0.028216 ±0.000126 | 4.384 ±0.025 |
116
+ | [Dolphin3.0-R1-Mistral-24B-Q5_K_S](./Dolphin3.0-R1-Mistral-24B-Q5_K_S.gguf) | 21.195503 ±0.197666 | 99.77% | 0.015751 ±0.000076 | 3.272 ±0.021 |
117
+ | [Dolphin3.0-R1-Mistral-24B-Q6_K](./Dolphin3.0-R1-Mistral-24B-Q6_K.gguf) | 21.367322 ±0.200492 | 99.90% | 0.006579 ±0.000038 | 2.182 ±0.016 |
118
+ | [Dolphin3.0-R1-Mistral-24B-Q8_0](./Dolphin3.0-R1-Mistral-24B-Q8_0.gguf) | 20.553420 ±0.190365 | 99.81% | 0.013005 ±0.000059 | 2.908 ±0.018 |
119
+ | [Dolphin3.0-R1-Mistral-24B-F16](./Dolphin3.0-R1-Mistral-24B-F16.gguf) | 21.071274 ±0.196181 | 100% | N/A | N/A |
120
+
121
+ ### ARC, HellaSwag, MMLU, Truthful QA and WinoGrande scores
122
+ Scores generated using [llama-perplexity][ppl] with 750 tasks per test, and a context size of 768 tokens.
123
+
124
+ For the test data used in the generation of these scores, follow the appropiate links: [HellaSwag][hsw-tst], [ARC, MMLU, Truthful QA][tst-dat] and [WinoGrande][wng-tst]
125
+
126
+ | Model | ARC | HellaSwag | MMLU | Truthful QA | WinoGrande | Avg Score |
127
+ | --------------------------------------------------------------------------- | --------------: | --------: | --------------: | --------------: | --------------: | --------: |
128
+ | [Dolphin3.0-R1-Mistral-24B-IQ3_M](./Dolphin3.0-R1-Mistral-24B-IQ3_M.gguf) | 52.4000 ±1.8249 | 62.40 | 34.8000 ±1.7405 | 29.4667 ±1.6658 | 61.6000 ±1.7771 | 48.13 |
129
+ | [Dolphin3.0-R1-Mistral-24B-IQ3_S](./Dolphin3.0-R1-Mistral-24B-IQ3_S.gguf) | 51.4667 ±1.8262 | 62.67 | 33.2000 ±1.7207 | 28.5333 ±1.6500 | 62.2667 ±1.7711 | 47.63 |
130
+ | [Dolphin3.0-R1-Mistral-24B-IQ4_NL](./Dolphin3.0-R1-Mistral-24B-IQ4_NL.gguf) | 54.1333 ±1.8207 | 63.46 | 34.9333 ±1.7420 | 28.5333 ±1.6500 | 63.8667 ±1.7553 | 48.99 |
131
+ | [Dolphin3.0-R1-Mistral-24B-Q3_K_L](./Dolphin3.0-R1-Mistral-24B-Q3_K_L.gguf) | 50.0000 ±1.8270 | 61.73 | 34.0000 ±1.7309 | 27.3333 ±1.6284 | 63.4667 ±1.7594 | 47.31 |
132
+ | [Dolphin3.0-R1-Mistral-24B-Q3_K_M](./Dolphin3.0-R1-Mistral-24B-Q3_K_M.gguf) | 46.6667 ±1.8229 | 56.80 | 32.0000 ±1.7045 | 28.5333 ±1.6500 | 63.3333 ±1.7608 | 45.47 |
133
+ | [Dolphin3.0-R1-Mistral-24B-Q3_K_S](./Dolphin3.0-R1-Mistral-24B-Q3_K_S.gguf) | 46.9333 ±1.8235 | 57.47 | 30.8000 ±1.6869 | 28.1333 ±1.6430 | 63.3333 ±1.7608 | 45.33 |
134
+ | [Dolphin3.0-R1-Mistral-24B-Q4_K_M](./Dolphin3.0-R1-Mistral-24B-Q4_K_M.gguf) | 52.1333 ±1.8253 | 63.20 | 35.0667 ±1.7436 | 26.9333 ±1.6209 | 64.1333 ±1.7525 | 48.29 |
135
+ | [Dolphin3.0-R1-Mistral-24B-Q4_K_M-bartowski][b-q4km] | 51.8667 ±1.8257 | 63.47 | 35.0667 ±1.7436 | 28.4000 ±1.6477 | 64.4000 ±1.7496 | 48.64 |
136
+ | [Dolphin3.0-R1-Mistral-24B-Q4_K_S](./Dolphin3.0-R1-Mistral-24B-Q4_K_S.gguf) | 51.4667 ±1.8262 | 63.73 | 33.8667 ±1.7292 | 27.0667 ±1.6235 | 62.5333 ±1.7686 | 47.73 |
137
+ | [Dolphin3.0-R1-Mistral-24B-Q5_K_M](./Dolphin3.0-R1-Mistral-24B-Q5_K_M.gguf) | 53.2000 ±1.8232 | 62.80 | 35.7333 ±1.7510 | 27.3333 ±1.6284 | 63.4667 ±1.7594 | 48.51 |
138
+ | [Dolphin3.0-R1-Mistral-24B-Q5_K_S](./Dolphin3.0-R1-Mistral-24B-Q5_K_S.gguf) | 53.8667 ±1.8215 | 63.73 | 34.4000 ±1.7358 | 28.8000 ±1.6546 | 64.0000 ±1.7539 | 48.96 |
139
+ | [Dolphin3.0-R1-Mistral-24B-Q6_K](./Dolphin3.0-R1-Mistral-24B-Q6_K.gguf) | 53.3333 ±1.8229 | 63.33 | 35.4667 ±1.7481 | 29.2000 ±1.6614 | 62.5333 ±1.7686 | 48.77 |
140
+ | [Dolphin3.0-R1-Mistral-24B-Q8_0](./Dolphin3.0-R1-Mistral-24B-Q8_0.gguf) | 53.2000 ±1.8232 | 63.20 | 35.2000 ±1.7451 | 28.5333 ±1.6500 | 63.3333 ±1.7608 | 48.69 |
141
+ | [Dolphin3.0-R1-Mistral-24B-F16](./Dolphin3.0-R1-Mistral-24B-F16.gguf) | 52.6667 ±1.8244 | 63.60 | 35.2000 ±1.7451 | 28.6667 ±1.6523 | 63.4667 ±1.7594 | 48.72 |
142
+
143
+ ### Tokens per Second - Benchmarks
144
+ Scores generated using [llama-bench][bch]. Naive (`llama-quantize` with no optimization) Q4_K_M quantization included for comparison.
145
+
146
+ | model | size | params | backend | threads | test | t/s |
147
+ | --------------------------------------------------------------------------- | --------: | ------: | ---------- | ------: | ------------: | ------------: |
148
+ | [Dolphin3.0-R1-Mistral-24B-Q4_K_M](./Dolphin3.0-R1-Mistral-24B-Q4_K_M.gguf) | 12.17 GiB | 23.57 B | Metal,BLAS | 6 | pp512 | 100.81 ± 0.34 |
149
+ | [Dolphin3.0-R1-Mistral-24B-Q4_K_M](./Dolphin3.0-R1-Mistral-24B-Q4_K_M.gguf) | 12.17 GiB | 23.57 B | Metal,BLAS | 6 | tg128 | 9.74 ± 0.02 |
150
+ | [Dolphin3.0-R1-Mistral-24B-Q4_K_M](./Dolphin3.0-R1-Mistral-24B-Q4_K_M.gguf) | 12.17 GiB | 23.57 B | Metal,BLAS | 6 | pp1024+tg1024 | 16.79 ± 0.05 |
151
+ | [Dolphin3.0-R1-Mistral-24B-Q4_K_M-bartowski][b-q4km] | 13.34 GiB | 23.57 B | Metal,BLAS | 6 | pp512 | 105.56 ± 0.60 |
152
+ | [Dolphin3.0-R1-Mistral-24B-Q4_K_M-bartowski][b-q4km] | 13.34 GiB | 23.57 B | Metal,BLAS | 6 | tg128 | 8.99 ± 0.21 |
153
+ | [Dolphin3.0-R1-Mistral-24B-Q4_K_M-bartowski][b-q4km] | 13.34 GiB | 23.57 B | Metal,BLAS | 6 | pp1024+tg1024 | 16.11 ± 0.12 |
154
 
155
  # Metrics used
156
+ **[Perplexity][ppx]:** one of the key metrics used in NLP evaluation. It measures the quality of a language model by evaluating how well it predicts the next token given a particular sequence of words. A PPL of **1** indicates an exact match between predicted and actual, whereas values greater than one indicate a degree of "surprise" the generated token differs from the expected.
157
 
158
+ **[Kullback–Leibler (KL) Divergence][kld]:** a statistical measure of how much a probability distribution differs from another. When quantizing models (or altering the original tensors in any way for that matter), the closest we can preserve the weights' probability distribution to the original model the better, thus the closest to **0** the better.
159
 
160
+ **[AI2 Reasoning Challenge (ARC)][arc]:** a benchmark to evaluate the ability of AI models to answer complex science questions that require logical reasoning beyond pattern matching.
161
 
162
+ **[HellaSwag][hsw]:** the Harder Endings, Longer contexts, and Low-shot Activities for Situations With Adversarial Generations (bit of a mouthful!) is a benchmark designed to test commonsense natural language inference. It requires the model to predict the most likely ending of a sentence.
163
 
164
+ **[MMLU][mmlu]:** the Massive Multitask Language Understanding evaluates LLMs’ general knowledge and problem-solving abilities across 57 subjects, including elementary mathematics, US history, computer science, and law.
165
+
166
+ **[Truthful QA][tqa]:** evaluates how well LLMs generate truthful responses to questions. It identifies whether AI models can avoid generating false or misleading information, particularly in areas where human knowledge is prone to misconceptions.
167
+
168
+ **[Winogrande][wng]:** based on the [Winograd Schema Challenge][wng-chl], is a natural language understanding task requiring models to resolve ambiguities in sentences involving pronoun references.
169
+
170
+ ## Credits
171
+ A big **Thank You!** to [Colin Kealty][btk] for the many contributions and for being one of the best sources of high quality quantized models available on Huggingface, and a really big ***Thank You!*** to [Georgi Gerganov][ggg] for his amazing work with **llama.cpp** and the **ggml/gguf** libraries.
172
+
173
+ [arc]: https://leaderboard.allenai.org/arc/submissions/get-started
174
+ [btk]: https://huggingface.co/bartowski
175
+ [bch]: https://github.com/ggml-org/llama.cpp/tree/master/tools/llama-bench
176
+ [bf16]: https://en.wikipedia.org/wiki/Bfloat16_floating-point_format
177
+ [b-q4km]: https://huggingface.co/bartowski/cognitivecomputations_Dolphin3.0-R1-Mistral-24B-GGUF/blob/main/cognitivecomputations_Dolphin3.0-R1-Mistral-24B-Q4_K_M.gguf
178
+ [u-q4km]: https://huggingface.co/unsloth
179
+ [ical]: https://huggingface.co/datasets/eaddario/imatrix-calibration
180
+ [ggg]: https://github.com/ggerganov
181
+ [ggf]: https://huggingface.co/docs/hub/en/gguf
182
+ [gh]: https://github.com/EAddario/llama.cpp/tree/imatrix
183
+ [hsw]: https://rowanzellers.com/hellaswag
184
+ [hsw-tst]: https://github.com/klosax/hellaswag_text_data
185
+ [imx-dat]: https://huggingface.co/eaddario/Dolphin3.0-R1-Mistral-24B-GGUF/tree/main/imatrix
186
+ [imx]: https://github.com/ggml-org/llama.cpp/tree/master/tools/imatrix
187
+ [imtx-pr]: https://github.com/ggml-org/llama.cpp/pull/12718
188
+ [kld]: https://en.wikipedia.org/wiki/Kullback–Leibler_divergence
189
+ [llm]: https://github.com/ggerganov/llama.cpp
190
+ [llm-rel]: https://github.com/ggerganov/llama.cpp/releases/tag/b5269
191
+ [lgt]: https://huggingface.co/eaddario/Dolphin3.0-R1-Mistral-24B-GGUF/tree/main/logits
192
+ [lwq-ppr]: https://arxiv.org/abs/2406.17415
193
+ [mdm]: https://medium.com/@eaddario/squeezing-tensor-bits-the-quest-for-smaller-llms-86b23bd052ca
194
+ [mmlu]: https://github.com/hendrycks/test
195
+ [mdl]: https://huggingface.co/cognitivecomputations/Dolphin3.0-R1-Mistral-24B
196
+ [ppl]: https://github.com/ggml-org/llama.cpp/tree/master/tools/perplexity
197
+ [ppx]: https://huggingface.co/docs/transformers/en/perplexity
198
+ [qtz]: https://github.com/ggml-org/llama.cpp/tree/master/tools/quantize
199
+ [qtz-rel]: https://github.com/ggerganov/llama.cpp/releases/tag/b5125
200
+ [tst-dat]: https://huggingface.co/datasets/ikawrakow/validation-datasets-for-llama.cpp/tree/main
201
+ [tqa]: https://github.com/sylinrl/TruthfulQA
202
+ [ust]: https://huggingface.co/unsloth
203
+ [ust-ai]: https://unsloth.ai
204
+ [wng-chl]: https://cdn.aaai.org/ocs/4492/4492-21843-1-PB.pdf
205
+ [wki-dat]: https://huggingface.co/datasets/Salesforce/wikitext/tree/main/wikitext-2-raw-v1
206
+ [wng]: https://winogrande.allenai.org
207
+ [wng-tst]: https://huggingface.co/datasets/ikawrakow/winogrande-eval-for-llama.cpp/tree/main