lucyknada commited on
Commit
a0be932
·
verified ·
1 Parent(s): 8e5dfe8

Upload ./README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +289 -0
README.md ADDED
@@ -0,0 +1,289 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ - fr
5
+ - es
6
+ - pt
7
+ tags:
8
+ - falcon3
9
+ base_model: tiiuae/Falcon3-3B-Instruct
10
+ license: other
11
+ license_name: falcon-llm-license
12
+ license_link: https://falconllm.tii.ae/falcon-terms-and-conditions.html
13
+ library_name: transformers
14
+ ---
15
+ ### exl2 quant (measurement.json in main branch)
16
+ ---
17
+ ### check revisions for quants
18
+ ---
19
+
20
+
21
+ <div align="center">
22
+ <img src="https://huggingface.co/datasets/tiiuae/documentation-images/resolve/main/general/falco3-logo.png" alt="drawing" width="500"/>
23
+ </div>
24
+
25
+ # Falcon3-3B-Instruct
26
+
27
+ **Falcon3** family of Open Foundation Models is a set of pretrained and instruct LLMs ranging from 1B to 10B parameters.
28
+
29
+ **Falcon3-3B-Instruct** achieves strong results on reasoning, language understanding, instruction following, code and mathematics tasks.
30
+ Falcon3-3B-Instruct supports 4 languages (English, French, Spanish, Portuguese) and a context length of up to 32K.
31
+
32
+ ## Model Details
33
+ - Architecture
34
+ - Transformer-based causal decoder-only architecture
35
+ - 22 decoder blocks
36
+ - Grouped Query Attention (GQA) for faster inference: 12 query heads and 4 key-value heads
37
+ - Wider head dimension: 256
38
+ - High RoPE value to support long context understanding: 1000042
39
+ - Uses SwiGLU and RMSNorm
40
+ - 32K context length
41
+ - 131K vocab size
42
+ - Pruned and healed from Falcon3-7B-Base on only 100 Gigatokens of datasets comprising of web, code, STEM, high quality and mutlilingual data using 1024 H100 GPU chips
43
+ - Posttrained on 1.2 million samples of STEM, conversational, code, safety and function call data
44
+ - Supports EN, FR, ES, PT
45
+ - Developed by [Technology Innovation Institute](https://www.tii.ae)
46
+ - License: TII Falcon-LLM License 2.0
47
+ - Model Release Date: December 2024
48
+
49
+
50
+ ## Getting started
51
+
52
+ <details>
53
+ <summary> Click to expand </summary>
54
+
55
+ ```python
56
+ from transformers import AutoTokenizer, AutoModelForCausalLM
57
+
58
+ model_name = "tiiuae/Falcon3-3B-Instruct"
59
+
60
+ model = AutoModelForCausalLM.from_pretrained(
61
+ model_name,
62
+ torch_dtype="auto",
63
+ device_map="auto"
64
+ )
65
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
66
+
67
+ prompt = "How many hours in one day?"
68
+ messages = [
69
+ {"role": "system", "content": "You are a helpful friendly assistant Falcon3 from TII, try to follow instructions as much as possible."},
70
+ {"role": "user", "content": prompt}
71
+ ]
72
+ text = tokenizer.apply_chat_template(
73
+ messages,
74
+ tokenize=False,
75
+ add_generation_prompt=True
76
+ )
77
+ model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
78
+
79
+ generated_ids = model.generate(
80
+ **model_inputs,
81
+ max_new_tokens=1024
82
+ )
83
+ generated_ids = [
84
+ output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
85
+ ]
86
+
87
+ response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
88
+ print(response)
89
+ ```
90
+
91
+ </details>
92
+
93
+ <br>
94
+
95
+ ## Benchmarks
96
+ We report in the following table our internal pipeline benchmarks.
97
+ - We use [lm-evaluation harness](https://github.com/EleutherAI/lm-evaluation-harness).
98
+ - We report **raw scores** obtained by applying chat template **without fewshot_as_multiturn** (unlike Llama3.1).
99
+ - We use same batch-size across all models.
100
+
101
+ <table border="1" style="width: 100%; text-align: center; border-collapse: collapse;">
102
+ <colgroup>
103
+ <col style="width: 10%;">
104
+ <col style="width: 10%;">
105
+ <col style="width: 7%;">
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>Llama-3.2-3B-Instruct</th>
115
+ <th>Qwen2.5-3B-Instruct</th>
116
+ <th>Nemotron-Mini-4B-Instruct</th>
117
+ <th>Falcon3-3B-Instruct</th>
118
+ </tr>
119
+ </thead>
120
+ <tbody>
121
+ <tr>
122
+ <td rowspan="3">General</td>
123
+ <td>MMLU (5-shot)</td>
124
+ <td>29.3</td>
125
+ <td>56.2</td>
126
+ <td><b>56.4</b></td>
127
+ <td>55.7</td>
128
+ </tr>
129
+ <tr>
130
+ <td>MMLU-PRO (5-shot)</td>
131
+ <td>11.9</td>
132
+ <td>17.2</td>
133
+ <td>23.3</td>
134
+ <td><b>29.7</b></td>
135
+ </tr>
136
+ <tr>
137
+ <td>IFEval</td>
138
+ <td><b>73.9</b></td>
139
+ <td>64.2</td>
140
+ <td>66.5</td>
141
+ <td>68.3</td>
142
+ </tr>
143
+ <tr>
144
+ <td rowspan="3">Math</td>
145
+ <td>GSM8K (5-shot)</td>
146
+ <td>68.5</td>
147
+ <td>58.5</td>
148
+ <td>46.9</td>
149
+ <td><b>71.9</b></td>
150
+ </tr>
151
+ <tr>
152
+ <td>GSM8K (8-shot, COT)</td>
153
+ <td><b>74.5</b></td>
154
+ <td>64.0</td>
155
+ <td>46.5</td>
156
+ <td>71.6</td>
157
+ </tr>
158
+ <tr>
159
+ <td>MATH Lvl-5 (4-shot)</td>
160
+ <td>2.4</td>
161
+ <td>0.0</td>
162
+ <td>0.0</td>
163
+ <td><b>19.9</b></td>
164
+ </tr>
165
+ <tr>
166
+ <td rowspan="5">Reasoning</td>
167
+ <td>Arc Challenge (25-shot)</td>
168
+ <td>38.9</td>
169
+ <td>50.0</td>
170
+ <td>51.2</td>
171
+ <td><b>58.5</b></td>
172
+ </tr>
173
+ <tr>
174
+ <td>GPQA (0-shot)</td>
175
+ <td>28.1</td>
176
+ <td>29.2</td>
177
+ <td>27.0</td>
178
+ <td><b>29.6</b></td>
179
+ </tr>
180
+ <tr>
181
+ <td>GPQA (0-shot, COT)</td>
182
+ <td>11.3</td>
183
+ <td>11.0</td>
184
+ <td>12.2</td>
185
+ <td><b>26.5</b></td>
186
+ </tr>
187
+ <tr>
188
+ <td>MUSR (0-shot)</td>
189
+ <td>34.9</td>
190
+ <td><b>40.2</b></td>
191
+ <td>38.9</td>
192
+ <td>39.0</td>
193
+ </tr>
194
+ <tr>
195
+ <td>BBH (3-shot)</td>
196
+ <td>33.1</td>
197
+ <td>44.1</td>
198
+ <td>38.1</td>
199
+ <td><b>45.4</b></td>
200
+ </tr>
201
+ <tr>
202
+ <td rowspan="4">CommonSense Understanding</td>
203
+ <td>PIQA (0-shot)</td>
204
+ <td>74.6</td>
205
+ <td>73.8</td>
206
+ <td>74.6</td>
207
+ <td><b>75.6</b></td>
208
+ </tr>
209
+ <tr>
210
+ <td>SciQ (0-shot)</td>
211
+ <td>77.2</td>
212
+ <td>60.7</td>
213
+ <td>71.0</td>
214
+ <td><b>95.5</b></td>
215
+ </tr>
216
+ <tr>
217
+ <td>Winogrande (0-shot)</td>
218
+ <td>-</td>
219
+ <td>-</td>
220
+ <td>-</td>
221
+ <td><b>65.0</b></td>
222
+ </tr>
223
+ <tr>
224
+ <td>OpenbookQA (0-shot)</td>
225
+ <td>40.8</td>
226
+ <td>41.2</td>
227
+ <td><b>43.2</b></td>
228
+ <td>42.2</td>
229
+ </tr>
230
+ <tr>
231
+ <td rowspan="2">Instructions following</td>
232
+ <td>MT-Bench (avg)</td>
233
+ <td>7.1</td>
234
+ <td><b>8.0</b></td>
235
+ <td>6.7</td>
236
+ <td>7.2</td>
237
+ </tr>
238
+ <tr>
239
+ <td>Alpaca (WC)</td>
240
+ <td><b>19.4</b></td>
241
+ <td>19.4</td>
242
+ <td>9.6</td>
243
+ <td>15.5</td>
244
+ </tr>
245
+ <tr>
246
+ <td>Tool use</td>
247
+ <td>BFCL AST (avg)</td>
248
+ <td><b>85.2</b></td>
249
+ <td>84.8</td>
250
+ <td>59.8</td>
251
+ <td>65.3</td>
252
+ </tr>
253
+ <tr>
254
+ <td rowspan="2">Code</td>
255
+ <td>EvalPlus (0-shot) (avg)</td>
256
+ <td>55.2</td>
257
+ <td><b>69.4<b></td>
258
+ <td>40.0</td>
259
+ <td>52.9</td>
260
+ </tr>
261
+ <tr>
262
+ <td>Multipl-E (0-shot) (avg)</td>
263
+ <td>31.6</td>
264
+ <td>29.2</td>
265
+ <td>19.6</td>
266
+ <td><b>32.9</b></td>
267
+ </tr>
268
+ </tbody>
269
+ </table>
270
+
271
+ ## Useful links
272
+ - View our [release blogpost](https://huggingface.co/blog/falcon3).
273
+ - Feel free to join [our discord server](https://discord.gg/fwXpMyGc) if you have any questions or to interact with our researchers and developers.
274
+
275
+ ## Technical Report
276
+ Coming soon....
277
+
278
+ ## Citation
279
+ If the Falcon3 family of models were helpful to your work, feel free to give us a cite.
280
+
281
+ ```
282
+ @misc{Falcon3,
283
+ title = {The Falcon 3 Family of Open Models},
284
+ url = {https://huggingface.co/blog/falcon3},
285
+ author = {Falcon-LLM Team},
286
+ month = {December},
287
+ year = {2024}
288
+ }
289
+ ```