Experimental GGUF quantized versions of watt-ai/watt-tool-8B
Using LLaMA C++ release b4801 for quantization.
Original model: watt-ai/watt-tool-8B
From the original model creators:
watt-tool-8B is a fine-tuned language model based on LLaMa-3.1-8B-Instruct, optimized for tool usage and multi-turn dialogue. It achieves state-of-the-art performance on the Berkeley Function-Calling Leaderboard (BFCL)
The model is specifically designed to excel at complex tool usage scenarios that require multi-turn interactions, making it ideal for empowering platforms like Lupan, an AI-powered workflow building tool. By leveraging a carefully curated and optimized dataset, watt-tool-8B demonstrates superior capabilities in understanding user requests, selecting appropriate tools, and effectively utilizing them across multiple turns of conversation.
PLEASE READ THIS BEFORE USING THESE EXPERIMENTAL VERSIONS!
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, edge devices, etc. There are many approaches to accomplish this, including architecture simplification and knowledge distillation, but for now I'm focusing primarily on quantization and pruning.
The process of 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!).
Another approach is to prune the model, that is, to selectively zero-out groups of parameters. Although significant reductions can be achieved this way, the risk of severely degrading the model's performance is markedly higher than when quantizing, as the process requires a deep understanding of the model's architecture in order to identify which tensors can be safely zero'ed. For all means and purposes, pruning is the equivalent of lobotomizing the LLM!
A successful outcome is when the overall size is reduced with no, or negligible, loss of capabilities (i.e. language understanding, math and logic problem-solving, conversation, coding, domain-specific knowledge, etc.) compared to the original version. On that regard, the method I'm using seems to yield some modest but encouraging results, and the versions available in this repo are on average 7% smaller than other, high-quality, sources with negligible loss of capability. As I continue to improve the process and develop tools to automate it, I aim to achieve further reductions in the 10-15% range, maybe more.
For testing and comparison I'd normally use models produced by Unsloth (Daniel and Michael Han do some really advanced level stuff!) and Bartowski (see credits below), but they don't provide GGUF versions of this model, so all tests and comparisons are done against naive quantizations obtained by simply running llama-quantize
with no further optimization.
All experimental versions were generated using an appropriate imatrix created from calibration datasets available at eaddario/imatrix-calibration. 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.
The process to generate these models is roughly as follows:
- Convert the the original model's tensors to GGUF F16*
- Estimate the Perplexity score for the F16 model (baseline) using the wikitext-2-raw-v1 dataset, and save the logits
- Generate an imatrix from selected calibration datasets
- Quantize & prune versions of the base model
- Calculate Perplexity, KL Divergence, ARC (Easy+Challenge), HellaSwag, MMLU, Truthful QA and WinoGrande scores for each quantized model
- Keep versions with the best scores
- 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.
*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
Models
Sizes (in GB)
Model | Naive | Repo | Shrinkage |
---|---|---|---|
Watt-Tool-8B-IQ3_M | 3.78 | 3.47 | 8.2% |
Watt-Tool-8B-IQ3_S | 3.68 | 3.34 | 9.2% |
Watt-Tool-8B-IQ4_NL | 4.68 | 4.35 | 7.7% |
Watt-Tool-8B-Q3_K_L | 4.32 | 4.01 | 7.0% |
Watt-Tool-8B-Q3_K_M | 4.02 | 3.70 | 8.0% |
Watt-Tool-8B-Q3_K_S | 3.66 | 3.35 | 8.5% |
Watt-Tool-8B-Q4_K_M | 4.92 | 4.59 | 6.7% |
Watt-Tool-8B-Q4_K_S | 4.69 | 4.36 | 7.0% |
Watt-Tool-8B-Q5_K_M | 5.73 | 5.34 | 6.8% |
Watt-Tool-8B-Q5_K_S | 5.60 | 5.21 | 7.0% |
Watt-Tool-8B-Q6_K | 6.60 | 6.13 | 7.1% |
Watt-Tool-8B-Q8_0 | 8.54 | 7.82 | 8.4% |
Perplexity and KL Divergence scores
Model | μPPL | 𝜌PPL | μKLD | RMS Δp |
---|---|---|---|---|
Watt-Tool-8B-IQ3_M | 9.087639 ±0.058224 | 96.96% | 0.173555 ±0.000494 | 12.642 ±0.047 |
Watt-Tool-8B-IQ3_S | 9.156208 ±0.059074 | 96.88% | 0.176807 ±0.000516 | 12.577 ±0.047 |
Watt-Tool-8B-IQ4_NL | 7.990955 ±0.051527 | 99.03% | 0.051341 ±0.000211 | 6.512 ±0.032 |
Watt-Tool-8B-Q3_K_L | 8.895382 ±0.058817 | 97.35% | 0.146296 ±0.000446 | 11.179 ±0.043 |
Watt-Tool-8B-Q3_K_M | 9.016990 ±0.059441 | 97.13% | 0.157666 ±0.000482 | 11.741 ±0.045 |
Watt-Tool-8B-Q3_K_S | 10.242604 ±0.066586 | 94.81% | 0.276176 ±0.000860 | 17.133 ±0.061 |
Watt-Tool-8B-Q4_K_M | 7.976327 ±0.051353 | 99.11% | 0.047280 ±0.000179 | 6.272 ±0.032 |
Watt-Tool-8B-Q4_K_S | 7.991770 ±0.051300 | 99.04% | 0.050966 ±0.000194 | 6.565 ±0.033 |
Watt-Tool-8B-Q5_K_M | 7.850938 ±0.050528 | 99.33% | 0.036018 ±0.000138 | 5.419 ±0.026 |
Watt-Tool-8B-Q5_K_S | 7.848321 ±0.050459 | 99.32% | 0.036602 ±0.000141 | 5.468 ±0.026 |
Watt-Tool-8B-Q6_K | 7.814872 ±0.050237 | 99.38% | 0.033097 ±0.000123 | 5.238 ±0.025 |
Watt-Tool-8B-Q8_0 | 7.794238 ±0.050005 | 99.41% | 0.031806 ±0.000121 | 5.135 ±0.024 |
Watt-Tool-8B-F16 | 7.534124 ±0.048206 | 100% | N/A | N/A |
ARC, HellaSwag, MMLU, Truthful QA and WinoGrande scores
Scores generated using llama-perplexity with 750 tasks per test, and a context size of 768 tokens. Naive (llama-quantize
with no optimization) Q4_K_M quantization included for comparison.
For the test data used in the generation of these scores, follow the appropiate links: HellaSwag, ARC, MMLU, Truthful QA and WinoGrande
Model | ARC | HellaSwag | MMLU | Truthful QA | WinoGrande |
---|---|---|---|---|---|
Watt-Tool-8B-IQ3_M | 60.6667 ±1.7849 | 77.46 | 38.9333 ±1.7816 | 33.3333 ±1.7225 | 75.3333 ±1.5751 |
Watt-Tool-8B-IQ3_S | 61.6000 ±1.7771 | 77.33 | 39.6000 ±1.7870 | 32.4000 ±1.7100 | 74.6667 ±1.5892 |
Watt-Tool-8B-IQ4_NL | 64.9333 ±1.7436 | 78.80 | 40.0000 ±1.7900 | 33.7333 ±1.7276 | 74.9333 ±1.5836 |
Watt-Tool-8B-Q3_K_L | 62.8000 ±1.7661 | 77.07 | 39.0667 ±1.7827 | 33.3333 ±1.7225 | 75.6000 ±1.5693 |
Watt-Tool-8B-Q3_K_M | 63.0667 ±1.7635 | 76.53 | 39.0667 ±1.7827 | 33.8667 ±1.7292 | 75.4667 ±1.5722 |
Watt-Tool-8B-Q3_K_S | 63.2000 ±1.7621 | 76.13 | 38.1333 ±1.7748 | 32.9333 ±1.7172 | 73.6000 ±1.6106 |
Watt-Tool-8B-Q4_K_M | 64.5333 ±1.7481 | 78.40 | 39.3333 ±1.7849 | 34.4000 ±1.7358 | 74.5333 ±1.5919 |
Watt-Tool-8B-Q4_K_M (Naive) | 65.3333 ±1.7389 | 78.67 | 40.5333 ±1.7939 | 31.4667 ±1.6968 | 74.6667 ±1.5892 |
Watt-Tool-8B-Q4_K_S | 64.9333 ±1.7436 | 78.26 | 40.2667 ±1.7920 | 33.8667 ±1.7292 | 75.7333 ±1.5664 |
Watt-Tool-8B-Q5_K_M | 64.5333 ±1.7481 | 78.40 | 40.5333 ±1.7939 | 33.3333 ±1.7225 | 74.6667 ±1.5892 |
Watt-Tool-8B-Q5_K_S | 64.8000 ±1.7451 | 78.67 | 40.5333 ±1.7939 | 33.3333 ±1.7225 | 75.0667 ±1.5808 |
Watt-Tool-8B-Q6_K | 64.2667 ±1.7510 | 79.07 | 40.9333 ±1.7967 | 34.1333 ±1.7325 | 74.8000 ±1.5864 |
Watt-Tool-8B-Q8_0 | 63.8667 ±1.7553 | 78.67 | 41.2000 ±1.7984 | 34.2667 ±1.7342 | 74.2667 ±1.5974 |
Watt-Tool-8B-F16 | 65.8667 ±1.7325 | 78.67 | 40.9333 ±1.7967 | 32.9333 ±1.7172 | 74.8000 ±1.5864 |
Tokens per Second - Benchmarks
Scores generated using llama-bench. Naive (llama-quantize
with no optimization) Q4_K_M quantization included for comparison.
model | size | params | backend | threads | test | t/s |
---|---|---|---|---|---|---|
Watt-Tool-8B-Q4_K_M | 4.27 GiB | 8.03 B | Metal,BLAS | 6 | pp512 | 329.41 ± 0.08 |
Watt-Tool-8B-Q4_K_M | 4.27 GiB | 8.03 B | Metal,BLAS | 6 | tg128 | 26.75 ± 0.04 |
Watt-Tool-8B-Q4_K_M | 4.27 GiB | 8.03 B | Metal,BLAS | 6 | pp1024+tg1024 | 43.55 ± 0.08 |
Watt-Tool-8B-Q4_K_M (Naive) | 4.58 GiB | 8.03 B | Metal,BLAS | 6 | pp512 | 329.36 ± 0.16 |
Watt-Tool-8B-Q4_K_M (Naive) | 4.58 GiB | 8.03 B | Metal,BLAS | 6 | tg128 | 26.52 ± 0.01 |
Watt-Tool-8B-Q4_K_M (Naive) | 4.58 GiB | 8.03 B | Metal,BLAS | 6 | pp1024+tg1024 | 42.76 ± 0.91 |
Metrics used
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.
Kullback–Leibler (KL) 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.
AI2 Reasoning Challenge (ARC): a benchmark to evaluate the ability of AI models to answer complex science questions that require logical reasoning beyond pattern matching.
HellaSwag: 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.
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.
Truthful QA: 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.
Winogrande: based on the Winograd Schema Challenge, is a natural language understanding task requiring models to resolve ambiguities in sentences involving pronoun references.
Credits
A big Thank You! to Colin Kealty 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 for his amazing work with llama.cpp and the gguf file format.
- Downloads last month
- 1,961
Model tree for eaddario/Watt-Tool-8B-GGUF
Base model
meta-llama/Llama-3.1-8B