File size: 5,710 Bytes
3046134 f2923ec 3046134 |
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 |
---
license: apache-2.0
---
**Exllamav2** quant (**exl2** / **3.5 bpw**) made with ExLlamaV2 v0.1.1
Other EXL2 quants:
| **Quant** | **Model Size** | **lm_head** |
| ----- | ---------- | ------- |
|<center>**[2.2](https://huggingface.co/Zoyd/LLM360_K2-Chat-2_2bpw_exl2)**</center> | <center>17685 MB</center> | <center>6</center> |
|<center>**[2.5](https://huggingface.co/Zoyd/LLM360_K2-Chat-2_5bpw_exl2)**</center> | <center>20000 MB</center> | <center>6</center> |
|<center>**[3.0](https://huggingface.co/Zoyd/LLM360_K2-Chat-3_0bpw_exl2)**</center> | <center>23857 MB</center> | <center>6</center> |
|<center>**[3.5](https://huggingface.co/Zoyd/LLM360_K2-Chat-3_5bpw_exl2)**</center> | <center>27721 MB</center> | <center>6</center> |
|<center>**[3.75](https://huggingface.co/Zoyd/LLM360_K2-Chat-3_75bpw_exl2)**</center> | <center>29647 MB</center> | <center>6</center> |
|<center>**[4.0](https://huggingface.co/Zoyd/LLM360_K2-Chat-4_0bpw_exl2)**</center> | <center>31549 MB</center> | <center>6</center> |
|<center>**[4.25](https://huggingface.co/Zoyd/LLM360_K2-Chat-4_25bpw_exl2)**</center> | <center>33505 MB</center> | <center>6</center> |
|<center>**[5.0](https://huggingface.co/Zoyd/LLM360_K2-Chat-5_0bpw_exl2)**</center> | <center>39300 MB</center> | <center>6</center> |
|<center>**[6.0](https://huggingface.co/Zoyd/LLM360_K2-Chat-6_0bpw_exl2)**</center> | <center>46927 MB</center> | <center>8</center> |
|<center>**[6.5](https://huggingface.co/Zoyd/LLM360_K2-Chat-6_5bpw_exl2)**</center> | <center>50613 MB</center> | <center>8</center> |
|<center>**[8.0](https://huggingface.co/Zoyd/LLM360_K2-Chat-8_0bpw_exl2)**</center> | <center>49516 MB</center> | <center>8</center> |
# K2-Chat: a fully-reproducible large language model outperforming Llama 2 70B Chat using 35% less compute
K2 Chat is finetuned from [K2-65B](https://huggingface.co/LLM360/K2). K2 Chat outperforms Llama 2-70B-Chat on all evaluations conducted. The model also outperforms Llama 3-70B-Instruct on coding tasks.
<center><img src="k2_chat_eval_table.png" alt="k2 eval table" /></center>
## LLM360 Model Performance and Evaluation Collection
The LLM360 Performance and Evaluation Collection is a robust evaluations set consisting of general and domain specific evaluations to assess model knowledge and function.
Evaluations include standard best practice benchmarks, medical, math, and coding knowledge. More about the evaluations can be found here.
<center><img src="k2_chat_table_of_tables.png" alt="k2 big eval table"/></center>
## Datasets and Mix
| Subset | #Tokens | Avg. #Q | Avg. Query Len | Avg. #R | Avg. Reply Len |
| ----------- | ----------- |----------- |----------- |----------- |----------- |
| [MathInstruct](https://huggingface.co/datasets/TIGER-Lab/MathInstruct) | 66,639,699 | 1.00 | 81.53 | 1.00 | 172.78 |
| [OpenHermes-2](https://huggingface.co/datasets/teknium/OpenHermes-2.5) |404,820,694 | 1.01 | 152.38 | 1.01 | 249.12 |
| [FLAN_3M](https://arxiv.org/abs/2109.01652) | 2,346,961,387 | 1.00 | 727.49 | 1.00 | 54.83 |
| [Standford Encyclopedia Philosophy](https://huggingface.co/datasets/AiresPucrs/stanford-encyclopedia-philosophy) | 786,928 | 1.00 | 219.09 | 1.00 | 166.28 |
| [TinyStories](https://huggingface.co/datasets/roneneldan/TinyStories) | 1,448,898 | 1.00 | 260.82 | 1.00 | 207.47 |
| Safety & Alignment Data | 99,976,621 | 1.00 | 126.71 | 1.00 | 373.79 |
| Total | 2,920,634,227
## Loading K2-Chat
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("LLM360/K2-Chat")
model = AutoModelForCausalLM.from_pretrained("LLM360/K2-Chat")
prompt = '<|beginofuser|>what is the highest mountain on earth?<|beginofsystem|>'
input_ids = tokenizer(prompt, return_tensors="pt").input_ids
gen_tokens = model.generate(input_ids, do_sample=True, max_new_tokens=128)
print("-"*20 + "Output for model" + 20 * '-')
print(tokenizer.batch_decode(gen_tokens)[0])
```
Alternatively, you can construct the prompt by applying the chat template of tokenizer on input conversation:
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("LLM360/K2-Chat")
model = AutoModelForCausalLM.from_pretrained("LLM360/K2-Chat")
messages = [{"role": "user", "content": "what is the highest mountain on earth?"}]
input_ids = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt")
gen_tokens = model.generate(input_ids, do_sample=True, max_new_tokens=128)
print("-"*20 + "Output for model" + 20 * '-')
print(tokenizer.batch_decode(gen_tokens)[0])
```
## LLM360 Developer Suite
We provide step-by-step finetuning tutorials for tech enthusiasts, AI practitioners and academic or industry researchers [here](https://www.llm360.ai/developer.html).
## About LLM360
LLM360 is an open research lab enabling community-owned AGI through open-source large model research and development.
LLM360 enables community-owned AGI by creating standards and tools to advance the bleeding edge of LLM capability and empower knowledge transfer, research, and development.
We believe in a future where artificial general intelligence (AGI) is created by the community, for the community. Through an open ecosystem of equitable computational resources, high quality data, and flowing technical knowledge, we can ensure ethical AGI development and universal access for all innovators.
[Visit us](https://www.llm360.ai/)
## Citation
**BibTeX:**
```bibtex
@article{
title={LLM360 K2-65B: Scaling Up Fully Transparent Open-Source LLMs},
author={The LLM360 Team},
year={2024},
}
``` |