jncraton commited on
Commit
60522d8
1 Parent(s): bf47ad0

Upload folder using huggingface_hub

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