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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
library_name: transformers
|
3 |
+
tags:
|
4 |
+
- falcon3
|
5 |
+
base_model: tiiuae/Falcon3-10B-Base
|
6 |
+
license: other
|
7 |
+
license_name: falcon-llm-license
|
8 |
+
license_link: https://falconllm.tii.ae/falcon-terms-and-conditions.html
|
9 |
+
---
|
10 |
+
### exl2 quant (measurement.json in main branch)
|
11 |
+
---
|
12 |
+
### check revisions for quants
|
13 |
+
---
|
14 |
+
|
15 |
+
|
16 |
+
<div align="center">
|
17 |
+
<img src="https://huggingface.co/datasets/tiiuae/documentation-images/resolve/main/general/falco3-logo.png" alt="drawing" width="500"/>
|
18 |
+
</div>
|
19 |
+
|
20 |
+
# Falcon3-10B-Instruct
|
21 |
+
|
22 |
+
**Falcon3** family of Open Foundation Models is a set of pretrained and instruct LLMs ranging from 1B to 10B parameters.
|
23 |
+
|
24 |
+
This repository contains the **Falcon3-10B-Instruct**. It achieves state-of-the-art results (at the time of release) on reasoning, language understanding, instruction following, code and mathematics tasks.
|
25 |
+
Falcon3-10B-Instruct supports 4 languages (English, French, Spanish, Portuguese) and a context length of up to 32K.
|
26 |
+
|
27 |
+
|
28 |
+
## Model Details
|
29 |
+
- Architecture
|
30 |
+
- Transformer-based causal decoder-only architecture
|
31 |
+
- 40 decoder blocks
|
32 |
+
- Grouped Query Attention (GQA) for faster inference: 12 query heads and 4 key-value heads
|
33 |
+
- Wider head dimension: 256
|
34 |
+
- High RoPE value to support long context understanding: 1000042
|
35 |
+
- Uses SwiGLu and RMSNorm
|
36 |
+
- 32K context length
|
37 |
+
- 131K vocab size
|
38 |
+
- Depth up-scaled from **Falcon3-7B-Base** with 2 Teratokens of datasets comprising of web, code, STEM, high quality and mutlilingual data using 1024 H100 GPU chips
|
39 |
+
- Posttrained on 1.2 million samples of STEM, conversational, code, safety and function call data
|
40 |
+
- Supports EN, FR, ES, PT
|
41 |
+
- Developed by [Technology Innovation Institute](https://www.tii.ae)
|
42 |
+
- License: TII Falcon-LLM License 2.0
|
43 |
+
- Model Release Date: December 2024
|
44 |
+
|
45 |
+
|
46 |
+
## Getting started
|
47 |
+
|
48 |
+
<details>
|
49 |
+
<summary> Click to expand </summary>
|
50 |
+
|
51 |
+
```python
|
52 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
53 |
+
|
54 |
+
|
55 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
56 |
+
|
57 |
+
model_name = "tiiuae/Falcon3-10B-Instruct"
|
58 |
+
|
59 |
+
model = AutoModelForCausalLM.from_pretrained(
|
60 |
+
model_name,
|
61 |
+
torch_dtype="auto",
|
62 |
+
device_map="auto"
|
63 |
+
)
|
64 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
65 |
+
|
66 |
+
prompt = "How many hours in one day?"
|
67 |
+
messages = [
|
68 |
+
{"role": "system", "content": "You are a helpful friendly assistant Falcon3 from TII, try to follow instructions as much as possible."},
|
69 |
+
{"role": "user", "content": prompt}
|
70 |
+
]
|
71 |
+
text = tokenizer.apply_chat_template(
|
72 |
+
messages,
|
73 |
+
tokenize=False,
|
74 |
+
add_generation_prompt=True
|
75 |
+
)
|
76 |
+
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
|
77 |
+
|
78 |
+
generated_ids = model.generate(
|
79 |
+
**model_inputs,
|
80 |
+
max_new_tokens=1024
|
81 |
+
)
|
82 |
+
generated_ids = [
|
83 |
+
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
|
84 |
+
]
|
85 |
+
|
86 |
+
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
87 |
+
print(response)
|
88 |
+
```
|
89 |
+
|
90 |
+
</details>
|
91 |
+
|
92 |
+
<br>
|
93 |
+
|
94 |
+
## Benchmarks
|
95 |
+
We report in the following table our internal pipeline benchmarks.
|
96 |
+
- We use [lm-evaluation harness](https://github.com/EleutherAI/lm-evaluation-harness).
|
97 |
+
- We report **raw scores** obtained by applying chat template **without fewshot_as_multiturn** (unlike Llama3.1).
|
98 |
+
- We use same batch-size across all models.
|
99 |
+
|
100 |
+
|
101 |
+
|
102 |
+
<table border="1" style="width: 100%; text-align: center; border-collapse: collapse;">
|
103 |
+
<colgroup>
|
104 |
+
<col style="width: 10%;">
|
105 |
+
<col style="width: 10%;">
|
106 |
+
<col style="width: 7%;">
|
107 |
+
<col style="width: 7%;">
|
108 |
+
<col style="background-color: rgba(80, 15, 213, 0.5); width: 7%;">
|
109 |
+
</colgroup>
|
110 |
+
<thead>
|
111 |
+
<tr>
|
112 |
+
<th>Category</th>
|
113 |
+
<th>Benchmark</th>
|
114 |
+
<th>Yi-1.5-9B-Chat</th>
|
115 |
+
<th>Mistral-Nemo-Base-2407 (12B)</th>
|
116 |
+
<th>Falcon3-10B-Instruct</th>
|
117 |
+
</tr>
|
118 |
+
</thead>
|
119 |
+
<tbody>
|
120 |
+
<tr>
|
121 |
+
<td rowspan="3">General</td>
|
122 |
+
<td>MMLU (5-shot)</td>
|
123 |
+
<td>70</td>
|
124 |
+
<td>65.9</td>
|
125 |
+
<td><b>71.6</td>
|
126 |
+
</tr>
|
127 |
+
<tr>
|
128 |
+
<td>MMLU-PRO (5-shot)</td>
|
129 |
+
<td>39.6</td>
|
130 |
+
<td>32.7</td>
|
131 |
+
<td><b>44</td>
|
132 |
+
</tr>
|
133 |
+
<tr>
|
134 |
+
<td>IFEval</td>
|
135 |
+
<td>57.6</td>
|
136 |
+
<td>63.4</td>
|
137 |
+
<td><b>78</td>
|
138 |
+
</tr>
|
139 |
+
<tr>
|
140 |
+
<td rowspan="3">Math</td>
|
141 |
+
<td>GSM8K (5-shot)</td>
|
142 |
+
<td>76.6</td>
|
143 |
+
<td>73.8</td>
|
144 |
+
<td><b>83.1</td>
|
145 |
+
</tr>
|
146 |
+
<tr>
|
147 |
+
<td>GSM8K (8-shot, COT)</td>
|
148 |
+
<td>78.5</td>
|
149 |
+
<td>73.6</td>
|
150 |
+
<td><b>81.3</td>
|
151 |
+
</tr>
|
152 |
+
<tr>
|
153 |
+
<td>MATH Lvl-5 (4-shot)</td>
|
154 |
+
<td>8.8</td>
|
155 |
+
<td>0.4</td>
|
156 |
+
<td><b>22.1</td>
|
157 |
+
</tr>
|
158 |
+
<tr>
|
159 |
+
<td rowspan="5">Reasoning</td>
|
160 |
+
<td>Arc Challenge (25-shot)</td>
|
161 |
+
<td>51.9</td>
|
162 |
+
<td>61.6</td>
|
163 |
+
<td><b>64.5</td>
|
164 |
+
</tr>
|
165 |
+
<tr>
|
166 |
+
<td>GPQA (0-shot)</td>
|
167 |
+
<td><b>35.4</td>
|
168 |
+
<td>33.2</td>
|
169 |
+
<td>33.5</td>
|
170 |
+
</tr>
|
171 |
+
<tr>
|
172 |
+
<td>GPQA (0-shot, COT)</td>
|
173 |
+
<td>16</td>
|
174 |
+
<td>12.7</td>
|
175 |
+
<td><b>32.6</td>
|
176 |
+
</tr>
|
177 |
+
<tr>
|
178 |
+
<td>MUSR (0-shot)</td>
|
179 |
+
<td><b>41.9</td>
|
180 |
+
<td>38.1</td>
|
181 |
+
<td>41.1</td>
|
182 |
+
</tr>
|
183 |
+
<tr>
|
184 |
+
<td>BBH (3-shot)</td>
|
185 |
+
<td>49.2</td>
|
186 |
+
<td>43.6</td>
|
187 |
+
<td><b>58.4</td>
|
188 |
+
</tr>
|
189 |
+
<tr>
|
190 |
+
<td rowspan="4">CommonSense Understanding</td>
|
191 |
+
<td>PIQA (0-shot)</td>
|
192 |
+
<td>76.4</td>
|
193 |
+
<td>78.2</td>
|
194 |
+
<td><b>78.4</td>
|
195 |
+
</tr>
|
196 |
+
<tr>
|
197 |
+
<td>SciQ (0-shot)</td>
|
198 |
+
<td>61.7</td>
|
199 |
+
<td>76.4</td>
|
200 |
+
<td><b>90.4</td>
|
201 |
+
</tr>
|
202 |
+
<tr>
|
203 |
+
<td>Winogrande (0-shot)</td>
|
204 |
+
<td>-</td>
|
205 |
+
<td>-</td>
|
206 |
+
<td>71.3</td>
|
207 |
+
</tr>
|
208 |
+
<tr>
|
209 |
+
<td>OpenbookQA (0-shot)</td>
|
210 |
+
<td>43.2</td>
|
211 |
+
<td>47.4</td>
|
212 |
+
<td><b>48.2</td>
|
213 |
+
</tr>
|
214 |
+
<tr>
|
215 |
+
<td rowspan="2">Instructions following</td>
|
216 |
+
<td>MT-Bench (avg)</td>
|
217 |
+
<td>8.28</td>
|
218 |
+
<td><b>8.6</td>
|
219 |
+
<td>8.17</td>
|
220 |
+
</tr>
|
221 |
+
<tr>
|
222 |
+
<td>Alpaca (WC)</td>
|
223 |
+
<td>25.81</td>
|
224 |
+
<td><b>45.44</td>
|
225 |
+
<td>24.7</td>
|
226 |
+
</tr>
|
227 |
+
<tr>
|
228 |
+
<td>Tool use</td>
|
229 |
+
<td>BFCL AST (avg)</td>
|
230 |
+
<td>48.4</td>
|
231 |
+
<td>74.2</td>
|
232 |
+
<td><b>86.3</td>
|
233 |
+
</tr>
|
234 |
+
<tr>
|
235 |
+
<td rowspan="2">Code</td>
|
236 |
+
<td>EvalPlus (0-shot) (avg)</td>
|
237 |
+
<td>69.4</td>
|
238 |
+
<td>58.9</td>
|
239 |
+
<td><b>74.7</b></td>
|
240 |
+
</tr>
|
241 |
+
<tr>
|
242 |
+
<td>Multipl-E (0-shot) (avg)</td>
|
243 |
+
<td>-</td>
|
244 |
+
<td>34.5</td>
|
245 |
+
<td><b>45.8</b></td>
|
246 |
+
</tr>
|
247 |
+
</tbody>
|
248 |
+
</table>
|
249 |
+
|
250 |
+
## Useful links
|
251 |
+
- View our [release blogpost](https://huggingface.co/blog/falcon3).
|
252 |
+
- Feel free to join [our discord server](https://discord.gg/fwXpMyGc) if you have any questions or to interact with our researchers and developers.
|
253 |
+
|
254 |
+
## Technical Report
|
255 |
+
|
256 |
+
Coming soon....
|
257 |
+
|
258 |
+
## Citation
|
259 |
+
If Falcon3 family were helpful in your work, feel free to give us a cite.
|
260 |
+
|
261 |
+
```
|
262 |
+
@misc{Falcon3,
|
263 |
+
title = {The Falcon 3 family of Open Models},
|
264 |
+
author = {TII Team},
|
265 |
+
month = {December},
|
266 |
+
year = {2024}
|
267 |
+
}
|
268 |
+
```
|
269 |
+
|