DhiyaEddine
commited on
Commit
•
e2a1b27
1
Parent(s):
3825618
Update README.md
Browse files
README.md
CHANGED
@@ -1,199 +1,227 @@
|
|
1 |
---
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
4 |
---
|
5 |
|
6 |
-
#
|
7 |
-
|
8 |
-
<!-- Provide a quick summary of what the model is/does. -->
|
9 |
|
|
|
10 |
|
|
|
|
|
11 |
|
12 |
## Model Details
|
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 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
tags:
|
5 |
+
- falcon3-Mamba-Instruct
|
6 |
+
base_model:
|
7 |
+
- tiiuae/Falcon3-Mamba-7B-Base
|
8 |
---
|
9 |
|
10 |
+
# Falcon3-Mamba-7B-Instruct
|
|
|
|
|
11 |
|
12 |
+
**Falcon3** family of Open Foundation Models is a set of pretrained and instruct LLMs ranging from 1B to 10B.
|
13 |
|
14 |
+
This repository contains the **Falcon3-Mamba-7B-Instruct**. It achieves ,compared to similar SSM-based models of the same size, state of art results (at release's time) on reasoning, language understanding, instruction following, code and mathematics tasks.
|
15 |
+
Falcon3-Mamba-7B-Instruct supports a context length up to 32K and 1 language (english).
|
16 |
|
17 |
## Model Details
|
18 |
+
- Architecture(same as Falcon-Mamba-7b)
|
19 |
+
- Mamba1 based causal decoder only architecture trained on a causal language modeling task (i.e., predict the next token).
|
20 |
+
- 64 decoder blocks
|
21 |
+
- width: 4096
|
22 |
+
- state_size: 16
|
23 |
+
- 32k context length
|
24 |
+
- 65k vocab size
|
25 |
+
- Pretrained on 7 Teratokens of datasets comprising of web, code, STEM and high quality data using 2048 H100 GPU chips
|
26 |
+
- Postrained on 1.2 million samples of STEM, conversations, code, and safety.
|
27 |
+
- Developed by [Technology Innovation Institute](https://www.tii.ae)
|
28 |
+
- License: TII Falcon-LLM License 2.0
|
29 |
+
- Model Release Date: December 2024
|
30 |
+
|
31 |
+
|
32 |
+
## Getting started
|
33 |
+
|
34 |
+
<details>
|
35 |
+
<summary> Click to expand </summary>
|
36 |
+
|
37 |
+
```python
|
38 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
39 |
+
|
40 |
+
|
41 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
42 |
+
|
43 |
+
model_name = "tiiuae/Falcon3-Mamba-7B-Instruct"
|
44 |
+
|
45 |
+
model = AutoModelForCausalLM.from_pretrained(
|
46 |
+
model_name,
|
47 |
+
torch_dtype="auto",
|
48 |
+
device_map="auto"
|
49 |
+
)
|
50 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
51 |
+
|
52 |
+
prompt = "How many hours in one day?"
|
53 |
+
messages = [
|
54 |
+
{"role": "system", "content": "You are a helpful friendly assistant Falcon3 from TII, try to follow instructions as much as possible."},
|
55 |
+
{"role": "user", "content": prompt}
|
56 |
+
]
|
57 |
+
text = tokenizer.apply_chat_template(
|
58 |
+
messages,
|
59 |
+
tokenize=False,
|
60 |
+
add_generation_prompt=True
|
61 |
+
)
|
62 |
+
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
|
63 |
+
|
64 |
+
generated_ids = model.generate(
|
65 |
+
**model_inputs,
|
66 |
+
max_new_tokens=1024
|
67 |
+
)
|
68 |
+
generated_ids = [
|
69 |
+
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
|
70 |
+
]
|
71 |
+
|
72 |
+
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
73 |
+
print(response)
|
74 |
+
```
|
75 |
+
|
76 |
+
</details>
|
77 |
+
|
78 |
+
<br>
|
79 |
+
|
80 |
+
# Benchmarks
|
81 |
+
We report in the following table our internal pipeline benchmarks:
|
82 |
+
|
83 |
+
<table border="1" style="width: 100%; text-align: center; border-collapse: collapse;">
|
84 |
+
<colgroup>
|
85 |
+
<col style="width: 10%;">
|
86 |
+
<col style="width: 10%;">
|
87 |
+
<col style="width: 7%;">
|
88 |
+
<col style="width: 7%;">
|
89 |
+
<col style="width: 7%;">
|
90 |
+
<col style="width: 7%;">
|
91 |
+
<col style="background-color: rgba(80, 15, 213, 0.5); width: 7%;">
|
92 |
+
</colgroup>
|
93 |
+
<thead>
|
94 |
+
<tr>
|
95 |
+
<th>Category</th>
|
96 |
+
<th>Benchmark</th>
|
97 |
+
<th>Zamba2-7B-instruct</th>
|
98 |
+
<th>Jamba-1.5-Mini-instruct</th>
|
99 |
+
<th>falcon-mamba-7b-instruct</th>
|
100 |
+
<th>Llama-3.1-8B-Instruct</th>
|
101 |
+
<th>Qwen2-7B-Instruct</th>
|
102 |
+
</tr>
|
103 |
+
</thead>
|
104 |
+
<tbody>
|
105 |
+
<tr>
|
106 |
+
<td rowspan="3">General</td>
|
107 |
+
<td>MMLU (5-shot)</td>
|
108 |
+
<td>-</td>
|
109 |
+
<td>-</td>
|
110 |
+
<td>-</td>
|
111 |
+
<td>-</68.5%>
|
112 |
+
<td>-</td>
|
113 |
+
</tr>
|
114 |
+
<tr>
|
115 |
+
<td>MMLU-PRO (5-shot)</td>
|
116 |
+
<td>-</td>
|
117 |
+
<td>-</td>
|
118 |
+
<td>-</td>
|
119 |
+
<td>-</29.6%>
|
120 |
+
<td>-</td>
|
121 |
+
</tr>
|
122 |
+
<tr>
|
123 |
+
<td>IFEval</td>
|
124 |
+
<td>-</td>
|
125 |
+
<td>-</td>
|
126 |
+
<td>-</td>
|
127 |
+
<td>-</78.6%>
|
128 |
+
<td>-</td>
|
129 |
+
</tr>
|
130 |
+
<tr>
|
131 |
+
<td rowspan="2">Math</td>
|
132 |
+
<td>GSM8K (5-shot)</td>
|
133 |
+
<td>-</td>
|
134 |
+
<td>-</td>
|
135 |
+
<td>-</td>
|
136 |
+
<td>-</td>
|
137 |
+
<td>-</td>
|
138 |
+
</tr>
|
139 |
+
<tr>
|
140 |
+
<td>MATH(4-shot)</td>
|
141 |
+
<td>-</td>
|
142 |
+
<td>-</td>
|
143 |
+
<td>-</td>
|
144 |
+
<td>-</td>
|
145 |
+
<td>-</td>
|
146 |
+
</tr>
|
147 |
+
<tr>
|
148 |
+
<td rowspan="4">Reasoning</td>
|
149 |
+
<td>Arc Challenge (25-shot)</td>
|
150 |
+
<td>-</td>
|
151 |
+
<td>-</td>
|
152 |
+
<td>-</td>
|
153 |
+
<td>-</td>
|
154 |
+
<td>-</td>
|
155 |
+
</tr>
|
156 |
+
<tr>
|
157 |
+
<td>GPQA (0-shot)</td>
|
158 |
+
<td>-</td>
|
159 |
+
<td>-</td>
|
160 |
+
<td>-</td>
|
161 |
+
<td>-</2.4%>
|
162 |
+
<td>-</td>
|
163 |
+
</tr>
|
164 |
+
<tr>
|
165 |
+
<td>MUSR (0-shot)</td>
|
166 |
+
<td>-</td>
|
167 |
+
<td>-</td>
|
168 |
+
<td>-</td>
|
169 |
+
<td>-</8.4%>
|
170 |
+
<td>-</td>
|
171 |
+
</tr>
|
172 |
+
<tr>
|
173 |
+
<td>BBH (3-shot)</td>
|
174 |
+
<td>-</td>
|
175 |
+
<td>-</td>
|
176 |
+
<td>-</td>
|
177 |
+
<td>-</29.9%>
|
178 |
+
<td>-</td>
|
179 |
+
</tr>
|
180 |
+
<tr>
|
181 |
+
<td rowspan="4">CommonSense Understanding</td>
|
182 |
+
<td>PIQA (0-shot)</td>
|
183 |
+
<td>-</td>
|
184 |
+
<td>-</td>
|
185 |
+
<td>-</td>
|
186 |
+
<td>-</td>
|
187 |
+
<td>-</td>
|
188 |
+
</tr>
|
189 |
+
<tr>
|
190 |
+
<td>SciQ (0-shot)</td>
|
191 |
+
<td>-</td>
|
192 |
+
<td>-</td>
|
193 |
+
<td>-</td>
|
194 |
+
<td>-</td>
|
195 |
+
<td>-</td>
|
196 |
+
</tr>
|
197 |
+
<tr>
|
198 |
+
<td>Winogrande (0-shot)</td>
|
199 |
+
<td>-</td>
|
200 |
+
<td>-</td>
|
201 |
+
<td>-</td>
|
202 |
+
<td>-</td>
|
203 |
+
<td>-</td>
|
204 |
+
</tr>
|
205 |
+
<tr>
|
206 |
+
<td>OpenbookQA (0-shot)</td>
|
207 |
+
<td>-</td>
|
208 |
+
<td>-</td>
|
209 |
+
<td>-</td>
|
210 |
+
<td>-</td>
|
211 |
+
<td>-</td>
|
212 |
+
</tr>
|
213 |
+
</tbody>
|
214 |
+
</table>
|
215 |
+
|
216 |
+
|
217 |
+
# Citation
|
218 |
+
If Falcon3 family were helpful to your work, feel free to give us a cite.
|
219 |
+
|
220 |
+
```
|
221 |
+
@misc{Falcon3,
|
222 |
+
title = {The Falcon 3 family of Open Models},
|
223 |
+
author = {TII Team},
|
224 |
+
month = {December},
|
225 |
+
year = {2024}
|
226 |
+
}
|
227 |
+
```
|