Spaces:
Running
on
Zero
Running
on
Zero
louisbrulenaudet
commited on
Commit
•
fcc6ad1
1
Parent(s):
028de94
Update README.md
Browse files
README.md
CHANGED
@@ -10,74 +10,114 @@ pinned: true
|
|
10 |
license: apache-2.0
|
11 |
short_description: Pearl-7B, an xtraordinary Space
|
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 |
-
## Citing this project
|
71 |
If you use this code in your research, please use the following BibTeX entry.
|
72 |
|
73 |
```BibTeX
|
74 |
-
@misc{
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
}
|
80 |
-
|
81 |
```
|
|
|
82 |
## Feedback
|
83 |
-
|
|
|
|
10 |
license: apache-2.0
|
11 |
short_description: Pearl-7B, an xtraordinary Space
|
12 |
---
|
13 |
+
<center><img src='https://i.imgur.com/0xFTuAX.png' width='450px'></center>
|
14 |
+
|
15 |
+
# Pearl-7B-0211-ties, an xtraordinary 7B model
|
16 |
+
|
17 |
+
**03-22-2024 - To date, louisbrulenaudet/Pearl-34B-ties is the "Best 🤝 base merges and moerges model of around 30B" on the Open LLM Leaderboard.**
|
18 |
+
|
19 |
+
Pearl-7B-0211-ties is a merge of the following models:
|
20 |
+
* [louisbrulenaudet/Pearl-7B-slerp](https://huggingface.co/louisbrulenaudet/Pearl-7B-slerp)
|
21 |
+
* [WizardLM/WizardMath-7B-V1.1](https://huggingface.co/WizardLM/WizardMath-7B-V1.1)
|
22 |
+
* [cognitivecomputations/WestLake-7B-v2-laser](https://huggingface.co/cognitivecomputations/WestLake-7B-v2-laser)
|
23 |
+
* [CultriX/NeuralTrix-7B-dpo](https://huggingface.co/CultriX/NeuralTrix-7B-dpo)
|
24 |
+
|
25 |
+
## Evaluation
|
26 |
+
|
27 |
+
The evaluation was performed using the HuggingFace Open LLM Leaderboard.
|
28 |
+
|
29 |
+
| Model | Average | ARC | HellaSwag | MMLU | TruthfulQA | Winogrande | GSM8K | #Params (B) |
|
30 |
+
|--------------------------------------------------|---------|-------|-----------|-------|------------|------------|-------|--------------|
|
31 |
+
| **louisbrulenaudet/Pearl-34B-ties** | **75.48** | 70.99 | 84.83 | **76.63** | 70.32 | 82.64 | 67.48 | 34.39 |
|
32 |
+
| **louisbrulenaudet/Pearl-7B-0211-ties** | **75.11** | **71.42** | **88.86** | 63.91 | **71.46** | **84.37** | 70.66 | 7.24 |
|
33 |
+
| NousResearch/Nous-Hermes-2-Mixtral-8x7B-DPO | 73.35 | 71.08 | 87.29 | 72.17 | 54.83 | 83.11 | 71.65 | 46.7 |
|
34 |
+
| argilla/notus-8x7b-experiment | 73.18 | 70.99 | 87.73 | 71.33 | 65.79 | 81.61 | 61.64 | 46.7 |
|
35 |
+
| **louisbrulenaudet/Pearl-7B-slerp** | 72.75 | 68.00 | 87.16 | 64.04 | 62.35 | 81.29 | **73.62** | 7.24 |
|
36 |
+
| mistralai/Mixtral-8x7B-Instruct-v0.1 | 72.7 | 70.14 | 87.55 | 71.4 | 64.98 | 81.06 | 61.11 | 46.7 |
|
37 |
+
| microsoft/Orca-2-13b | 61.98 | 60.92 | 79.85 | 60.3 | 56.42 | 76.56 | 37.83 | 13 |
|
38 |
+
| microsoft/phi-2 | 61.33 | 61.09 | 75.11 | 58.11 | 44.47 | 74.35 | 54.81 | 2.78 |
|
39 |
+
|
40 |
+
### Ties merging
|
41 |
+
|
42 |
+
TIES-Merging is a method designed to facilitate the efficient merging of multiple task-specific models into a consolidated multitask model. It addresses two primary challenges encountered in the process of model merging with a focus on maintaining objectivity.
|
43 |
+
|
44 |
+
One key challenge tackled by TIES-Merging involves addressing redundancy in model parameters. This is achieved by identifying and eliminating redundant parameters within task-specific models, emphasizing the changes made during fine-tuning and selectively retaining the top-k% most significant changes while discarding the rest.
|
45 |
+
|
46 |
+
Another challenge pertains to conflicts arising from disagreements between parameter signs across different models. TIES-Merging resolves these conflicts by creating a unified sign vector representing the most dominant direction of change across all models.
|
47 |
+
|
48 |
+
The TIES-Merging process consists of three steps:
|
49 |
+
|
50 |
+
- Trim: Reduces redundancy in task-specific models by retaining a fraction of the most significant parameters (density parameter) and resetting the remaining parameters to zero.
|
51 |
+
- Elect Sign: Resolves sign conflicts across different models by creating a unified sign vector based on the most dominant direction (positive or negative) in terms of cumulative magnitude.
|
52 |
+
- Disjoint Merge: Averages parameter values aligned with the unified sign vector, excluding zero values.
|
53 |
+
|
54 |
+
## Configuration
|
55 |
+
|
56 |
+
```yaml
|
57 |
+
models:
|
58 |
+
- model: OpenPipe/mistral-ft-optimized-1227
|
59 |
+
- model: louisbrulenaudet/Pearl-7B-slerp
|
60 |
+
parameters:
|
61 |
+
density: 0.6
|
62 |
+
weight: 0.3
|
63 |
+
- model: WizardLM/WizardMath-7B-V1.1
|
64 |
+
parameters:
|
65 |
+
density: 0.55
|
66 |
+
weight: 0.2
|
67 |
+
- model: cognitivecomputations/WestLake-7B-v2-laser
|
68 |
+
parameters:
|
69 |
+
density: 0.55
|
70 |
+
weight: 0.25
|
71 |
+
- model: CultriX/NeuralTrix-7B-dpo
|
72 |
+
parameters:
|
73 |
+
density: 0.6
|
74 |
+
weight: 0.25
|
75 |
+
merge_method: ties
|
76 |
+
base_model: OpenPipe/mistral-ft-optimized-1227
|
77 |
+
parameters:
|
78 |
+
normalize: true
|
79 |
+
int8_mask: true
|
80 |
+
dtype: float16
|
81 |
```
|
82 |
|
83 |
+
## Usage
|
84 |
|
85 |
+
```python
|
86 |
+
!pip install -qU transformers accelerate
|
87 |
|
88 |
+
from transformers import AutoTokenizer
|
89 |
+
import transformers
|
90 |
+
import torch
|
91 |
|
92 |
+
model = "louisbrulenaudet/Pearl-7B-0211-ties"
|
93 |
+
messages = [{"role": "user", "content": "What is a large language model?"}]
|
94 |
|
95 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
96 |
+
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
97 |
+
pipeline = transformers.pipeline(
|
98 |
+
"text-generation",
|
99 |
+
model=model,
|
100 |
+
torch_dtype=torch.float16,
|
101 |
+
device_map="auto",
|
102 |
+
)
|
103 |
|
104 |
+
outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
105 |
+
print(outputs[0]["generated_text"])
|
106 |
+
```
|
107 |
|
108 |
+
## Citing & Authors
|
109 |
|
|
|
110 |
If you use this code in your research, please use the following BibTeX entry.
|
111 |
|
112 |
```BibTeX
|
113 |
+
@misc{louisbrulenaudet2024,
|
114 |
+
author = {Louis Brulé Naudet},
|
115 |
+
title = {Pearl-7B-0211-ties, an xtraordinary 7B model},
|
116 |
+
year = {2024}
|
117 |
+
howpublished = {\url{https://huggingface.co/louisbrulenaudet/Pearl-7B-0211-ties}},
|
118 |
}
|
|
|
119 |
```
|
120 |
+
|
121 |
## Feedback
|
122 |
+
|
123 |
+
If you have any feedback, please reach out at [louisbrulenaudet@icloud.com](mailto:louisbrulenaudet@icloud.com).
|