UnstableLlama
commited on
Commit
•
feb5991
1
Parent(s):
ca456e2
Upload 8 files
Browse files- README.md +172 -0
- config.json +26 -0
- generation_config.json +10 -0
- measurement.json +0 -0
- model.safetensors +3 -0
- special_tokens_map.json +24 -0
- tokenizer.model +3 -0
- tokenizer_config.json +35 -0
README.md
ADDED
@@ -0,0 +1,172 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: https://huggingface.co/Xwin-LM/Xwin-LM-7B-V0.1
|
3 |
+
inference: false
|
4 |
+
license: llama2
|
5 |
+
model_creator: Xwin-LM
|
6 |
+
model_name: Xwin-LM 13B V0.1
|
7 |
+
model_type: llama
|
8 |
+
prompt_template: 'Below is an instruction that describes a task. Write a response
|
9 |
+
that appropriately completes the request.
|
10 |
+
|
11 |
+
|
12 |
+
### Instruction:
|
13 |
+
|
14 |
+
{prompt}
|
15 |
+
|
16 |
+
|
17 |
+
### Response:
|
18 |
+
|
19 |
+
'
|
20 |
+
quantized_by: UnstableLlama
|
21 |
+
---
|
22 |
+
---
|
23 |
+
4.65bpw ExLlamaV2 quantization by UnstableLlama
|
24 |
+
|
25 |
+
license: llama2
|
26 |
+
---
|
27 |
+
|
28 |
+
<h3 align="center">
|
29 |
+
Xwin-LM: Powerful, Stable, and Reproducible LLM Alignment
|
30 |
+
</h3>
|
31 |
+
|
32 |
+
<p align="center">
|
33 |
+
<a href="https://github.com/Xwin-LM/Xwin-LM"><img src="https://img.shields.io/badge/GitHub-yellow.svg?style=social&logo=github"></a><a href="https://huggingface.co/Xwin-LM"><img src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Models-blue"></a>
|
34 |
+
</p>
|
35 |
+
|
36 |
+
|
37 |
+
|
38 |
+
**Step up your LLM alignment with Xwin-LM!**
|
39 |
+
|
40 |
+
Xwin-LM aims to develop and open-source alignment technologies for large language models, including supervised fine-tuning (SFT), reward models (RM), reject sampling, reinforcement learning from human feedback (RLHF), etc. Our first release, built-upon on the Llama2 base models, ranked **TOP-1** on [AlpacaEval](https://tatsu-lab.github.io/alpaca_eval/). Notably, it's **the first to surpass GPT-4** on this benchmark. The project will be continuously updated.
|
41 |
+
|
42 |
+
## News
|
43 |
+
|
44 |
+
- 💥 [Sep, 2023] We released [Xwin-LM-70B-V0.1](https://huggingface.co/Xwin-LM/Xwin-LM-70B-V0.1), which has achieved a win-rate against Davinci-003 of **95.57%** on [AlpacaEval](https://tatsu-lab.github.io/alpaca_eval/) benchmark, ranking as **TOP-1** on AlpacaEval. **It was the FIRST model surpassing GPT-4** on [AlpacaEval](https://tatsu-lab.github.io/alpaca_eval/). Also note its winrate v.s. GPT-4 is **60.61**.
|
45 |
+
- 🔍 [Sep, 2023] RLHF plays crucial role in the strong performance of Xwin-LM-V0.1 release!
|
46 |
+
- 💥 [Sep, 2023] We released [Xwin-LM-13B-V0.1](https://huggingface.co/Xwin-LM/Xwin-LM-13B-V0.1), which has achieved **91.76%** win-rate on [AlpacaEval](https://tatsu-lab.github.io/alpaca_eval/), ranking as **top-1** among all 13B models.
|
47 |
+
- 💥 [Sep, 2023] We released [Xwin-LM-7B-V0.1](https://huggingface.co/Xwin-LM/Xwin-LM-7B-V0.1), which has achieved **87.82%** win-rate on [AlpacaEval](https://tatsu-lab.github.io/alpaca_eval/), ranking as **top-1** among all 7B models.
|
48 |
+
|
49 |
+
|
50 |
+
## Model Card
|
51 |
+
| Model | Checkpoint | Report | License |
|
52 |
+
|------------|------------|-------------|------------------|
|
53 |
+
|Xwin-LM-7B-V0.1| 🤗 <a href="https://huggingface.co/Xwin-LM/Xwin-LM-7B-V0.1" target="_blank">HF Link</a> | 📃**Coming soon (Stay tuned)** | <a href="https://ai.meta.com/resources/models-and-libraries/llama-downloads/" target="_blank">Llama 2 License|
|
54 |
+
|Xwin-LM-13B-V0.1| 🤗 <a href="https://huggingface.co/Xwin-LM/Xwin-LM-13B-V0.1" target="_blank">HF Link</a> | | <a href="https://ai.meta.com/resources/models-and-libraries/llama-downloads/" target="_blank">Llama 2 License|
|
55 |
+
|Xwin-LM-70B-V0.1| 🤗 <a href="https://huggingface.co/Xwin-LM/Xwin-LM-70B-V0.1" target="_blank">HF Link</a> | | <a href="https://ai.meta.com/resources/models-and-libraries/llama-downloads/" target="_blank">Llama 2 License|
|
56 |
+
## Benchmarks
|
57 |
+
|
58 |
+
### Xwin-LM performance on [AlpacaEval](https://tatsu-lab.github.io/alpaca_eval/).
|
59 |
+
|
60 |
+
The table below displays the performance of Xwin-LM on [AlpacaEval](https://tatsu-lab.github.io/alpaca_eval/), where evaluates its win-rate against Text-Davinci-003 across 805 questions. To provide a comprehensive evaluation, we present, for the first time, the win-rate against ChatGPT and GPT-4 as well. Our Xwin-LM model family establish a new state-of-the-art performance across all metrics. Notably, Xwin-LM-70B-V0.1 has eclipsed GPT-4 for the first time, achieving an impressive win-rate of **95.57%** to Text-Davinci-003 and **60.61%** to GPT-4.
|
61 |
+
|
62 |
+
| **Model** | **AlpacaEval (winrate %)** | **AlpacaEval (winrate %)** |**AlpacaEval (winrate %)** |
|
63 |
+
|----------------------------------|------------|----------|-------------|
|
64 |
+
| | **v.s. Text-Davinci-003** | **v.s. ChatGPT** | **v.s. GPT4**|
|
65 |
+
| **Xwin-LM-70B-V0.1** | **95.57** | **87.50** | **60.61** |
|
66 |
+
| GPT-4 | 95.28 | 84.66 | 50.00 |
|
67 |
+
| WizardLM-70B-V1.0 | 92.91 | 80.19 | 46.70 |
|
68 |
+
| Llama-2-70B-Chat | 92.66 | 81.97 | 51.19 |
|
69 |
+
| **Xwin-LM-13B-V0.1** | **91.76** | **81.79** | **55.30** |
|
70 |
+
| ChatGPT | 89.37 | 50.00 | 16.60 |
|
71 |
+
| WizardLM-13B-V1.2 | 89.17 | 75.75 | 41.91 |
|
72 |
+
| **Xwin-LM-7B-V0.1** | **87.35** | **76.40** | **47.57** |
|
73 |
+
| Llama-2-13B-Chat | 81.09 | 64.22 | 30.92 |
|
74 |
+
|
75 |
+
### Case study on [AlpacaEval](https://tatsu-lab.github.io/alpaca_eval/)
|
76 |
+
|
77 |
+
| Prompts | GTP4 response | Xwin-LM response |
|
78 |
+
|----------------|------------|--------|
|
79 |
+
|I've put a plate on top of an apple, and take the plate from kitchen to dinning room. Where is the apple now|The apple is now in the dining room, as it was underneath the plate when you moved the plate from the kitchen to the dining room.|The apple is still in the kitchen, as you have only moved the plate. The apple is under the plate, so if you want to bring the apple to the dining room, you should either move the apple directly or put the apple on the plate and then move the plate to the dining room.|
|
80 |
+
| Answer the following question.<br> How do you say "good evening" in French. | In French, "good evening" is said as "bonsoir." | In French, "good evening" is translated to "bonsoir." This greeting is used in the evening and nighttime hours, typically after 6 p.m. It is a combination of "bon," which means "good," and "soir," which means "evening." To pronounce it, say "bone-swahr." |
|
81 |
+
|
82 |
+
|
83 |
+
### Xwin-LM performance on NLP foundation tasks.
|
84 |
+
|
85 |
+
The following table provides a comparison of Xwin-LMs with other LLMs on NLP foundation tasks in [Open LLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard).
|
86 |
+
|
87 |
+
| Model | MMLU 5-shot | ARC 25-shot | TruthfulQA 0-shot | HellaSwag 10-shot | Average |
|
88 |
+
|------------------|-------------|-------------|-------------------|-------------------|------------|
|
89 |
+
| Text-davinci-003 | 56.9 | **85.2** | 59.3 | 82.2 | 70.9 |
|
90 |
+
|Vicuna-13b 1.1 | 51.3 | 53.0 | 51.8 | 80.1 | 59.1 |
|
91 |
+
|Guanaco 30B | 57.6 | 63.7 | 50.7 | 85.1 | 64.3 |
|
92 |
+
| WizardLM-7B 1.0 | 42.7 | 51.6 | 44.7 | 77.7 | 54.2 |
|
93 |
+
| WizardLM-13B 1.0 | 52.3 | 57.2 | 50.5 | 81.0 | 60.2 |
|
94 |
+
| WizardLM-30B 1.0 | 58.8 | 62.5 | 52.4 | 83.3 | 64.2|
|
95 |
+
| Llama-2-7B-Chat | 48.3 | 52.9 | 45.6 | 78.6 | 56.4 |
|
96 |
+
| Llama-2-13B-Chat | 54.6 | 59.0 | 44.1 | 81.9 | 59.9 |
|
97 |
+
| Llama-2-70B-Chat | 63.9 | 64.6 | 52.8 | 85.9 | 66.8 |
|
98 |
+
| **Xwin-LM-7B-V0.1** | 49.7 | 56.2 | 48.1 | 79.5 | 58.4 |
|
99 |
+
| **Xwin-LM-13B-V0.1** | 56.6 | 62.4 | 45.5 | 83.0 | 61.9 |
|
100 |
+
| **Xwin-LM-70B-V0.1** | **69.6** | 70.5 | **60.1** | **87.1** | **71.8** |
|
101 |
+
|
102 |
+
|
103 |
+
## Inference
|
104 |
+
|
105 |
+
### Conversation templates
|
106 |
+
To obtain desired results, please strictly follow the conversation templates when utilizing our model for inference. Our model adopts the prompt format established by [Vicuna](https://github.com/lm-sys/FastChat) and is equipped to support **multi-turn** conversations.
|
107 |
+
```
|
108 |
+
A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. USER: Hi! ASSISTANT: Hello.</s>USER: Who are you? ASSISTANT: I am Xwin-LM.</s>......
|
109 |
+
```
|
110 |
+
|
111 |
+
### HuggingFace Example
|
112 |
+
|
113 |
+
```python
|
114 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
115 |
+
|
116 |
+
model = AutoModelForCausalLM.from_pretrained("Xwin-LM/Xwin-LM-7B-V0.1")
|
117 |
+
tokenizer = AutoTokenizer.from_pretrained("Xwin-LM/Xwin-LM-7B-V0.1")
|
118 |
+
(
|
119 |
+
prompt := "A chat between a curious user and an artificial intelligence assistant. "
|
120 |
+
"The assistant gives helpful, detailed, and polite answers to the user's questions. "
|
121 |
+
"USER: Hello, can you help me? "
|
122 |
+
"ASSISTANT:"
|
123 |
+
)
|
124 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
125 |
+
samples = model.generate(**inputs, max_new_tokens=4096, temperature=0.7)
|
126 |
+
output = tokenizer.decode(samples[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)
|
127 |
+
print(output)
|
128 |
+
# Of course! I'm here to help. Please feel free to ask your question or describe the issue you're having, and I'll do my best to assist you.
|
129 |
+
```
|
130 |
+
|
131 |
+
|
132 |
+
### vllm Example
|
133 |
+
Because Xwin-LM is based on Llama2, it also offers support for rapid inference using [vllm](https://github.com/vllm-project/vllm). Please refer to [vllm](https://github.com/vllm-project/vllm) for detailed installation instructions.
|
134 |
+
```python
|
135 |
+
from vllm import LLM, SamplingParams
|
136 |
+
(
|
137 |
+
prompt := "A chat between a curious user and an artificial intelligence assistant. "
|
138 |
+
"The assistant gives helpful, detailed, and polite answers to the user's questions. "
|
139 |
+
"USER: Hello, can you help me? "
|
140 |
+
"ASSISTANT:"
|
141 |
+
)
|
142 |
+
sampling_params = SamplingParams(temperature=0.7, max_tokens=4096)
|
143 |
+
llm = LLM(model="Xwin-LM/Xwin-LM-7B-V0.1")
|
144 |
+
outputs = llm.generate([prompt,], sampling_params)
|
145 |
+
|
146 |
+
for output in outputs:
|
147 |
+
prompt = output.prompt
|
148 |
+
generated_text = output.outputs[0].text
|
149 |
+
print(generated_text)
|
150 |
+
```
|
151 |
+
|
152 |
+
## TODO
|
153 |
+
|
154 |
+
- [ ] Release the source code
|
155 |
+
- [ ] Release more capabilities, such as math, reasoning, and etc.
|
156 |
+
|
157 |
+
## Citation
|
158 |
+
Please consider citing our work if you use the data or code in this repo.
|
159 |
+
```
|
160 |
+
@software{xwin-lm,
|
161 |
+
title = {Xwin-LM},
|
162 |
+
author = {Xwin-LM Team},
|
163 |
+
url = {https://github.com/Xwin-LM/Xwin-LM},
|
164 |
+
version = {pre-release},
|
165 |
+
year = {2023},
|
166 |
+
month = {9},
|
167 |
+
}
|
168 |
+
```
|
169 |
+
|
170 |
+
## Acknowledgements
|
171 |
+
|
172 |
+
Thanks to [Llama 2](https://ai.meta.com/llama/), [FastChat](https://github.com/lm-sys/FastChat), [AlpacaFarm](https://github.com/tatsu-lab/alpaca_farm), and [vllm](https://github.com/vllm-project/vllm).
|
config.json
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "meta-llama/Llama-2-13b-hf",
|
3 |
+
"architectures": [
|
4 |
+
"LlamaForCausalLM"
|
5 |
+
],
|
6 |
+
"bos_token_id": 1,
|
7 |
+
"eos_token_id": 2,
|
8 |
+
"hidden_act": "silu",
|
9 |
+
"hidden_size": 5120,
|
10 |
+
"initializer_range": 0.02,
|
11 |
+
"intermediate_size": 13824,
|
12 |
+
"max_position_embeddings": 4096,
|
13 |
+
"model_type": "llama",
|
14 |
+
"num_attention_heads": 40,
|
15 |
+
"num_hidden_layers": 40,
|
16 |
+
"num_key_value_heads": 40,
|
17 |
+
"pad_token_id": 0,
|
18 |
+
"pretraining_tp": 1,
|
19 |
+
"rms_norm_eps": 1e-05,
|
20 |
+
"rope_scaling": null,
|
21 |
+
"tie_word_embeddings": false,
|
22 |
+
"torch_dtype": "float32",
|
23 |
+
"transformers_version": "4.28.1",
|
24 |
+
"use_cache": false,
|
25 |
+
"vocab_size": 32000
|
26 |
+
}
|
generation_config.json
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token_id": 1,
|
3 |
+
"do_sample": true,
|
4 |
+
"eos_token_id": 2,
|
5 |
+
"max_length": 4096,
|
6 |
+
"pad_token_id": 0,
|
7 |
+
"temperature": 0.6,
|
8 |
+
"top_p": 0.9,
|
9 |
+
"transformers_version": "4.28.1"
|
10 |
+
}
|
measurement.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d9ac027ed0f680ec2208dd815031f8e2ad0777cf40e13fa3693678bc976e9f40
|
3 |
+
size 6812045208
|
special_tokens_map.json
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": {
|
3 |
+
"content": "<s>",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": false,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"eos_token": {
|
10 |
+
"content": "</s>",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": false,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"pad_token": "<unk>",
|
17 |
+
"unk_token": {
|
18 |
+
"content": "<unk>",
|
19 |
+
"lstrip": false,
|
20 |
+
"normalized": false,
|
21 |
+
"rstrip": false,
|
22 |
+
"single_word": false
|
23 |
+
}
|
24 |
+
}
|
tokenizer.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347
|
3 |
+
size 499723
|
tokenizer_config.json
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_bos_token": true,
|
3 |
+
"add_eos_token": false,
|
4 |
+
"bos_token": {
|
5 |
+
"__type": "AddedToken",
|
6 |
+
"content": "<s>",
|
7 |
+
"lstrip": false,
|
8 |
+
"normalized": false,
|
9 |
+
"rstrip": false,
|
10 |
+
"single_word": false
|
11 |
+
},
|
12 |
+
"clean_up_tokenization_spaces": false,
|
13 |
+
"eos_token": {
|
14 |
+
"__type": "AddedToken",
|
15 |
+
"content": "</s>",
|
16 |
+
"lstrip": false,
|
17 |
+
"normalized": false,
|
18 |
+
"rstrip": false,
|
19 |
+
"single_word": false
|
20 |
+
},
|
21 |
+
"legacy": false,
|
22 |
+
"model_max_length": 4096,
|
23 |
+
"pad_token": null,
|
24 |
+
"padding_side": "right",
|
25 |
+
"sp_model_kwargs": {},
|
26 |
+
"tokenizer_class": "LlamaTokenizer",
|
27 |
+
"unk_token": {
|
28 |
+
"__type": "AddedToken",
|
29 |
+
"content": "<unk>",
|
30 |
+
"lstrip": false,
|
31 |
+
"normalized": false,
|
32 |
+
"rstrip": false,
|
33 |
+
"single_word": false
|
34 |
+
}
|
35 |
+
}
|