Watt-Tool-8B-GGUF / README.md
eaddario's picture
Update README.md
590426d verified
|
raw
history blame
15.3 kB
metadata
base_model:
  - watt-ai/watt-tool-8B
datasets:
  - eaddario/imatrix-calibration
language:
  - en
license:
  - apache-2.0
pipeline_tag: text-generation
tags:
  - gguf
  - quant
  - experimental

Experimental GGUF quantized versions of watt-ai/watt-tool-8B

Using LLaMA C++ release b4945 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, 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.

The method that I'm using to produce these experimental versions is explained in Squeezing Tensor Bits: the quest for smaller LLMs, but at a high level it involves using a custom version of the llama-quantize tool to selectively quantize different tensors at different levels.

There’re two pull requests (#12511 & #12512) to merge these changes back into the core llama.cpp project. This may or may not ever happen but until then, the modified version will be available on my GitHub.

In addition to llama-quantize, there’s a version of llama-perplexity that allows you to continue generating test scores even if there’s a context window overflow (original behaviour is to stop).

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:

  1. Convert the the original model's tensors to GGUF F16*
  2. Estimate the Perplexity score for the F16 model (baseline) using the wikitext-2-raw-v1 dataset, and save the logits
  3. Generate an imatrix from selected calibration datasets
  4. Select an appropiate quant level for each tensor using a modified version of llama-quantize
  5. Calculate Perplexity, KL Divergence, ARC (Easy+Challenge), HellaSwag, MMLU, Truthful QA and WinoGrande scores for each quantized model
  6. Keep versions with the best scores
  7. 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.40 10.1%
Watt-Tool-8B-IQ3_S 3.68 3.24 12.0%
Watt-Tool-8B-IQ4_NL 4.68 4.30 8.1%
Watt-Tool-8B-Q3_K_L 4.32 3.31 23.4%
Watt-Tool-8B-Q3_K_M 4.02 3.30 17.9%
Watt-Tool-8B-Q3_K_S 3.66 3.28 10.4%
Watt-Tool-8B-Q4_K_M 4.92 4.44 9.8%
Watt-Tool-8B-Q4_K_S 4.69 4.31 8.1%
Watt-Tool-8B-Q5_K_M 5.73 5.35 6.6%
Watt-Tool-8B-Q5_K_S 5.60 5.19 7.3%
Watt-Tool-8B-Q6_K 6.60 6.17 6.5%
Watt-Tool-8B-Q8_0 8.54 7.84 8.2%

Perplexity and KL Divergence scores

Model μPPL 𝜌PPL μKLD RMS Δp
Watt-Tool-8B-IQ3_M 8.963688 ±0.058386 95.93% 0.209768 ±0.000734 13.969 ±0.056
Watt-Tool-8B-IQ3_S 9.032577 ±0.058532 95.96% 0.204862 ±0.000758 13.678 ±0.058
Watt-Tool-8B-IQ4_NL 7.935917 ±0.053744 98.36% 0.096510 ±0.000325 8.908 ±0.037
Watt-Tool-8B-Q3_K_L 9.923766 ±0.061734 94.33% 0.292497 ±0.000978 18.605 ±0.069
Watt-Tool-8B-Q3_K_M 9.855009 ±0.061412 94.48% 0.292188 ±0.000927 18.125 ±0.066
Watt-Tool-8B-Q3_K_S 9.798719 ±0.061509 94.51% 0.285340 ±0.000933 17.751 ±0.067
Watt-Tool-8B-Q4_K_M 7.640118 ±0.048002 99.15% 0.045262 ±0.000151 6.321 ±0.029
Watt-Tool-8B-Q4_K_M (naive) 7.409510 ±0.046740 99.65% 0.017663 ±0.000107 3.658 ±0.032
Watt-Tool-8B-Q4_K_S 7.652829 ±0.048076 99.13% 0.046275 ±0.000155 6.434 ±0.029
Watt-Tool-8B-Q5_K_M 7.493174 ±0.046979 99.50% 0.028633 ±0.000078 4.999 ±0.019
Watt-Tool-8B-Q5_K_S 7.493799 ±0.047018 99.49% 0.028988 ±0.000079 5.045 ±0.019
Watt-Tool-8B-Q6_K 7.454623 ±0.046795 99.56% 0.025169 ±0.000065 4.718 ±0.017
Watt-Tool-8B-Q8_0 7.438372 ±0.046597 99.58% 0.024091 ±0.000061 4.650 ±0.016
Watt-Tool-8B-F16 7.237090 ±0.045539 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.

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 Avg Score
Watt-Tool-8B-IQ3_M 57.6203 ±1.8080 78.80 36.2667 ±1.7567 33.2308 ±2.6169 70.9333 ±1.6591 55.37
Watt-Tool-8B-IQ3_S 57.3529 ±1.8095 77.20 36.1333 ±1.7553 35.5346 ±2.6882 70.2667 ±1.6702 55.30
Watt-Tool-8B-IQ4_NL 64.7925 ±1.7487 77.87 39.7333 ±1.7880 33.9564 ±2.6473 71.8667 ±1.6430 57.64
Watt-Tool-8B-Q3_K_L 62.6506 ±1.7711 74.67 36.0000 ±1.7539 35.4037 ±2.6692 72.8000 ±1.6260 56.30
Watt-Tool-8B-Q3_K_M 63.1016 ±1.7655 75.33 38.8000 ±1.7805 35.3846 ±2.6565 72.6667 ±1.6284 57.06
Watt-Tool-8B-Q3_K_S 61.7135 ±1.7797 74.00 37.2000 ±1.7661 35.6707 ±2.6490 71.8667 ±1.6430 56.09
Watt-Tool-8B-Q4_K_M 64.6586 ±1.7502 75.33 40.2667 ±1.7920 34.2679 ±2.6531 74.0000 ±1.6027 57.70
Watt-Tool-8B-Q4_K_M (naive) 62.5668 ±1.7707 77.73 42.0000 ±1.8034 36.8098 ±2.6753 73.6000 ±1.6106 58.54
Watt-Tool-8B-Q4_K_S 63.4538 ±1.7631 79.47 40.2667 ±1.7920 33.6420 ±2.6290 75.2000 ±1.5780 58.41
Watt-Tool-8B-Q5_K_M 64.1711 ±1.7544 80.53 41.7333 ±1.8018 34.6875 ±2.6650 74.2667 ±1.5974 59.08
Watt-Tool-8B-Q5_K_S 65.6417 ±1.7376 77.20 41.0667 ±1.7976 36.1371 ±2.6855 73.6000 ±1.6106 58.73
Watt-Tool-8B-Q6_K 64.9733 ±1.7454 77.20 38.1333 ±1.7748 33.8509 ±2.6412 73.8667 ±1.6054 57.60
Watt-Tool-8B-Q8_0 64.5248 ±1.7517 76.80 40.4000 ±1.7930 35.6467 ±2.6943 72.6667 ±1.6284 58.01
Watt-Tool-8B-F16 65.2870 ±1.7406 80.93 42.1333 ±1.8042 36.1963 ±2.6657 74.0000 ±1.6027 59.71

Tokens per Second - Benchmarks

Scores generated using llama-bench. Naive Q4_K_M quantization included for comparison.

model size params backend threads test t/s
Watt-Tool-8B-Q4_K_M 4.13 GiB 8.03 B Metal,BLAS 6 pp512 332.49 ± 0.84
Watt-Tool-8B-Q4_K_M 4.13 GiB 8.03 B Metal,BLAS 6 tg128 27.68 ± 0.12
Watt-Tool-8B-Q4_K_M 4.13 GiB 8.03 B Metal,BLAS 6 pp1024+tg1024 44.66 ± 0.04
Watt-Tool-8B-Q4_K_M (naive) 4.58 GiB 8.03 B Metal,BLAS 6 pp512 327.42 ± 0.47
Watt-Tool-8B-Q4_K_M (naive) 4.58 GiB 8.03 B Metal,BLAS 6 tg128 26.18 ± 0.08
Watt-Tool-8B-Q4_K_M (naive) 4.58 GiB 8.03 B Metal,BLAS 6 pp1024+tg1024 42.69 ± 0.09

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 original 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 ggml/gguf libraries.